public abstract class CRFTagger extends Object
| Modifier and Type | Field and Description |
|---|---|
protected LogLinearModel |
model |
| Constructor and Description |
|---|
CRFTagger() |
CRFTagger(String modelPath) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
convertCorpus(Sentence sentence,
BufferedWriter bw) |
void |
convertCorpus(String pkuPath,
String tsvPath) |
void |
dumpTemplate(String templatePath)
导出特征模板
|
protected abstract String |
getDefaultFeatureTemplate() |
String |
getTemplate()
获取特征模板
|
void |
train(String trainCorpusPath,
String modelPath) |
void |
train(String trainFile,
String modelFile,
int maxitr,
int freq,
double eta,
double C,
int threadNum,
int shrinkingSize,
Encoder.Algorithm algorithm) |
void |
train(String templFile,
String trainFile,
String modelFile,
int maxitr,
int freq,
double eta,
double C,
int threadNum,
int shrinkingSize,
Encoder.Algorithm algorithm)
训练
|
protected LogLinearModel model
public CRFTagger()
public CRFTagger(String modelPath) throws IOException
IOExceptionpublic void train(String templFile, String trainFile, String modelFile, int maxitr, int freq, double eta, double C, int threadNum, int shrinkingSize, Encoder.Algorithm algorithm) throws IOException
templFile - 模板文件trainFile - 训练文件modelFile - 模型文件maxitr - 最大迭代次数freq - 特征最低频次eta - 收敛阈值C - cost-factorthreadNum - 线程数shrinkingSize - algorithm - 训练算法IOExceptionpublic void train(String trainCorpusPath, String modelPath) throws IOException
IOExceptionpublic void train(String trainFile, String modelFile, int maxitr, int freq, double eta, double C, int threadNum, int shrinkingSize, Encoder.Algorithm algorithm) throws IOException
IOExceptionprotected abstract void convertCorpus(Sentence sentence, BufferedWriter bw) throws IOException
IOExceptionprotected abstract String getDefaultFeatureTemplate()
public void convertCorpus(String pkuPath, String tsvPath) throws IOException
IOExceptionpublic void dumpTemplate(String templatePath) throws IOException
templatePath - IOExceptionpublic String getTemplate()
Copyright © 2014–2021 码农场. All rights reserved.