skillfed

bertopic

BERTopic performs topic Modeling with state-of-the-art transformer models.

bertopic v0.17.4 529.2K downloads/30d#6,161 on PyPI7,784
Permissive 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) Active released

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 bertopic

uv

uv add bertopic

poetry

poetry add bertopic

Installing 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

Intended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial Intelligence

Tags

topic modeling nlpbert topic extractiondocument clustering embeddingstext topic discoverysemantic document groupingtransformer-based topic analysisinterpretable topic labelsunsupervised text categorization
nlpclusteringembeddings

More Scientific/Engineering packages

Further reading