Skip to main content

Sentence Topic Prediction using Topic Modeling

Project description

sptm: Sentence Topic Prediction using Topic Modeling

sptm logo

license

Quick rundown

sptm is a high-level API, written in Python and capable of training Topic Models using Gensim and MALLET. It was developed as a summer internship project under the guidance of @Anupam Mediratta. The package was wriiten with a focus on enabling fast experimentation. Being able to go from idea to result with the least possible delay is key to doing good research.

Use sptm if you need a library that:

  • Allows for easy and fast topic model training
  • Draw Inter-topic Distance Maps
  • Construct Conditional Probability Matrix for topics
  • Predict topic of sentences

Read the documentation at [sptm_source]/docs/_build/html/index.html.

sptm is compatible (tested) with: Python 3.7.


Some good stuff about sptm

  • User friendliness. The source code is very simple to follow

  • Modularity. You can use your own models, training algorithms etc. as long as it is supported by gensim


Getting started: 30 seconds to sptm

In the test folder of the repository, you will find a single script with almost all classes and functions used.


Installation

  • Important

sptm makes use of MALLET whose installtion steps can be found here.

This is required only if you want to train the topic model using gensim's LDAMallet wrapper that is the default training algorithm used in sptm.

Then, you can install sptm itself. There are two ways to install sptm:

  • Install sptm from PyPI (recommended):
sudo pip3 install sptm

If you are using a virtualenv, you may want to avoid using sudo:

pip3 install sptm
  • Alternatively: install sptm from the GitHub source:

First, clone sptm using git:

git clone https://github.com/Rochan-A/sptm.git

Then, cd to the sptm folder and run the install command:

cd sptm
sudo python3 setup.py install
  • NOTE: You will need to specifically download spacy's en_core_web_sm model.

This step needs to be done irrespective the method of installation.

You can do that by running:

python3 -m spacy download en_core_web_sm

Support

You can post bug reports and feature requests in GitHub issues. Make sure to read the guidelines first.


Why name it sptm?

sptm stands for - Sentence topic Prediction using Topic Modeling

Why is this readme oddly familiar?

This README is a heavily edited version of keras's


Project details


Download files

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

Source Distribution

sptm-1.1.1.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

sptm-1.1.1-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file sptm-1.1.1.tar.gz.

File metadata

  • Download URL: sptm-1.1.1.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.15

File hashes

Hashes for sptm-1.1.1.tar.gz
Algorithm Hash digest
SHA256 2e520d753d77f4f63fd02aaa43150ba28b2a593a16cfc4d389ae77f151d09fcd
MD5 2e7804bad4669cbba63bb06f58585052
BLAKE2b-256 bcae9c28e7dba42f44b0201e31e09caf6fd111b08f87e6763e7e67a6888d8cf2

See more details on using hashes here.

File details

Details for the file sptm-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: sptm-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.15

File hashes

Hashes for sptm-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e3c7b3158f8d9a44af2c9abc336247d4cf90a1c5ce1e0a4a30ed5a241c4bae9
MD5 140fd5be5f3e7d653b1101c111d7ee7f
BLAKE2b-256 80a5becfb99a4199d82ecf01230f14ddaf8a8e192c9d8c4eb9f4523a0f1ff434

See more details on using hashes here.

Supported by

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