2

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:

Community
  • 1
  • 1
Josep Valls
  • 5,483
  • 2
  • 33
  • 67

1 Answers1

2

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.

Community
  • 1
  • 1
prash
  • 324
  • 3
  • 14
  • Thanks. I was looking into the CoreNLP docs (http://nlp.stanford.edu/software/corenlp.shtml) instead of the Parser docs. – Josep Valls Aug 26 '13 at 19:17