文本聚类
文本聚类的一种实现,使用 k-means 进行聚类,并使用作为距离度量。
等等,什么?
基本上,如果您有一堆文本文档,并且您想按相似性将它们分成 n 个组,那么您很幸运。
例子
为了测试这一点,我们可以查看test_clustering.py :
from vectorizer import cluster_paragraphs
from random import shuffle
text1 = """Type theory is closely related to (and in some cases overlaps with) type systems, which are a programming language feature used to reduce bugs. The types of type theory were created to avo
2021-11-08 17:54:02
9KB
Python
1