{"data":{"slug":"milanlproc-contextualized-topic-models","name":"contextualized-topic-models","tagline":"A python package for contextualized topic modeling using BERT and other embeddings.","github_url":"https://github.com/MilaNLProc/contextualized-topic-models","owner":"MilaNLProc","repo":"contextualized-topic-models","owner_avatar_url":"https://avatars.githubusercontent.com/u/61321459?v=4","primary_language":"Python","stars":1269,"forks":155,"topics":["bert","embeddings","multilingual-models","multilingual-topic-models","neural-topic-models","nlp","nlp-library","nlp-machine-learning","text-as-data","topic-coherence","topic-modeling","transformer"],"archived":false,"github_pushed_at":"2025-07-24T02:03:31+00:00","maintenance_label":"Dormant","stars_delta_30d":-3,"url":"https://www.graphcanon.com/tools/milanlproc-contextualized-topic-models","markdown_url":"https://www.graphcanon.com/tools/milanlproc-contextualized-topic-models.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/milanlproc-contextualized-topic-models","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=milanlproc-contextualized-topic-models","description":"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.). ","homepage_url":null,"license":"MIT","open_issues":11,"watchers":13,"ai_summary":"This repository offers tools to combine contextualized embeddings like those from BERT with traditional topic models, enhancing the coherence of discovered topics. It is published in EACL and ACL 2021 by Bianchi et al., making it a valuable resource for researchers and developers working on advanced topic modeling within natural language processing.","readme_excerpt":"===========================\nContextualized Topic Models\n===========================\n\n.. image:: https://img.shields.io/pypi/v/contextualized_topic_models.svg\n        :target: https://pypi.python.org/pypi/contextualized_topic_models\n\n.. image:: https://github.com/MilaNLProc/contextualized-topic-models/workflows/Python%20package/badge.svg\n        :target: https://github.com/MilaNLProc/contextualized-topic-models/actions\n\n.. image:: https://readthedocs.org/projects/contextualized-topic-models/badge/?version=latest\n        :target: https://contextualized-topic-models.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n\n.. image:: https://img.shields.io/github/contributors/MilaNLProc/contextualized-topic-models\n        :target: https://github.com/MilaNLProc/contextualized-topic-models/graphs/contributors/\n        :alt: Contributors\n\n.. image:: https://img.shields.io/badge/License-MIT-blue.svg\n        :target: https://lbesson.mit-license.org/\n        :alt: License\n\n.. image:: https://pepy.tech/badge/contextualized-topic-models\n        :target: https://pepy.tech/project/contextualized-topic-models\n        :alt: Downloads\n\n.. image:: https://colab.research.google.com/assets/colab-badge.svg\n    :target: https://colab.research.google.com/drive/1fXJjr_rwqvpp1IdNQ4dxqN4Dp88cxO97?usp=sharing\n    :alt: Open In Colab\n\n.. image:: https://raw.githubusercontent.com/aleen42/badges/master/src/medium.svg\n    :target: https://medium.com/towards-data-science/contextualized-topic-modeling-with-python-eacl2021-eacf6dfa576\n    :alt: Medium Blog Post\n\n.. image:: https://img.shields.io/badge/youtube-video-red\n        :target: https://www.youtube.com/watch?v=n1_G8K07KoM\n        :alt: Video Tutorial\n\n\nContextualized Topic Models (CTM) are a family of topic models that use pre-trained representations of language (e.g., BERT) to\nsupport topic modeling. See the papers for details:\n\n* Bianchi, F., Terragni, S., & Hovy, D. (2021). `Pre-training is a Hot Topic: Contextualized Document Embeddings Improve Topic Coherence`. ACL. https://aclanthology.org/2021.acl-short.96/\n* Bianchi, F., Terragni, S., Hovy, D., Nozza, D., & Fersini, E. (2021). `Cross-lingual Contextualized Topic Models with Zero-shot Learning`. EACL. https://www.aclweb.org/anthology/2021.eacl-main.143/\n\n\n.. image:: https://raw.githubusercontent.com/MilaNLProc/contextualized-topic-models/master/img/logo.png\n   :align: center\n   :width: 200px\n\n\nTopic Modeling with Contextualized Embeddings\n---------------------------------------------\n\nOur new topic modeling family supports many different languages (i.e., the one supported by HuggingFace models) and comes in two versions: **CombinedTM** combines contextual embeddings with the good old bag of words to make more coherent topics; **ZeroShotTM** is the perfect topic model for task in which you might have missing words in the test data and also, if trained with multilingual embeddings, inherits the property of being a multilingual topic model!\n\nThe big advantage is that you can use different embeddings for CTMs. Thus, when a new\nembedding method comes out you can use it in the code and improve your results. We are not limited\nby the BoW anymore.\n\nWe also have `Kitty <https://contextualized-topic-models.readthedocs.io/en/latest/kitty.html>`_! A new submodule that can be used to create a human-in-the-loop\nclassifier to quickly classify your documents and create named clusters.\n\n.. image:: https://raw.githubusercontent.com/MilaNLProc/contextualized-topic-models/master/img/logo_kitty.png\n   :align: center\n   :width: 200px\n\n\nTutorials\n---------\n\nYou can look at our `medium`_ blog post or start from one of our Colab Tutorials:\n\n\n.. |colab1_2| image:: https://colab.research.google.com/assets/colab-badge.svg\n    :target: https://colab.research.google.com/drive/1fXJjr_rwqvpp1IdNQ4dxqN4Dp88cxO97?usp=sharing\n    :alt: Open In Colab\n\n.. |colab2_2| image:: https://colab.research.google.com/assets/colab-badge.svg\n    :target: https://colab.research","github_created_at":"2020-04-04T19:11:29+00:00","created_at":"2026-07-11T11:31:04.606879+00:00","updated_at":"2026-08-22T12:01:27.961875+00:00","categories":[{"slug":"model-training","name":"Model Training","url":"https://www.graphcanon.com/categories/model-training","markdown_url":"https://www.graphcanon.com/categories/model-training.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/model-training"}],"tags":[{"slug":"bert","name":"bert"},{"slug":"embeddings","name":"embeddings"},{"slug":"multilingual-models","name":"multilingual-models"},{"slug":"neural-topic-models","name":"neural-topic-models"},{"slug":"nlp-library","name":"nlp-library"},{"slug":"topic-coherence","name":"topic-coherence"},{"slug":"transformer","name":"transformer"}],"trust":{"provenance":{"is_fork":false,"github_id":253079431,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-08-22T12:01:27.228Z","maintenance":{"label":"Dormant","score":18,"methodology":"github_public_v1","releases_90d":0,"days_since_push":394,"last_release_at":null,"stars_delta_30d":-3,"open_issues_delta_30d":0},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-11T11:31:06.250Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-08-22T12:01:27.687Z"},"languages":{"value":["python"],"source":"github.language","observed_at":"2026-08-22T12:01:27.687Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-08-22T12:01:27.687Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["- When you need to analyze text data with enriched topic coherence provided by models utilizing BERT-like embeddings.","- For research or development in NLP where multilingual or neural-specific topic analysis is required, as published in EACL and ACL 2021 by Bianchi et al."],"when_not_to_use":["- If your project does not require advanced contextual embedding integration and more conventional topic modeling techniques suffice.","- In scenarios where model complexity can be a bottleneck for real-time processing or when working with hardware limitations that cannot efficiently process BERT embeddings."],"source":"enrich:decision_facts","observed_at":"2026-07-12T07:19:44.077Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"Contextualized-topic-models is a Python package that enhances traditional topic modeling by integrating contextualized embeddings like BERT."}]}}