Skip to content

Commit

Permalink
WMD docstring: add tutorial link and query example (#813)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmylk authored Aug 4, 2016
1 parent 35bad8b commit 6613f05
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gensim/similarities/docsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,13 @@ class WmdSimilarity(interfaces.SimilarityABC):
.. Matt Kusner et al. "From Word Embeddings To Document Distances".
Example:
# See Tutorial Notebook for more examples https://github.com/RaRe-Technologies/gensim/blob/develop/docs/notebooks/WMD_tutorial.ipynb
>>> # Given a document collection "corpus", train word2vec model.
>>> model = word2vec(corpus)
>>> instance = WmdSimilarity(corpus, model, num_best=10)
>>> # Make query.
>>> query = 'Very good, you should seat outdoor.'
>>> sims = instance[query]
"""
def __init__(self, corpus, w2v_model, num_best=None, normalize_w2v_and_replace=True, chunksize=256):
Expand Down

0 comments on commit 6613f05

Please sign in to comment.