针对在线评论,提出了一种短文本语义距离计算模型,将文本距离看成是形式距离和单元语义距离的综合.首先,在对变异短文本进行预处理的基础上,以中文词语为单位,利用词典进行语义扩展,计算短文本间最大匹配距离,将其作为衡量短文本间形式距离的指标;其次,基于短文本中的实义单元和非实义单元的不同作用,利用改进的编辑距离算法计算短文本的单元语义距离;最后,利用加权的方法将形式距离和单元语义距离综合为文本距离,并将其应用于网络在线评论的聚类分析.特别地,为了缓解短文本长度差异所造成的计算误差,提出利用词表长度对距离进行惩罚,并根据Zipf’s Law和Heap’s Law的对应关系,给出了一种文本词表长度的估计方法,并阐明了文本Zipf指数α对长度惩罚的关键性作用机制.实验结果表明,改进算法优于传统方法,聚类性能显著提升.
An improved semantic distance for short text is proposed. The new method calculates the semantic distance between two word strings as balance of the extent of word sequence alignment and the meaning matching between word strings. First, after linguistic preprocessing, the extent of word sequence alignment is computed by the structural distance which measures the maximum matching based on the HIT-CIR Tongyici Cilin (extended edition). Then the meaning matching between word strings is computed by an improved edit distance which allocates each word a weight according to its word type. Finally, the semantic distance between the word strings is measured as a balance of structural distance and word meaning matching distance. In addition, in order to eliminate the influence of the sentence length, the proposed semantic distance is adjusted using the distinct word count estimated by the Heap's law and Zipf law. Experimental results show that the presented methods are more efficient than the classical edit distance models.