Skip to main content

gensim – Topic Modelling in Python

GA 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 (simple streaming API)

    • easy to extend with other Vector Space algorithms (simple 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 MKL, ATLAS or OpenBLAS is known to improve performance by as much as an order of magnitude. On OSX, NumPy picks up its vecLib BLAS automatically, so you don’t need to do anything special.

Install the latest version of gensim:

pip install --upgrade gensim

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

python setup.py install

For alternative modes of installation, see the documentation.

Gensim is being continuously tested under all supported Python versions. Support for Python 2.7 was dropped in gensim 4.0.0 – install gensim 3.8.3 if you must use Python 2.7.

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 4.1.1

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 4.1.1
File Size Uploaded
gensim-4.1.1.tar.gz 23.2 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for gensim 4.1.1
File
gensim-4.1.1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
gensim-4.1.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.12+ x86-64 Details
gensim-4.1.1-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
gensim-4.1.1-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
gensim-4.1.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.12+ x86-64 Details
gensim-4.1.1-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
gensim-4.1.1-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
gensim-4.1.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 Details
gensim-4.1.1-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details
gensim-4.1.1-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
gensim-4.1.1-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 Details
gensim-4.1.1-cp36-cp36m-macosx_10_9_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64 Details

Total release size: 311.5 MB

Release files / gensim-4.1.1.tar.gz

Download URL gensim-4.1.1.tar.gz
Size 23.2 MB
Tags Source
SHA-256 checksum
How to use checksums
7c762daa4029046dfbe467fdd79f911aa140748bf50dc64dbeddc8eaa07f760b
BLAKE2b-256 checksum
How to use checksums
955fe1de63570c0c74faeaaed614e57ecf01dab441b449eabc312c5eb876b24b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / gensim-4.1.1-cp39-cp39-win_amd64.whl

Download URL gensim-4.1.1-cp39-cp39-win_amd64.whl
Size 24.0 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
195cb6913259a50f13ccb1d5c33eadb4ae6c8ea30b58e633f5506cc17f36cbe2
BLAKE2b-256 checksum
How to use checksums
f5971edcd711a68e1e05d2574f73ceeebdda56079c966ad7c92d8eaf4e20bdae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / gensim-4.1.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL gensim-4.1.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 24.0 MB
Tags CPython 3.9 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
8378a3458523ff66a1862a672e1849396e77082d40a26ffd57627c8af3289cde
BLAKE2b-256 checksum
How to use checksums
3b6e7fa0783d69de92c87381682b46ba55e1a3c7cbea218becefb656bc758f4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / gensim-4.1.1-cp39-cp39-macosx_10_9_x86_64.whl

Download URL gensim-4.1.1-cp39-cp39-macosx_10_9_x86_64.whl
Size 24.0 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
c3151364ebf64f332bbdde9ce31e9f52d20729934dd348343596b707057a80ed
BLAKE2b-256 checksum
How to use checksums
b201ec783ae358e17f3dc0c3034bb90bfaf678b3883211c44fa57c8c6af605a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / gensim-4.1.1-cp38-cp38-win_amd64.whl

Download URL gensim-4.1.1-cp38-cp38-win_amd64.whl
Size 24.0 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
27eedc9995e61d66e4b53436b520aa212a81a088d40ffe03f8ebabb6f51d7c93
BLAKE2b-256 checksum
How to use checksums
1fbd4af2f6da5e0eb73b46dd70350e45b6e720c26bf48bcbc431d3841e95bb43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / gensim-4.1.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL gensim-4.1.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 24.1 MB
Tags CPython 3.8 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
6a1e45fa3a890d138bae69ba64c3fa436570a948e0b84a39400ef172fe00b12d
BLAKE2b-256 checksum
How to use checksums
ee32a4ac34fe4e80ab5107e674f01dbee60740ed2710b387f96afe72ef52c040
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / gensim-4.1.1-cp38-cp38-macosx_10_9_x86_64.whl

Download URL gensim-4.1.1-cp38-cp38-macosx_10_9_x86_64.whl
Size 24.0 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
0fcb71db327baed24620597f1574b68c91c3ebb1157055bd5f2912f480771211
BLAKE2b-256 checksum
How to use checksums
0ba71a4e02ac0ce0ebf1b4cb11081db63db8c6f43d6bdeabae3046b8948f324e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / gensim-4.1.1-cp37-cp37m-win_amd64.whl

Download URL gensim-4.1.1-cp37-cp37m-win_amd64.whl
Size 24.0 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
1d4c0ddb3ddd2783773f50383fe19fcce6a900529709e22fa903e77745592c71
BLAKE2b-256 checksum
How to use checksums
8037040f54495a64cc2e1a3a04979aa02b86d786f1dff6108cf7e511aacea76a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / gensim-4.1.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL gensim-4.1.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 24.1 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
da7150e2151d44dc5246de8dedd16e7bd1c33d0ab1ff98ef4eab812910641d2e
BLAKE2b-256 checksum
How to use checksums
957401e134bfbaee68a49820e65efbefda3dd9a967c45302bbca8729fd0a587f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / gensim-4.1.1-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL gensim-4.1.1-cp37-cp37m-macosx_10_9_x86_64.whl
Size 24.0 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
60ee925321d57725de05e52ba83df9df7428641ca8b10a9b8a33f92fd3059066
BLAKE2b-256 checksum
How to use checksums
0febf9aa66454f6a310f86c595829adb4d43a22aff90b45a00d86f0f117210fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / gensim-4.1.1-cp36-cp36m-win_amd64.whl

Download URL gensim-4.1.1-cp36-cp36m-win_amd64.whl
Size 24.0 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
f7c82599b4e68180beed50cb13aecd656cdc1814d04a49eaf0937ad9d3383367
BLAKE2b-256 checksum
How to use checksums
474d680f36c8a2c75ca1ec5fd77fa52f042e972ba7d4cef4b7077a161d00a086
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / gensim-4.1.1-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL gensim-4.1.1-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 24.1 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
605f44dba281de2c752d891bf402bddda173fec195f96e15b571ebe2f1be463f
BLAKE2b-256 checksum
How to use checksums
ccc0b959aa7b7f8d9c362aaa906ce2c602be6f692996ca7c586964a1a391a20c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / gensim-4.1.1-cp36-cp36m-macosx_10_9_x86_64.whl

Download URL gensim-4.1.1-cp36-cp36m-macosx_10_9_x86_64.whl
Size 24.0 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
78cc34a3bad16e1aeaa39056cab7bcc80fa478d5580212567feaf0a43ba2ad7d
BLAKE2b-256 checksum
How to use checksums
3e4a78852d51576c24b5c281a7830579ee12f99984d914604af71b53685a1471
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

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

This release

4.1.1 This release

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

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