Gensim – Vector Space Modelling for Humans — gensim
Description: Efficient topic modelling in Python

### Navigation

- index
- modules |
- next |
- Gensim home|
- API reference|
- Tutorials »

# Gensim – Vector Space Modelling for Humans

What’s new?

- 05/10/2011: version 0.8.1 released: new document similarity server and several speed-ups and fixes.
- 09/09/2011: moved website to radimrehurek.com.
- 19/06/2011: version 0.8.0 is out! Faster & better: walkthrough of the changes.
- 12/02/2011: faster and leaner Latent Semantic Indexing (LSI) and Latent Dirichlet Allocation (LDA):
  - Processing the English Wikipedia, 3.2 million documents (NIPS workshop paper)
  - Distributed Latent Semantic Analysis & Distributed Latent Dirichlet Allocation

For an overview of what you can (or cannot) do with gensim, go to the introduction.

For installation and troubleshooting, see the installation page and the gensim discussion group.

For examples on how to convert text to vectors and work with the result, try the tutorials.

When citing gensim in academic papers, use this BibTeX entry.

## Quick Reference Example

    >>> from gensim import corpora, models, similarities
    >>>
    >>> # Load corpus iterator from a Matrix Market file on disk.
    >>> # See Tutorial 1 on text corpora and vectors.
    >>> corpus = corpora.MmCorpus('/path/to/corpus.mm')
    >>>
    >>> # Initialize a transformation (Latent Semantic Indexing with 200 latent dimensions).
    >>> # See Tutorial 2 on semantic models.
    >>> lsi = models.LsiModel(corpus, num_topics=200)
    >>>
    >>> # Convert another corpus to the latent space and index it.
    >>> # See Tutorial 3 on similarity queries.
    >>> index = similarities.MatrixSimilarity(lsi[another_corpus])
    >>>
    >>> # determine similarity of a query document against each document in the index
    >>> sims = index[query]

### Navigation

- index
- modules |
- next |
- Gensim home|
- API reference|
- Tutorials »