Skip to content

Commit

Permalink
add kgraph symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
piskvorky committed Apr 20, 2014
1 parent 4e63f53 commit 78de4cc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ ks="1 10 100 1000"
OPENBLAS_NUM_THREADS=1 run_combinations "gensim" "exact" $ks
run_combinations "annoy" "1 10 50 100 500" $ks
run_combinations "flann" "7 9 99" $ks
run_combinations "kgraph" "default" $ks
1 change: 1 addition & 0 deletions shootout_kgraph.py
1 change: 1 addition & 0 deletions wikisim_server/runserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def similars(self, *args, **kwargs):
query = self.title2id[title] # convert query from article name (string) to index id (int)
nn = self.index_annoy.get_nns_by_item(query, self.k)
result = [self.id2title[pos2] for pos2 in nn] # convert top10 from ids back to article names
logger.info("similars to %s: %s" % (title, result))
else:
result = []
return {'nn': result, 'num_articles': len(self.id2title)}
Expand Down

0 comments on commit 78de4cc

Please sign in to comment.