Repository: piskvorky/gensim

Issue:
`WmdSimilarity` corpus type mismatch in documentation 

#### Description
It seems that the  WmdSimilarity doesn't need the bow_corpus .
The corpus can be in token level, so the following code is not needed:
```python
bow_corpus = [dictionary.doc2bow(document) for document in common_texts]
```

#### Versions
```
Darwin-15.6.0-x86_64-i386-64bit
Python 3.6.3 |Intel Corporation| (default, May  3 2018, 23:25:54) 
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)]
NumPy 1.14.3
SciPy 1.1.0
gensim 3.4.0
FAST_VERSION 1
```



Discussion:
Thanks @nooralahzadeh  for the report, need update docstring of https://github.com/RaRe-Technologies/gensim/blob/2ce4699e048a4bb02be06b0412a42da9bd7fbdfe/gensim/similarities/docsim.py#L956
- intro code-example
- type/description in `__init__` (`corpus` parameter) and `get_similarities` (`query` parameter)
I'd like to take this issue if no one is working on it already.

Resolving patch:
diff --git a/gensim/similarities/docsim.py b/gensim/similarities/docsim.py
--- a/gensim/similarities/docsim.py
+++ b/gensim/similarities/docsim.py
@@ -826,7 +826,7 @@ def get_similarities(self, query):
 
         Parameters
         ----------
-        query : {list of (int, number), iterable of list of (int, number), :class:`scipy.sparse.csr_matrix`
+        query : {list of (int, number), iterable of list of (int, number), :class:`scipy.sparse.csr_matrix`}
             Document or collection of documents.
 
         Return
@@ -938,7 +938,7 @@ def get_similarities(self, query):
 
         Parameters
         ----------
-        query : {list of (int, number), iterable of list of (int, number)
+        query : {list of (int, number), iterable of list of (int, number)}
             Document or collection of documents.
 
         Return
@@ -978,7 +978,7 @@ def __str__(self):
 
 
 class WmdSimilarity(interfaces.SimilarityABC):
-    """Compute negative WMD similarity against a corpus of documents by storing the index matrix in memory.
+    """Compute negative WMD similarity against a corpus of documents.
 
     See :class:`~gensim.models.keyedvectors.WordEmbeddingsKeyedVectors` for more information.
     Also, tutorial `notebook
@@ -999,17 +999,14 @@ class WmdSimilarity(interfaces.SimilarityABC):
     .. sourcecode:: pycon
 
         >>> from gensim.test.utils import common_texts
-        >>> from gensim.corpora import Dictionary
         >>> from gensim.models import Word2Vec
         >>> from gensim.similarities import WmdSimilarity
         >>>
         >>> model = Word2Vec(common_texts, size=20, min_count=1)  # train word-vectors
-        >>> dictionary = Dictionary(common_texts)
-        >>> bow_corpus = [dictionary.doc2bow(document) for document in common_texts]
         >>>
-        >>> index = WmdSimilarity(bow_corpus, model)
+        >>> index = WmdSimilarity(common_texts, model)
         >>> # Make query.
-        >>> query = 'trees'
+        >>> query = ['trees']
         >>> sims = index[query]
 
     """
@@ -1018,8 +1015,8 @@ def __init__(self, corpus, w2v_model, num_best=None, normalize_w2v_and_replace=T
 
         Parameters
         ----------
-        corpus: iterable of list of (int, float)
-            A list of documents in the BoW format.
+        corpus: iterable of list of str
+            A list of documents, each of which is a list of tokens.
         w2v_model: :class:`~gensim.models.word2vec.Word2VecTrainables`
             A trained word2vec model.
         num_best: int, optional
@@ -1058,7 +1055,7 @@ def get_similarities(self, query):
 
         Parameters
         ----------
-        query : {list of (int, number), iterable of list of (int, number)
+        query : {list of str, iterable of list of str}
             Document or collection of documents.
 
         Return
@@ -1194,7 +1191,7 @@ def get_similarities(self, query):
 
         Parameters
         ----------
-        query : {list of (int, number), iterable of list of (int, number), :class:`scipy.sparse.csr_matrix`
+        query : {list of (int, number), iterable of list of (int, number), :class:`scipy.sparse.csr_matrix`}
             Document or collection of documents.
 
         Return


Test patch: