About this project

BERTopic is a topic modeling technique that leverages transformer embeddings and c-TF-IDF to create dense clusters, producing easily interpretable topics while keeping important words in topic descriptions. It is distributed as a Python package (Python 3.10+) under the MIT license, with an accompanying arXiv paper. Core workflow: documents are embedded, embeddings are reduced in dimensionality (typically UMAP), clustered into topics (typically HDBSCAN), tokenized, weighted with c-TF-IDF, and finally represented as topic descriptions. Each of these steps is modular and can be swapped or removed, so users can build custom pipelines or explore alternative topic modeling techniques on top of the default one. Supported topic modeling variations include guided, supervised, semi-supervised, manual, multi-topic distributions, hierarchical, class-based, dynamic (topics over time), online/incremental, multimodal, multi-aspect, text generation/LLM, zero-shot, model merging, and seed words. The README also highlights multilingual support via a language setting covering 50+ languages. Topic representations can be refined with options such as KeyBERTInspired, or with LLM-based models (for example OpenAI models) to generate labels, summaries, phrases and keywords. Multi-aspect representations allow modeling several representations simultaneously. Common API methods include fit, fit_transform, transform, get_topic, get_topics, get_topic_freq, get_topic_info, get_document_info, get_representative_docs, update_topics, generate_topic_labels, set_topic_labels, merge_topics, reduce_topics, reduce_outliers, find_topics, save and load. Public attributes ending in underscore expose topics, probabilities, topic sizes, topic representations, the c-TF-IDF matrix, topic aspects, labels, topic embeddings and representative documents. Visualization methods include visualize_topics, visualize_documents, visualize_hierarchical_documents, visualize_hierarchy, get_topic_tree, visualize_barchart, visualize_heatmap, visualize_term_rank, visualize_distribution, visualize_topics_over_time and visualize_topics_per_class. Installation is available via uv or pip, with optional extras for embedding backends (flair, gensim, spacy, use), vision, and a lightweight installation without transformers, UMAP or HDBSCAN. Documentation, Colab notebooks and Kaggle examples are linked from the README.