【文件属性】:
文件名称:BERTopic:利用BERT和c-TF-IDF创建易于解释的主题
文件大小:2.73MB
文件格式:ZIP
更新时间:2021-02-03 04:57:18
nlp machine-learning topic transformers topic-modeling
伯特比
BERTopic是一种利用主题建模技术 :hugging_face: 转换程序和c-TF-IDF创建密集的群集,使主题易于理解,同时在主题描述中保留重要字词。 它甚至支持类似于LDAvis的可视化!
相应的媒体帖子可以在找到。
安装
可以使用完成安装:
pip install bertopic
要使用可视化选项,请按照以下步骤安装BERTopic:
pip install bertopic[visualization]
安装错误推荐使用PyTorch 1.4.0或更高版本。 如果安装出现错误,请首先安装pytorch。
入门
要详细了解BERTopic的功能,您可以在查看完整的文档也可以Google Colab笔记本。
快速开始
我们首先从著名的20个新闻组数据集中提取主题,该数据组由英文文档组成:
from bertopic import BERTopic
from sklearn . datasets import fetch_20newsgroups
docs = fetch_20newsgroups ( subset = 'all' , remove
【文件预览】:
BERTopic-master
----setup.py(2KB)
----.gitignore(916B)
----bertopic()
--------_embeddings.py(1KB)
--------__init__.py(211B)
--------_ctfidf.py(2KB)
--------_bertopic.py(46KB)
--------_mmr.py(2KB)
--------_utils.py(2KB)
----images()
--------clusters.png(862KB)
--------topic_visualization.gif(309KB)
--------logo.png(18KB)
--------ctfidf.png(15KB)
--------probabilities.png(194KB)
--------icon.png(11KB)
----Makefile(370B)
----LICENSE(1KB)
----.github()
--------workflows()
----notebooks()
--------BERTopic.ipynb(148KB)
----README.md(7KB)
----tests()
--------__init__.py(0B)
--------test_utils.py(818B)
--------test_model.py(9KB)
----theme()
--------style.css(0B)
--------logo.png(9KB)
----mkdocs.yml(1KB)
----.gitattributes(31B)
----docs()
--------api()
--------index.md(4KB)
--------changelog.md(4KB)
--------style.css(0B)
--------tutorial()
--------img()