public class CosineTextSimilarity extends TextSimilarity
filterStopWord, LOGGER
thresholdRate
Constructor and Description |
---|
CosineTextSimilarity() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args) |
protected double |
scoreImpl(List<Word> words1,
List<Word> words2)
判定相似度的方式:余弦相似度
余弦夹角原理:
向量a=(x1,y1),向量b=(x2,y2)
similarity=a.b/|a|*|b|
a.b=x1x2+y1y2
|a|=根号[(x1)^2+(y1)^2],|b|=根号[(x2)^2+(y2)^2]
|
setSegmentationAlgorithm, similarScore, similarScore, taggingWeightWithWordFrequency, toFastSearchMap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
rank, rank
isSimilar, isSimilar, isSimilar, isSimilar, similarScore, similarScore
protected double scoreImpl(List<Word> words1, List<Word> words2)
scoreImpl
in class TextSimilarity
words1
- 词列表1words2
- 词列表2public static void main(String[] args)
Copyright © 2014–2015 APDPlat. All rights reserved.