我正在使用最新版本的CoreNLP。
我的任务是解析文本并使用CollapsedCCProcessedDependenciesAnnotation以conll格式获得输出。
我运行以下命令
time java -cp $CoreNLP/javanlp-core.jar edu.stanford.nlp.pipeline.StanfordCoreNLP -props $CoreNLP/config.properties -file 12309959 -outputFormat conll
depparse.model = english_SD.gz问题是如何获得CollapsedCCProcessedDependenciesAnnotation。
我试着在config.properties中使用config.properties
但是,根据CCProcessedDependenciesAnnotation,COLLAPSED没有参数。
你能提出什么解决方案吗?如何用CollapsedCCProcessedDependenciesAnnotation解析?
发布于 2015-05-23 15:11:01
可以以编程方式检索经CC处理的依赖项。
This question应该是一个很好的示例(参见使用CollapsedCCProcessedDependenciesAnnotation的示例中的代码)。
Gabor在邮件列表中的回答很好地解释了这种行为(例如,为什么不能直接输出折叠的依赖项):
注意,通常情况下,折叠的cc处理的依赖项不会输出无损,但是,正如格式所要求的那样,树(每个单词都有一个唯一的父),而依赖项可以有多个标题。 因此,输出格式化程序只使用基本依赖项:https://github.com/stanfordnlp/CoreNLP/blob/master/src/edu/stanford/nlp/pipeline/CoNLLOutputter.java#L118。这可以在代码中被更改,而不会破坏任何东西,但是序列化的树会丢失一些边,并且包含边的领带会被任意破坏。您最好编写自己的倾倒逻辑,以适应您的特定用例(您可能可以从上面复制我们的大量conll输出代码)。
https://stackoverflow.com/questions/30410608
复制相似问题