Skip to content

Commit

Permalink
Fix format & links for gensim.similarities.docsim (#2030)
Browse files Browse the repository at this point in the history
* Fixed links

* remove header of "examples"
  • Loading branch information
CLearERR authored and menshikh-iv committed Apr 13, 2018
1 parent 2024be9 commit 760c6f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gensim/similarities/docsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

"""Computing similarities across a collection of documents in the Vector Space Model.
The main class is :class:`~gensim.similarity.docsim.Similarity`, which builds an index for a given set of documents.
The main class is :class:`~gensim.similarities.docsim.Similarity`, which builds an index for a given set of documents.
Once the index is built, you can perform efficient queries like "Tell me how similar is this query document to each
document in the index?". The result is a vector of numbers as large as the size of the initial set of documents,
that is, one float for each index document. Alternatively, you can also request only the top-N most
Expand All @@ -15,13 +15,14 @@
How It Works
------------
The :class:`~gensim.similarity.docsim.Similarity` class splits the index into several smaller sub-indexes ("shards"),
The :class:`~gensim.similarities.docsim.Similarity` class splits the index into several smaller sub-indexes ("shards"),
which are disk-based. If your entire index fits in memory (~hundreds of thousands documents for 1GB of RAM),
you can also use the :class:`~gensim.similarity.docsim.MatrixSimilarity`
or :class:`~gensim.similarity.docsim.SparseMatrixSimilarity` classes directly.
you can also use the :class:`~gensim.similarities.docsim.MatrixSimilarity`
or :class:`~gensim.similarities.docsim.SparseMatrixSimilarity` classes directly.
These are more simple but do not scale as well (they keep the entire index in RAM, no sharding).
Once the index has been initialized, you can query for document similarity simply by:
>>> from gensim.test.utils import common_corpus, common_dictionary, get_tmpfile
>>>
>>> index_tmpfile = get_tmpfile("index")
Expand Down Expand Up @@ -171,7 +172,6 @@ def get_document_id(self, pos):
The vector is of the same type as the underlying index (ie., dense for
:class:`~gensim.similarities.docsim.MatrixSimilarity`
and scipy.sparse for :class:`~gensim.similarities.docsim.SparseMatrixSimilarity`.
TODO: Can dense be scipy.sparse?
"""
assert 0 <= pos < len(self), "requested position out of range"
Expand Down

0 comments on commit 760c6f4

Please sign in to comment.