Stanford Dependencies Conversion Tool [closed]

泄露秘密 提交于 2019-12-22 17:53:32

问题


The Stanford dependencies manual (http://nlp.stanford.edu/software/dependencies_manual.pdf) mentions: "Or our conversion tool can convert the output of other constituency parsers to the Stanford Dependencies representation."

Does anyone know where is that tool available or how to use it?

The Stanford Parser documentation (http://nlp.stanford.edu/software/stanford-dependencies.shtml) mentions: "the dependencies can be obtained using our software [...] on phrase-structure trees using the EnglishGrammaticalStructure class available in the parser package."

I am interested in obtaining (ccprocessed) typed dependency lists to use in NLTK. I see there is a constructor EnglishGrammaticalStructure(Tree t) and I'd like some guidance on how to provide a NLTK tree to it.

First idea: Use nltk.tree.Tree.pprint to produce a string and then parse it using Tree.valueOf from Java. Any suggestion?

Related questions:

  • How do I do dependency parsing in NLTK?
  • Does NLTK have a tool for dependency parsing?

回答1:


I am not sure if you have looked at the Stanford Parser's FAQs:

Can I just get your typed dependencies (grammatical relations) output from the trees produced by another parser?

You can use the main method of EnglishGrammaticalStructure. You can give it options like -treeFile to read in trees, and, say, -collapsed to output typedDependenciesCollapsed. For example, this command (with appropriate paths) will convert a Penn Treebank file to uncollapsed typed dependencies:

java -cp stanford-parser.jar edu.stanford.nlp.trees.EnglishGrammaticalStructure -treeFile wsj/02/wsj_0201.mrg -basic

[...]

The mrg file, here, is a 'merged' (i.e. POS tags and phrase structure) Penn Treebank representation, which you can get NLTK's Tree.pprint to emit, if you use an appropriate grammar definition. However, I cannot expand on this because the question description does not go into why these two tools must be pipelined.



来源:https://stackoverflow.com/questions/17846355/stanford-dependencies-conversion-tool

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!