首页 > 解决方案 > 创建包含相似文本的文本集群

问题描述

最近我研究了图像聚类,它找到了相似的图像并将它们组合在一起。我使用 python 的skimage模块来计算 SSIM,然后根据确定的某个阈值对所有图像进行聚类。

我想对文本做类似的事情。我想创建包含类似文本的自动集群。例如,cluster-1 可以包含所有代表工作母亲的文本,cluster-2 可以包含所有代表人们谈论食物的文本等等。我知道这必须是无监督学习。我们是否有类似的 python 模块可以帮助完成这项任务?我还查看了 google 的 tensorflow,看看我是否可以从中得到一些东西,但在其文档中没有找到任何与文本聚类相关的内容。

标签: pythonmachine-learningtext-analysisunsupervised-learning

解决方案


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.


推荐阅读