# tmtookit: Text mining and topic modeling toolkit¶

tmtoolkit is a set of tools for text mining and topic modeling with Python developed especially for the use in the social sciences. It aims for easy installation, extensive documentation and a clear programming interface while offering good performance on large datasets by the means of vectorized operations (via NumPy) and parallel computation (using Python’s multiprocessing module). It combines several known and well-tested packages such as NLTK or SciPy.

At the moment, tmtoolkit focuses on methods around the Bag-of-words model, but word embeddings may be integrated in the future.

The documentation for tmtoolkit is available on tmtoolkit.readthedocs.org and the GitHub code repository is on github.com/WZBSocialScienceCenter/tmtoolkit.

## Features¶

### Text preprocessing¶

tmtoolkit implements or provides convenient wrappers for several preprocessing methods, including:

All text preprocessing methods can operate in parallel to speed up computations with large datasets.

## Limits¶

• currently only German and English language texts are supported for language-dependent text preprocessing methods such as POS tagging or lemmatization

• all data must reside in memory, i.e. no streaming of large data from the hard disk (which for example Gensim supports)

• no direct support of word embeddings

## Built-in datasets¶

Currently tmtoolkit comes with the following built-in datasets which can be loaded via tmtoolkit.corpus.Corpus.from_builtin_corpus():

This documentation guides you in several chapters from installing tmtoolkit to its specific use cases and shows some examples with built-in corpora and other datasets. All “hands on” chapters from Getting started to Topic modeling are generated from Jupyter Notebooks. If you want to follow along using these notebooks, you can download them from the GitHub repository.

There are also a few other examples as plain Python scripts available in the examples folder of the GitHub repository.