【干货推荐] 基于Bert的聚类工具:BERTopic 【简介】:BERTopic是一种主题建模技术,它利用?变换器和c-TF-IDF创建聚类簇,使主题易于理解,同时在主题描述中保留重要的单词。 同时可以支持类似于LDAvis的可视化。 【快速上手】 安装pip install bertopic[visualization]
from bertopic import BERTopic
from sklearn.datasets import fetch_20newsgroups
docs = fetch_20newsgroups(subset='all', remove=('headers', 'footers', 'quotes'))['data']
topic_model = BERTopic()
topics, _ = topic_model.fit_transform(docs)
【官网链接】:GitHub链接为https://github.com/MaartenGr/BERTopic,官方文档https://maartengr.github.io/BERTopic/index.html
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有