public class Trigram extends Object
Constructor and Description |
---|
Trigram() |
Modifier and Type | Method and Description |
---|---|
static int |
getFrequency(String first,
String second,
String third) |
static int |
getMaxFrequency() |
static float |
getScore(String first,
String second,
String third)
获取三个词前后紧挨着同时出现在语料库中的分值
分值被归一化了:
完全没有出现分值为0
出现频率最高的分值为1
|
static void |
reload() |
static Map<List<Word>,Float> |
trigram(List<Word>... sentences)
一次性计算多种分词结果的三元模型分值
|
static float |
trigram(List<Word> words)
计算分词结果的三元模型分值
|
public static void reload()
public static int getMaxFrequency()
public static Map<List<Word>,Float> trigram(List<Word>... sentences)
sentences
- 多种分词结果public static float trigram(List<Word> words)
words
- 分词结果public static float getScore(String first, String second, String third)
first
- 第一个词second
- 第二个词third
- 第三个词Copyright © 2014–2015 APDPlat. All rights reserved.