Skip to main content

gensim – Topic Modelling in Python

Travis Wheel

Gensim is a Python library for topic modelling, document indexing and similarity retrieval with large corpora. Target audience is the natural language processing (NLP) and information retrieval (IR) community.

Features

  • All algorithms are memory-independent w.r.t. the corpus size (can process input larger than RAM, streamed, out-of-core),

  • Intuitive interfaces

    • easy to plug in your own input corpus/datastream (trivial streaming API)

    • easy to extend with other Vector Space algorithms (trivial transformation API)

  • Efficient multicore implementations of popular algorithms, such as online Latent Semantic Analysis (LSA/LSI/SVD), Latent Dirichlet Allocation (LDA), Random Projections (RP), Hierarchical Dirichlet Process (HDP) or word2vec deep learning.

  • Distributed computing: can run Latent Semantic Analysis and Latent Dirichlet Allocation on a cluster of computers.

  • Extensive documentation and Jupyter Notebook tutorials.

If this feature list left you scratching your head, you can first read more about the Vector Space Model and unsupervised document analysis on Wikipedia.

Installation

This software depends on NumPy and Scipy, two Python packages for scientific computing. You must have them installed prior to installing gensim.

It is also recommended you install a fast BLAS library before installing NumPy. This is optional, but using an optimized BLAS such as ATLAS or OpenBLAS is known to improve performance by as much as an order of magnitude. On OS X, NumPy picks up the BLAS that comes with it automatically, so you don’t need to do anything special.

The simple way to install gensim is:

pip install -U gensim

Or, if you have instead downloaded and unzipped the source tar.gz package, you’d run:

python setup.py test
python setup.py install

For alternative modes of installation (without root privileges, development installation, optional install features), see the install documentation.

This version has been tested under Python 2.7, 3.5 and 3.6. Support for Python 2.6, 3.3 and 3.4 was dropped in gensim 1.0.0. Install gensim 0.13.4 if you must use Python 2.6, 3.3 or 3.4. Support for Python 2.5 was dropped in gensim 0.10.0; install gensim 0.9.1 if you must use Python 2.5). Gensim’s github repo is hooked against Travis CI for automated testing on every commit push and pull request.

How come gensim is so fast and memory efficient? Isn’t it pure Python, and isn’t Python slow and greedy?

Many scientific algorithms can be expressed in terms of large matrix operations (see the BLAS note above). Gensim taps into these low-level BLAS libraries, by means of its dependency on NumPy. So while gensim-the-top-level-code is pure Python, it actually executes highly optimized Fortran/C under the hood, including multithreading (if your BLAS is so configured).

Memory-wise, gensim makes heavy use of Python’s built-in generators and iterators for streamed data processing. Memory efficiency was one of gensim’s design goals, and is a central feature of gensim, rather than something bolted on as an afterthought.

Documentation

Citing gensim

When citing gensim in academic papers and theses, please use this BibTeX entry:

@inproceedings{rehurek_lrec,
      title = {{Software Framework for Topic Modelling with Large Corpora}},
      author = {Radim {\v R}eh{\r u}{\v r}ek and Petr Sojka},
      booktitle = {{Proceedings of the LREC 2010 Workshop on New
           Challenges for NLP Frameworks}},
      pages = {45--50},
      year = 2010,
      month = May,
      day = 22,
      publisher = {ELRA},
      address = {Valletta, Malta},
      language={English}
}

Gensim is open source software released under the GNU LGPLv2.1 license. Copyright (c) 2009-now Radim Rehurek

Analytics

Metadata

