# MilaNLProc/contextualized-topic-models

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

Repository: https://github.com/MilaNLProc/contextualized-topic-models
Canonical: https://ross.abutalabs.com/products/contextualized-topic-models
Language: Python
License: MIT
License Family: permissive
Topics: topic-modeling, bert, transformer, embeddings, text-as-data, topic-coherence, multilingual-topic-models, multilingual-models, neural-topic-models, nlp, nlp-library, nlp-machine-learning
Last push: 2025-07-24T02:03:31+00:00

## Health v2 (maintenance only)
Score: 47/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 33, release rhythm 35, longevity 100
- inputs: {"age_days": 2342, "days_push": 406, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1269, forks 155 (observed 2026-08-28T04:04:11.731607+00:00)

## What it is
A Python library implementing Contextualized Topic Models (CTM), which combine pre-trained contextual embeddings like BERT with neural topic models to produce more coherent topics. It offers CombinedTM (embeddings plus bag-of-words) and ZeroShotTM (works with missing words and supports multilingual, zero-shot topic modeling).

## Use cases
- discover topics in a large document corpus
- run multilingual topic modeling without translating text
- improve topic coherence over LDA with BERT embeddings
- do zero-shot topic modeling on unseen languages
- analyze survey responses or news articles by theme
- cluster documents into interpretable topics

## When to choose
- you need coherent, interpretable topics from text documents
- you want to leverage transformer embeddings for topic modeling
- you need multilingual or zero-shot topic modeling
- you want a pip-installable, research-backed topic modeling library

## When to avoid
- you need simple keyword extraction rather than full topic models
- you lack a GPU or patience for training neural models
- you need production-scale low-latency inference
- you want a fully classical statistical topic model like LDA

## Facets
- artifact type: library
- maturity: active
- function: nlp, machine-learning, search-engine
- domain: machine-learning, data-science
- platform: python
- tags: topic-modeling, bert, embeddings, neural-topic-models, multilingual, zero-shot, text-analysis, natural-language-processing

## Member repositories
- MilaNLProc/contextualized-topic-models (main) score 47

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:11.731607+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T05:03:30.307631+00:00, confidence not recorded.
  - readme: https://github.com/MilaNLProc/contextualized-topic-models (fetched 2026-08-28T04:04:11.731607+00:00, sha 3d5022dcb298)
  - registry_pypi: https://pypi.org/pypi/contextualized-topic-models/json (fetched 2026-08-29T12:15:06.965106+00:00, sha f07fb2f8c14d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
