bertopic
BERTopic performs topic Modeling with state-of-the-art transformer models.
What it is and what it does
BERTopic is a topic modeling library that combines transformer-based embeddings with density-based clustering to discover and label topics in text collections. It uses sentence-transformers to encode documents into dense vectors, applies umap-learn for dimensionality reduction, and hdbscan for clustering, then generates interpretable topic descriptions using c-TF-IDF. The library supports multiple modeling variants including supervised, semi-supervised, hierarchical, dynamic, and multimodal approaches, making it flexible for different use cases from exploratory analysis to production systems.
The package integrates with pandas, numpy, and plotly for data handling and visualization. It can work with custom embedding models and supports fine-tuning topic representations through pluggable representation strategies, including integration with LLMs for generating human-readable topic summaries. Installation is straightforward with optional extras for alternative embedding backends or vision capabilities.
Use it for:
- Discover latent topics in large document collections to understand content themes without manual labeling.
- Track how topics evolve over time in streaming or time-series text data using dynamic topic modeling.
- Build supervised or semi-supervised topic models when partial labels or guidance are available for training.
- Generate automatic topic summaries and labels using LLM integration for business intelligence.
- Cluster and organize multimodal data to find cross-modal semantic patterns.
- Extract interpretable topics from domain-specific corpora with custom embedding models.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
BERTopic performs topic modeling on text documents using transformer embeddings and c-TF-IDF clustering to identify and label coherent topics with interpretable keywords.
Yes. BERTopic is actively maintained, has low install friction, carries permissive MIT licensing, and no known vulnerabilities. It is well-suited for anyone needing interpretable topic discovery from text—from research prototyping to production systems. The dependency set is standard in data science workflows and adds no unusual risk. Start with it if you need flexible, modern topic modeling.
Install
bertopic on PyPI
pip
pip install bertopicuv
uv add bertopicpoetry
poetry add bertopicInstalling bertopic
Before you install
Low friction install with a pure-Python wheel. Depends on 9 runtime packages including hdbscan, umap-learn, sentence-transformers, pandas, numpy, and plotly—all standard data science libraries. Maintenance is active with recent commits and 7784 repository stars.
License in practice
MIT License permits unrestricted use, modification, and distribution with minimal restrictions—suitable for commercial and open-source projects alike.
Quickstart
pip install bertopic
from bertopic import BERTopic
docs = ["document one", "document two", "document three"]
topic_model = BERTopic()
topics, probs = topic_model.fit_transform(docs)
print(topic_model.get_topic_info())
Requires Python 3.10 or later. First run downloads transformer models and may consume significant memory for large document collections.
Verify before relying
- Whether the package supports GPU acceleration for large-scale topic modeling.
- Performance characteristics and scalability limits for document collections of various sizes.
- Memory footprint and computational cost compared to alternative topic modeling approaches.
Package facts
| License | MIT License Copyright (c) 2024, Maarten P. Grootendorst Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — hdbscan, umap-learn, numpy, pandas, plotly, scikit-learn, sentence-transformers, tqdm, llvmlite |
| Maintenance | actively maintained — 254 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 529,219/month — #6,161 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: bertopic-0.17.4-py3-none-any.whl
Keywords: nlp, bert, topic, modeling, embeddings
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
keybertKeyBERT extracts keywords and keyphrases from…
permissive · top 15,000 on PyPI
pytorch-pretrained-bertProvides PyTorch implementations of BERT, GPT,…
permissive · top 15,000 on PyPI
bert-scoreBERTScore computes automatic evaluation metrics…
permissive · top 15,000 on PyPI
rake-nltkExtracts keywords and key phrases from text…
permissive · top 15,000 on PyPI
sentence-transformersComputes embeddings and reranking scores for…
permissive · top 1,000 on PyPI
spacy-curated-transformersIntegrates curated transformer models (ALBERT,…
permissive · top 5,000 on PyPI
model2vecModel2Vec converts sentence transformers into…
permissive · top 5,000 on PyPI
spacy-transformersIntegrates pretrained transformer models (BERT,…
permissive · top 15,000 on PyPI
keyphrase-vectorizersExtracts keyphrases from text documents using…
permissive · top 15,000 on PyPI
colbert-aiColBERT is a BERT-based retrieval model that…
unclear · top 15,000 on PyPI