python - 创建包含相似文本的文本集群
问题描述
最近我研究了图像聚类,它找到了相似的图像并将它们组合在一起。我使用 python 的skimage
模块来计算 SSIM,然后根据确定的某个阈值对所有图像进行聚类。
我想对文本做类似的事情。我想创建包含类似文本的自动集群。例如,cluster-1 可以包含所有代表工作母亲的文本,cluster-2 可以包含所有代表人们谈论食物的文本等等。我知道这必须是无监督学习。我们是否有类似的 python 模块可以帮助完成这项任务?我还查看了 google 的 tensorflow,看看我是否可以从中得到一些东西,但在其文档中没有找到任何与文本聚类相关的内容。
解决方案
There are numerous ways you can approach the task. In most cases the clustering algorithms are very similar to image clustering but what you need to define is the distance metric - in this case semantic similarity metric of some kind.
For this purpose you can use the approaches I list in another question around the topic of semantic similarity (even if a bit more detailed).
The one additional approach worth mentioning is 'automatic clustering' provided by topical modelling tools like LSA which you can run fairly easy using gensim
package.
推荐阅读
- ruby-on-rails - Dockerized nmap 显示不正确的操作系统版本
- python - 基于 DateTime 列合并两个熊猫数据框
- html - 试图改变甚至列表链接css?
- typescript - 如何使用打字稿设置自定义 node_modules 路径
- javascript - Leaflet.js gdpr 兼容集成
- python - 如何限制我的图表在 matplotlib 中低于零
- python - cv2.imwrite("resized_"+image, re) 抛出语法错误
- javascript - 在 React Native 中使用构造函数创建对象
- c++ - C ++中的滑动窗口中位数
- reactjs - 如何通过示例在 reactjs 中使用 videojs 分辨率切换器