This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import time | |
| import string | |
| import pickle | |
| from operator import itemgetter | |
| from nltk.corpus import stopwords as sw | |
| from nltk.corpus import wordnet as wn | |
| from nltk import wordpunct_tokenize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # (C) Mathieu Blondel, November 2013 | |
| # License: BSD 3 clause | |
| import numpy as np | |
| def ranking_precision_score(y_true, y_score, k=10): | |
| """Precision at rank k | |
| Parameters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Information Retrieval metrics | |
| Useful Resources: | |
| http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt | |
| http://www.nii.ac.jp/TechReports/05-014E.pdf | |
| http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf | |
| http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf | |
| Learning to Rank for Information Retrieval (Tie-Yan Liu) | |
| """ | |
| import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CCA2 | Name | CCA3 | Nationality | |
|---|---|---|---|---|
| AD | Andorra | AND | Andorran | |
| AE | United Arab Emirates | ARE | Emirati | |
| AF | Afghanistan | AFG | Afghan | |
| AG | Antigua and Barbuda | ATG | Antiguan, Barbudan | |
| AI | Anguilla | AIA | Anguillian | |
| AL | Albania | ALB | Albanian | |
| AM | Armenia | ARM | Armenian | |
| AN | Netherlands Antilles | ANT | Dutch | |
| AO | Angola | AGO | Angolan |