Release files for gensim 3.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gensim 3.8.0
File Size Uploaded
gensim-3.8.0.tar.gz 23.4 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for gensim 3.8.0
File
gensim-3.8.0-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
gensim-3.8.0-cp37-cp37m-manylinux1_i686.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-32 Details
gensim-3.8.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.10+ Intel (x86-64, i386), macOS 10.9+ x86-64, macOS 10.10+ x86-64, macOS 10.9+ Intel (x86-64, i386), macOS 10.6+ Intel (x86-64, i386) Details
gensim-3.8.0-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
gensim-3.8.0-cp36-cp36m-manylinux1_i686.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-32 Details
gensim-3.8.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.10+ x86-64, macOS 10.9+ x86-64, macOS 10.10+ Intel (x86-64, i386), macOS 10.9+ Intel (x86-64, i386), macOS 10.6+ Intel (x86-64, i386) Details
gensim-3.8.0-cp35-cp35m-manylinux1_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64 Details
gensim-3.8.0-cp35-cp35m-manylinux1_i686.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-32 Details
gensim-3.8.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl CPython 3.5 CPython 3.5 pymalloc macOS 10.9+ x86-64, macOS 10.10+ x86-64, macOS 10.9+ Intel (x86-64, i386), macOS 10.6+ Intel (x86-64, i386), macOS 10.10+ Intel (x86-64, i386) Details
gensim-3.8.0-cp27-cp27mu-manylinux1_x86_64.whl CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64 Details
gensim-3.8.0-cp27-cp27mu-manylinux1_i686.whl CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-32 Details
gensim-3.8.0-cp27-cp27m-manylinux1_x86_64.whl CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64 Details
gensim-3.8.0-cp27-cp27m-manylinux1_i686.whl CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-32 Details
gensim-3.8.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl CPython 2.7 CPython 2.7 pymalloc macOS 10.10+ x86-64, macOS 10.9+ x86-64, macOS 10.9+ Intel (x86-64, i386), macOS 10.6+ Intel (x86-64, i386), macOS 10.10+ Intel (x86-64, i386) Details

Total release size: 363.7 MB

Release files / gensim-3.8.0.tar.gz

Download URL gensim-3.8.0.tar.gz
Size 23.4 MB
Tags Source
SHA-256 checksum
How to use checksums
ec5de7ff2bfa8692fa96a846bb5aae52f267fc322fbbe303c1f042d258af5766
BLAKE2b-256 checksum
How to use checksums
3abc1415be59292a23ff123298b4b46ec4be80b3bfe72c8d188b58ab2653dee4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / gensim-3.8.0-cp37-cp37m-manylinux1_x86_64.whl

Download URL gensim-3.8.0-cp37-cp37m-manylinux1_x86_64.whl
Size 24.2 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
577d01923b8b23bd970dc05b67da490d446dcdb8d7b275ab664100fe54a3428c
BLAKE2b-256 checksum
How to use checksums
2d5db89bb0734a7d0c7543f9d78fa56769e46dd68b3063990181e45806584cdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / gensim-3.8.0-cp37-cp37m-manylinux1_i686.whl

Download URL gensim-3.8.0-cp37-cp37m-manylinux1_i686.whl
Size 24.1 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-32
SHA-256 checksum
How to use checksums
ee338476ae4f33e496555bdc6045d6c27a23da6d7340068b6b9056769e897896
BLAKE2b-256 checksum
How to use checksums
38c6f3adff28d8c39dece4d0155d5529d1c9ef7ab7d74de656a7ef72bb08128a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / gensim-3.8.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

Download URL gensim-3.8.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Size 24.7 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
9da690b4b1b2297053210f3779db5cb1b6f935a3077c4473c848677b7e4c2e00
BLAKE2b-256 checksum
How to use checksums
c83a32a1edf4f335eba0873021a7ddb3230f05dedd2b5450960118b402ca0771
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / gensim-3.8.0-cp36-cp36m-manylinux1_x86_64.whl

Download URL gensim-3.8.0-cp36-cp36m-manylinux1_x86_64.whl
Size 24.2 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
cf0bce0062eade9980a95a33726c537fdb8819e08c4aec65efae937b1669873e
BLAKE2b-256 checksum
How to use checksums
403d89b27573f56abcd1b8c9598b240f53c45a3c79aa0924a24588e99716043b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / gensim-3.8.0-cp36-cp36m-manylinux1_i686.whl

Download URL gensim-3.8.0-cp36-cp36m-manylinux1_i686.whl
Size 24.1 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-32
SHA-256 checksum
How to use checksums
1ea2d798aae1cb80d886812a1470a5a1d5c92b7f3665fe00cd571e62dcb74f1c
BLAKE2b-256 checksum
How to use checksums
0bc7105ed756cd00e0eb57c861f73c828d06e9e855b6ac0cc704b56e9a19648e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / gensim-3.8.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

Download URL gensim-3.8.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Size 24.7 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
e13fef16faf50d462ea970fd9f454f7528d08395c1a0cf81bcbf97f89f03f674
BLAKE2b-256 checksum
How to use checksums
e86583f9dc27652d0e2408e6f4281927c958231c0cd23fa3a7500ac28c2b8367
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / gensim-3.8.0-cp35-cp35m-manylinux1_x86_64.whl

Download URL gensim-3.8.0-cp35-cp35m-manylinux1_x86_64.whl
Size 24.2 MB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
388ad255dd82da921665c344a443bf0c396c4e7789196f88882c450b3f172253
BLAKE2b-256 checksum
How to use checksums
ef65c90886ac34d4b12d3ae0bcc7aece1af57e1f30e7138aabbb3e3c027e705a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / gensim-3.8.0-cp35-cp35m-manylinux1_i686.whl

