public abstract class CommonDictionaryMaker extends Object implements ISaveAble
| Modifier and Type | Field and Description |
|---|---|
boolean |
verbose |
| Constructor and Description |
|---|
CommonDictionaryMaker(EasyDictionary dictionary) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addToDictionary(List<List<IWord>> sentenceList)
加入到词典中,允许子类自定义过滤等等,这样比较灵活
|
void |
compute(List<List<IWord>> sentenceList)
处理语料,准备词典
|
void |
learn(List<Sentence> sentenceList)
同compute
|
void |
learn(Sentence... sentences)
同compute
|
protected abstract void |
roleTag(List<List<IWord>> sentenceList)
角色标注,如果子类要进行label的调整或增加新的首尾等等,可以在此进行
|
boolean |
saveTxtTo(String path)
将自己以文本文档的方式保存到磁盘
|
void |
train(String corpus)
训练
|
public CommonDictionaryMaker(EasyDictionary dictionary)
public boolean saveTxtTo(String path)
ISaveAblepublic void learn(Sentence... sentences)
sentences - public void train(String corpus)
corpus - 语料库路径protected abstract void addToDictionary(List<List<IWord>> sentenceList)
sentenceList - Copyright © 2014–2021 码农场. All rights reserved.