Modifier and Type | Method and Description |
---|---|
static List<Word> |
WordSegmenter.seg(String text)
对文本进行分词,移除停用词
使用双向最大匹配算法
|
static List<Word> |
WordSegmenter.seg(String text,
SegmentationAlgorithm segmentationAlgorithm)
对文本进行分词,移除停用词
可指定其他分词算法
|
static List<Word> |
WordSegmenter.segWithStopWords(String text)
对文本进行分词,保留停用词
使用双向最大匹配算法
|
static List<Word> |
WordSegmenter.segWithStopWords(String text,
SegmentationAlgorithm segmentationAlgorithm)
对文本进行分词,保留停用词
可指定其他分词算法
|
Modifier and Type | Method and Description |
---|---|
default boolean |
Similarity.isSimilar(HashMap<Word,Float> weights1,
HashMap<Word,Float> weights2)
词及其权重映射1和词及其权重映射2是否相似
|
default boolean |
Similarity.isSimilar(HashMap<Word,Float> weights1,
HashMap<Word,Float> weights2)
词及其权重映射1和词及其权重映射2是否相似
|
default boolean |
Similarity.isSimilar(List<Word> words1,
List<Word> words2)
词列表1和词列表2是否相似
|
default boolean |
Similarity.isSimilar(List<Word> words1,
List<Word> words2)
词列表1和词列表2是否相似
|
protected abstract double |
TextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
计算相似度分值
|
protected abstract double |
TextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
计算相似度分值
|
protected double |
SørensenDiceCoefficientTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
计算相似度分值
|
protected double |
SørensenDiceCoefficientTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
计算相似度分值
|
protected double |
SimpleTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
计算相似度分值
|
protected double |
SimpleTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
计算相似度分值
|
protected double |
SimHashPlusHammingDistanceTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
计算相似度分值
|
protected double |
SimHashPlusHammingDistanceTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
计算相似度分值
|
protected double |
ManhattanDistanceTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
判定相似度的方式:曼哈顿距离
曼哈顿距离原理:
设A(x1, y1),B(x2, y2)是平面上任意两点
两点间的距离dist(A,B)=|x1-x2|+|y1-y2|
|
protected double |
ManhattanDistanceTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
判定相似度的方式:曼哈顿距离
曼哈顿距离原理:
设A(x1, y1),B(x2, y2)是平面上任意两点
两点间的距离dist(A,B)=|x1-x2|+|y1-y2|
|
protected double |
JaroWinklerDistanceTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
计算相似度分值
|
protected double |
JaroWinklerDistanceTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
计算相似度分值
|
protected double |
JaroDistanceTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
计算相似度分值
|
protected double |
JaroDistanceTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
计算相似度分值
|
protected double |
JaccardTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
判定相似度的方式:Jaccard相似性系数
|
protected double |
JaccardTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
判定相似度的方式:Jaccard相似性系数
|
protected double |
EuclideanDistanceTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
判定相似度的方式:欧几里得距离
欧几里得距离原理:
设A(x1, y1),B(x2, y2)是平面上任意两点
两点间的距离dist(A,B)=sqrt((x1-x2)^2+(y1-y2)^2)
|
protected double |
EuclideanDistanceTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
判定相似度的方式:欧几里得距离
欧几里得距离原理:
设A(x1, y1),B(x2, y2)是平面上任意两点
两点间的距离dist(A,B)=sqrt((x1-x2)^2+(y1-y2)^2)
|
protected double |
EditDistanceTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
计算相似度分值
|
protected double |
EditDistanceTextSimilarity.scoreImpl(List<Word> words1,
List<Word> words2)
计算相似度分值
|
protected double |
CosineTextSimilarity.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]
|
protected double |
CosineTextSimilarity.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]
|
default double |
Similarity.similarScore(HashMap<Word,Float> weights1,
HashMap<Word,Float> weights2)
词及其权重映射1和词及其权重映射2的相似度分值
|
default double |
Similarity.similarScore(HashMap<Word,Float> weights1,
HashMap<Word,Float> weights2)
词及其权重映射1和词及其权重映射2的相似度分值
|
double |
TextSimilarity.similarScore(List<Word> words1,
List<Word> words2)
词列表1和词列表2的相似度分值
|
double |
TextSimilarity.similarScore(List<Word> words1,
List<Word> words2)
词列表1和词列表2的相似度分值
|
double |
Similarity.similarScore(List<Word> words1,
List<Word> words2)
词列表1和词列表2的相似度分值
|
double |
Similarity.similarScore(List<Word> words1,
List<Word> words2)
词列表1和词列表2的相似度分值
|
protected void |
TextSimilarity.taggingWeightWithWordFrequency(List<Word> words1,
List<Word> words2)
如果没有指定权重,则默认使用词频来标注词的权重
词频数据怎么来?
一个词在词列表1中出现了几次,它在词列表1中的权重就是几
一个词在词列表2中出现了几次,它在词列表2中的权重就是几
标注好的权重存储在Word类的weight字段中
|
protected void |
TextSimilarity.taggingWeightWithWordFrequency(List<Word> words1,
List<Word> words2)
如果没有指定权重,则默认使用词频来标注词的权重
词频数据怎么来?
一个词在词列表1中出现了几次,它在词列表1中的权重就是几
一个词在词列表2中出现了几次,它在词列表2中的权重就是几
标注好的权重存储在Word类的weight字段中
|
protected Map<String,Float> |
TextSimilarity.toFastSearchMap(List<Word> words)
构造权重快速搜索容器
|
Modifier and Type | Method and Description |
---|---|
static Map<List<Word>,Float> |
Bigram.bigram(List<Word>... sentences)
含有语境的二元模型分值算法
计算多种分词结果的分值
利用获得的二元模型分值重新计算分词结果的分值
补偿细粒度切分获得分值而粗粒度切分未获得分值的情况
|
static Map<List<Word>,Float> |
Trigram.trigram(List<Word>... sentences)
一次性计算多种分词结果的三元模型分值
|
Modifier and Type | Method and Description |
---|---|
static float |
Bigram.bigram(List<Word> words)
计算分词结果的二元模型分值
|
static float |
Trigram.trigram(List<Word> words)
计算分词结果的三元模型分值
|
Modifier and Type | Method and Description |
---|---|
static List<Word> |
PersonName.recognize(List<Word> words)
对分词结果进行处理,识别人名
|
Modifier and Type | Method and Description |
---|---|
static void |
StopWord.filterStopWords(List<Word> words)
停用词过滤,删除输入列表中的停用词
|
static List<Word> |
PersonName.recognize(List<Word> words)
对分词结果进行处理,识别人名
|
Modifier and Type | Method and Description |
---|---|
static Word |
WordRefiner.combine(List<Word> words)
将多个词合并成一个,返回null表示不能合并
|
Modifier and Type | Method and Description |
---|---|
List<Word> |
Word.getAntonym() |
List<Word> |
Word.getSynonym() |
static List<Word> |
WordRefiner.refine(List<Word> words)
先拆词,再组词
|
List<Word> |
Segmentation.seg(String text)
将文本切分为词
|
static List<Word> |
WordRefiner.split(Word word)
将一个词拆分成几个,返回null表示不能拆分
|
Modifier and Type | Method and Description |
---|---|
static List<Word> |
WordRefiner.split(Word word)
将一个词拆分成几个,返回null表示不能拆分
|
Modifier and Type | Method and Description |
---|---|
static Word |
WordRefiner.combine(List<Word> words)
将多个词合并成一个,返回null表示不能合并
|
static List<Word> |
WordRefiner.refine(List<Word> words)
先拆词,再组词
|
void |
Word.setAntonym(List<Word> antonym) |
void |
Word.setSynonym(List<Word> synonym) |
Modifier and Type | Method and Description |
---|---|
protected Word |
AbstractSegmentation.getWord(String text,
int start,
int len)
获取一个已经识别的词
|
Modifier and Type | Method and Description |
---|---|
Map<List<Word>,Float> |
AbstractSegmentation.ngram(List<Word>... sentences)
利用ngram进行评分
|
List<Word> |
PureEnglish.seg(String text) |
List<Word> |
AbstractSegmentation.seg(String text)
默认分词算法实现:
1、把要分词的文本根据标点符号进行分割
2、对分割后的文本进行分词
3、组合分词结果
|
List<Word> |
ReverseMinimumMatching.segImpl(String text) |
List<Word> |
ReverseMaximumMatching.segImpl(String text) |
List<Word> |
MinimumMatching.segImpl(String text) |
List<Word> |
MinimalWordCount.segImpl(String text) |
List<Word> |
MaxNgramScore.segImpl(String text) |
List<Word> |
MaximumMatching.segImpl(String text) |
List<Word> |
FullSegmentation.segImpl(String text) |
List<Word> |
BidirectionalMinimumMatching.segImpl(String text) |
List<Word> |
BidirectionalMaximumMinimumMatching.segImpl(String text) |
List<Word> |
BidirectionalMaximumMatching.segImpl(String text) |
abstract List<Word> |
AbstractSegmentation.segImpl(String text)
具体的分词实现,留待子类实现
|
Modifier and Type | Method and Description |
---|---|
protected void |
AbstractSegmentation.addWord(List<Word> result,
String text,
int start,
int len)
将识别出的词放入队列
|
protected void |
AbstractSegmentation.addWord(Stack<Word> result,
String text,
int start,
int len)
将识别出的词入栈
|
Modifier and Type | Method and Description |
---|---|
static void |
SynonymTagging.process(List<Word> words) |
static void |
PinyinTagging.process(List<Word> words) |
static void |
PartOfSpeechTagging.process(List<Word> words) |
static void |
AntonymTagging.process(List<Word> words) |
static void |
SynonymTagging.process(List<Word> words,
boolean direct) |
Modifier and Type | Method and Description |
---|---|
void |
Utils.FileSegmentationCallback.callback(Word word) |
Copyright © 2014–2015 APDPlat. All rights reserved.