Download URL gensim-3.8.0-cp35-cp35m-manylinux1_i686.whl
Size 24.1 MB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-32
SHA-256 checksum
How to use checksums
58dfc3a6e84e567bb5fcc08ea37ece9609ee6a75e4deee1e6b1dbcd1703f2c9e
BLAKE2b-256 checksum
How to use checksums
84a9feade9cf676e13c0b995baf0bd7cc6e6a9d9c484638b4d5ad8ca2e0c122f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / gensim-3.8.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

Download URL gensim-3.8.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Size 24.6 MB
Tags CPython 3.5 CPython 3.5 pymalloc macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
d87f0b8b895416ce013c14eec19fa1096a80970547919d0f1a0d903dab63adb1
BLAKE2b-256 checksum
How to use checksums
eb6ec43296f2ee76f6d7b58daaf3051800d7628f1f41cc33aec76728def44609
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / gensim-3.8.0-cp27-cp27mu-manylinux1_x86_64.whl

Download URL gensim-3.8.0-cp27-cp27mu-manylinux1_x86_64.whl
Size 24.2 MB
Tags CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
c2c6042d5116ef5760fc6794b9c7219bcf7780dfd543dc099bb9501e6c1f2fdd
BLAKE2b-256 checksum
How to use checksums
f124b84afb351440894220c42fb82bf6270b1cb6f6019d3e4874f070a317856c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / gensim-3.8.0-cp27-cp27mu-manylinux1_i686.whl

Download URL gensim-3.8.0-cp27-cp27mu-manylinux1_i686.whl
Size 24.1 MB
Tags CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-32
SHA-256 checksum
How to use checksums
025f5c72baf0ec64deb9c61c8d4d9269f4ec12913b968774d22cc0b046f9bfbc
BLAKE2b-256 checksum
How to use checksums
7e7e8523d11874090669fc4f554803c155a1768e5e3b4748faa5f4a107060eec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / gensim-3.8.0-cp27-cp27m-manylinux1_x86_64.whl

Download URL gensim-3.8.0-cp27-cp27m-manylinux1_x86_64.whl
Size 24.2 MB
Tags CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
6a5e892f393f80ffb2758edc8896257028923e2fad1529b5fce7af4614322faa
BLAKE2b-256 checksum
How to use checksums
c1b52576dd2b6dae85c771cc3fb15abb65cecd590d62df3f630f90440d70e522
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / gensim-3.8.0-cp27-cp27m-manylinux1_i686.whl

Download URL gensim-3.8.0-cp27-cp27m-manylinux1_i686.whl
Size 24.1 MB
Tags CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-32
SHA-256 checksum
How to use checksums
c16a07fbf7e6b9bb8afdf03b33d6543ac83812f036f4a25da3d4ad82eedb47cd
BLAKE2b-256 checksum
How to use checksums
f0b430e18d3bbbbf6327d8ad4fe0ca3475b83b6c36da704ee22a34581864517f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release files / gensim-3.8.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

Download URL gensim-3.8.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Size 24.7 MB
Tags CPython 2.7 CPython 2.7 pymalloc macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
f40312189e57c4a6f1583836186d99a268b825c3f947de3862b595b2ff6baf8e
BLAKE2b-256 checksum
How to use checksums
9eaf925c657c231e2f483936797b2041a79d3716219f3defca4d205e10a2bb91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

Release history Release notifications | RSS feed

4.4.0

26 release files

4.3.3

26 release files

4.3.2

21 release files

4.3.1

24 release files

4.3.0

17 release files

4.1.2

17 release files

4.1.1

13 release files

4.1.0

17 release files

4.0.0

10 release files

3.8.2

22 release files

3.8.1

31 release files

This release

3.8.0 This release

15 release files

3.7.2

15 release files

3.7.1

31 release files

3.7.0

25 release files

3.6.0

24 release files

3.1.0

7 release files

3.0.0

16 release files

2.3.0

16 release files

2.2.0

16 release files

2.1.0

12 release files

2.0.0

12 release files

1.0.0

9 release files

0.13.4

9 release files

0.13.2

9 release files

0.13.0

1 release file

0.12.2

2 release files

0.12.1

2 release files

0.11.1

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.9

2 release files

0.8.8

2 release files

0.8.7

1 release file

0.8.6

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.8

2 release files

0.7.7

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4

2 release files

0.3.0

2 release files

0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page