public class KBeamArcEagerDependencyParser extends AbstractDependencyParser
| Constructor and Description |
|---|
KBeamArcEagerDependencyParser() |
KBeamArcEagerDependencyParser(KBeamArcEagerParser parser) |
KBeamArcEagerDependencyParser(Segment segment,
KBeamArcEagerParser parser) |
KBeamArcEagerDependencyParser(String modelPath) |
KBeamArcEagerDependencyParser(String modelPath,
String cwsModelPath,
String posModelPath) |
| Modifier and Type | Method and Description |
|---|---|
double[] |
evaluate(String testCorpus)
标准化评测
|
CoNLLSentence |
parse(List<Term> termList)
分析句子的依存句法
|
CoNLLSentence |
parse(List<Term> termList,
int beamWidth,
int numOfThreads)
执行句法分析
|
static KBeamArcEagerDependencyParser |
train(String trainCorpus,
String devCorpus,
String clusterPath,
String modelPath)
训练依存句法分析器
|
enableDeprelTranslator, getDeprelTranslator, getSegment, parse, setDeprelTranslater, setDeprelTranslator, setSegmentpublic KBeamArcEagerDependencyParser()
throws IOException,
ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic KBeamArcEagerDependencyParser(Segment segment, KBeamArcEagerParser parser)
public KBeamArcEagerDependencyParser(KBeamArcEagerParser parser)
public KBeamArcEagerDependencyParser(String modelPath) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic KBeamArcEagerDependencyParser(String modelPath, String cwsModelPath, String posModelPath) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic static KBeamArcEagerDependencyParser train(String trainCorpus, String devCorpus, String clusterPath, String modelPath) throws InterruptedException, ExecutionException, IOException, ClassNotFoundException
trainCorpus - 训练集devCorpus - 开发集clusterPath - Brown词聚类文件modelPath - 模型储存路径InterruptedExceptionExecutionExceptionIOExceptionClassNotFoundExceptionpublic double[] evaluate(String testCorpus) throws IOException, ExecutionException, InterruptedException
testCorpus - 测试语料IOExceptionExecutionExceptionInterruptedExceptionpublic CoNLLSentence parse(List<Term> termList)
IDependencyParsertermList - 句子,可以是任何具有词性标注功能的分词器的分词结果public CoNLLSentence parse(List<Term> termList, int beamWidth, int numOfThreads)
termList - 分词结果beamWidth - 柱搜索宽度numOfThreads - 多线程数Copyright © 2014–2021 码农场. All rights reserved.