Skip to main content

Python framework for fast Vector Space Modelling

Project description

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 (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 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.

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 Python 3.6, 3.7 and 3.8. 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

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gensim-4.0.0.tar.gz (23.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gensim-4.0.0-cp38-cp38-win_amd64.whl (23.8 MB view details)

Uploaded CPython 3.8Windows x86-64

gensim-4.0.0-cp38-cp38-manylinux1_x86_64.whl (23.9 MB view details)

Uploaded CPython 3.8

gensim-4.0.0-cp38-cp38-macosx_10_9_x86_64.whl (23.9 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

gensim-4.0.0-cp37-cp37m-win_amd64.whl (23.8 MB view details)

Uploaded CPython 3.7mWindows x86-64

gensim-4.0.0-cp37-cp37m-manylinux1_x86_64.whl (23.9 MB view details)

Uploaded CPython 3.7m

gensim-4.0.0-cp37-cp37m-macosx_10_9_x86_64.whl (23.9 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

gensim-4.0.0-cp36-cp36m-win_amd64.whl (23.8 MB view details)

Uploaded CPython 3.6mWindows x86-64

gensim-4.0.0-cp36-cp36m-manylinux1_x86_64.whl (23.9 MB view details)

Uploaded CPython 3.6m

gensim-4.0.0-cp36-cp36m-macosx_10_9_x86_64.whl (23.9 MB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

Details for the file gensim-4.0.0.tar.gz.

File metadata

  • Download URL: gensim-4.0.0.tar.gz
  • Upload date:
  • Size: 23.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

File hashes

Hashes for gensim-4.0.0.tar.gz
Algorithm Hash digest
SHA256 a9c9fed52e2901ad04f9caf73a5dd782e5ce8054f71b346d72f04ddff1b7b432
MD5 a57d5285b2948f2cf37cf8b9c319dd7e
BLAKE2b-256 ccfff809deb11f066dfe658fc9756ac7d04d1f8954d691f31ddd40d40db59b85

See more details on using hashes here.

File details

Details for the file gensim-4.0.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: gensim-4.0.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 23.8 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

File hashes

Hashes for gensim-4.0.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 4febb1c6794d44ae42bf319ab3e8a722944429a94ef0a4199bdd29a63e21fc81
MD5 1137fef20cab2f17165b1284f32ec067
BLAKE2b-256 860dda0f7bc44230b9700a8c91ea1f1224f4e9a8875f28c11cc8a435f4a3485e

See more details on using hashes here.

File details

Details for the file gensim-4.0.0-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: gensim-4.0.0-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 23.9 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

File hashes

Hashes for gensim-4.0.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5b9178311a96dd6d0103e6eebebfed98425d7005d8c30c6b12234fd2a4bfad01
MD5 6e48eb8050398ce761d39c2b624390f0
BLAKE2b-256 141cae26cfdac3a1b09cbea456a22ee19b69a07f539aa78775dc244999a38d73

See more details on using hashes here.

File details

Details for the file gensim-4.0.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: gensim-4.0.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 23.9 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

File hashes

Hashes for gensim-4.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 924dc96b3a06e2c9fd6983417453167ffd8af033ed625546ceb6e72e96a368aa
MD5 b5410b0e03fbd524a107c1efb73f73a7
BLAKE2b-256 81096929fd1e882943d1764f2aaf1e66ed32fc1cef987dab6ddbec0291e3ae4a

See more details on using hashes here.

File details

Details for the file gensim-4.0.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: gensim-4.0.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 23.8 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

File hashes

Hashes for gensim-4.0.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 c5abac78e4103249f35f1ccbfa900f75e37a2d4e4fadaf6912d1911cbacf196f
MD5 5fa5bf3bac39eefbb5ab397a41d33e3d
BLAKE2b-256 e5143c7c28a18d5406ad73679236aaf9c3b3cf33e40c1eb5494d59c376452123

See more details on using hashes here.

File details

Details for the file gensim-4.0.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: gensim-4.0.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 23.9 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

File hashes

Hashes for gensim-4.0.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 447a0427392bebefc67716070f3b3423f0bcab9b7566c3d89da1e9d2f8bb58e5
MD5 0dc480f92e9af4b45aa3a8305b26dee7
BLAKE2b-256 c3dd5e00b6e788a9c522b48f9df10472b2017102ffa65b10bc657471e0713542

See more details on using hashes here.

File details

Details for the file gensim-4.0.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: gensim-4.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 23.9 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

File hashes

Hashes for gensim-4.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f505cd12661ef9ef4755152155735acf76412b172163845287fa7b7a830aa1d1
MD5 04aa70fecffe23b1d73ea82080d3c6f4
BLAKE2b-256 bfdfea8154324d18a34cafca7df01357571b1cd0f65545b7caa586799081e992

See more details on using hashes here.

File details

Details for the file gensim-4.0.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: gensim-4.0.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 23.8 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

File hashes

Hashes for gensim-4.0.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 3863c9d19586f43787940c3d502ce788070871461a2efb8c5eac53bf06a34026
MD5 256efd3021693328007cfd6f242c1e78
BLAKE2b-256 c87c6c2c69c5003ea9cec4c54c3bc4356e4f10fed2834f0f24f300d80cc0542d

See more details on using hashes here.

File details

Details for the file gensim-4.0.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: gensim-4.0.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 23.9 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

File hashes

Hashes for gensim-4.0.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 53f546d0fbaa6b2d833b9138684eb1c64b55760b202b50f34e722432f13430db
MD5 d757171c99d26987df197099fd282816
BLAKE2b-256 6182d2772bc980351427503b20e6bf665e84a1ab32af58dc6e13a710a853e62e

See more details on using hashes here.

File details

Details for the file gensim-4.0.0-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: gensim-4.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 23.9 MB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

File hashes

Hashes for gensim-4.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d9fded8db8a429549757de8c33903cf3eb3966d3f388992308cbb6e703894d86
MD5 a3ef01c4a9b81441a10336ea520daebd
BLAKE2b-256 08b37ec22e52e7bd6907fb2f569fa548f6df70a1a4727826a8d42a41cf1d66cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page