Java 斯坦福大学CoreNLP中如何选择共指消解系统
我正在尝试从core nlp测试共指消解系统。从中,我了解如何设置“dcoref系统”的常规属性 我想根据模块的延迟在共同参考系统[确定性、统计性、神经性]之间进行选择。命令行的用法对我来说很清楚,我如何将此选项用作API 目前,我正在运行默认代码:Java 斯坦福大学CoreNLP中如何选择共指消解系统,java,stanford-nlp,stanford-parser,Java,Stanford Nlp,Stanford Parser,我正在尝试从core nlp测试共指消解系统。从中,我了解如何设置“dcoref系统”的常规属性 我想根据模块的延迟在共同参考系统[确定性、统计性、神经性]之间进行选择。命令行的用法对我来说很清楚,我如何将此选项用作API 目前,我正在运行默认代码: public static void main(String[] args) throws Exception { Annotation document = new Annotation("Barack Obama was born in
public static void main(String[] args) throws Exception {
Annotation document = new Annotation("Barack Obama was born in Hawaii. He is the president. Obama was elected in 2008.");
Properties props = new Properties();
props.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner,parse,mention,coref");
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
pipeline.annotate(document);
System.out.println("---");
System.out.println("coref chains");
for (CorefChain cc : document.get(CorefCoreAnnotations.CorefChainAnnotation.class).values()) {
System.out.println("\t" + cc);
}
for (CoreMap sentence : document.get(CoreAnnotations.SentencesAnnotation.class)) {
System.out.println("---");
System.out.println("mentions");
for (Mention m : sentence.get(CorefCoreAnnotations.CorefMentionsAnnotation.class)) {
System.out.println("\t" + m);
}
}
在挖掘了
corefproperty.class
之后,我找到了需要更改的属性
props.setProperty("coref.language", "en");
props.setProperty("coref.algorithm", "statistical");//"statistical" : "neural"
但是,更令人惊讶的是,执行上面的示例测试文本<编码>统计方法大约需要45秒,
神经
大约需要30秒。(英特尔i5@2.00Ghz,8GB内存)。我在这里遗漏了什么吗?W在挖掘了corefproperty.class
之后,我找到了需要更改的属性
props.setProperty("coref.language", "en");
props.setProperty("coref.algorithm", "statistical");//"statistical" : "neural"
但是,更令人惊讶的是,执行上面的示例测试文本<编码>统计方法大约需要45秒,
神经
大约需要30秒。(英特尔i5@2.00Ghz,8GB内存)。我在这里遗漏了什么吗?嘿,这是一个老问题,但如果你还记得的话,你能分享一下你是如何通过命令行选择不同的coref系统的吗?一个示例命令将非常棒!嘿,这是个老问题,但若你们还记得的话,你们能分享一下你们是如何通过命令行选择不同的coref系统的吗?一个示例命令将非常棒!