public class PerceptronSegmenter extends PerceptronTagger implements Segmenter
model| 构造器和说明 |
|---|
PerceptronSegmenter()
加载配置文件指定的模型
|
PerceptronSegmenter(LinearModel cwsModel) |
PerceptronSegmenter(String cwsModelFile) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected Instance |
createInstance(Sentence sentence,
FeatureMap featureMap) |
double[] |
evaluate(String corpora)
性能测试
|
boolean |
learn(String... words)
在线学习
|
boolean |
learn(String segmentedSentence)
在线学习
|
List<String> |
segment(String sentence)
中文分词
|
void |
segment(String text,
Instance instance,
List<String> output) |
void |
segment(String text,
List<String> output) |
void |
segment(String text,
String normalized,
List<String> output) |
getModel, learn, learnevaluate, evaluate, normalizepublic PerceptronSegmenter(LinearModel cwsModel)
public PerceptronSegmenter(String cwsModelFile) throws IOException
IOExceptionpublic PerceptronSegmenter()
throws IOException
IOExceptionpublic boolean learn(String segmentedSentence)
segmentedSentence - 分好词的句子,空格或tab分割,不含词性public boolean learn(String... words)
words - 分好词的句子protected Instance createInstance(Sentence sentence, FeatureMap featureMap)
createInstance 在类中 InstanceConsumerpublic double[] evaluate(String corpora) throws IOException
PerceptronTaggerevaluate 在类中 PerceptronTaggercorpora - 数据集IOExceptionCopyright © 2014–2019 码农场. All rights reserved.