#96 · Primary category: NLP Tools & Text Processing

contextualized-topic-models

bert embeddings multilingual-models multilingual-topic-models neural-topic-models nlp nlp-library nlp-machine-learning text-as-data topic-coherence topic-modeling transformer

A python package to run contextualized topic modeling. CTMs combine contextualized embeddings (e.g., BERT) with topic models to get coherent topics. Published at EACL and ACL 2021 (Bianchi et al.).

Project last updated:07/24/25

GitHub Stars

1.3K

Forks

155

Contributors

14

License

MIT

Why we included this project

Topic modeling usually starts from word counts, but this package takes a different route: it runs documents through contextualized embeddings like BERT and then fits a neural topic model on top, which tends to produce more coherent topics than classic bag-of-words methods. Two model variants handle different cases. CombinedTM mixes the embeddings with the bag of words for better coherence, while ZeroShotTM can label documents containing words it never saw during training, and when trained on multilingual embeddings it works across languages without extra labeled data. The library includes a preprocessing pipeline, visualization helpers, and a human-in-the-loop classifier submodule, plus Colab tutorials that make a first experiment easy. Teams doing text-as-data analysis, content organization, or exploratory NLP research will find a practical starting point, and swapping in different embeddings is straightforward.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category