我运行了来自 https://github.com/percyliang/brown-cluster 的布朗聚类算法,以及一个 Python 实现 https://github.com/mheilman/tan-clustering。它们都为每个独特的标记提供了一种二进制和另一个整数。例如:
0 the 610 chased 3110 dog 21110 mouse 21111 cat 2
二进制和整数分别代表什么意思?
从第一个 链接 中得知,二进制被称为 bit-string
,参见 http://saffron.deri.ie/acl_acl/document/ACL_ANTHOLOGY_ACL_P11-1053/
但是,从输出中如何判断 dog 和 mouse 和 cat
属于同一个簇,而 the 和 chased
不属于同一个簇呢?
回答:
如果我理解正确的话,算法给你一个树状结构,你需要在某个层次上截断它来获得簇。对于这些位字符串,你应该只取前 L
个字符。
例如,在第二个字符处截断,你会得到两个簇
10 chased 11 dog 11 mouse 11 cat
在第三个字符处,你会得到
110 dog 111 mouse 111 cat
不过,截断策略是另一个话题。