I need to represent the output of the dependency parser as a collection of dependency tuples: [dprel, governor, dependency].
So, I wrote:
private Dependency nodeToDep(NLPNode n) {
int gov = n.getDependencyHead().getID();
return new Dependency.Builder(n.getDependencyLabel(), gov - 1, n.getID() - 1).build();
}
This is working fine for many examples. However, for the this sentence:
and the modern, lightweight, steel, collapsible wheelchair was created by Harry Jennings and his disabled friend Herbert Everest, in 1933.
I end up with two nodes with a head of 0. My representation is below; see the two occurrences of 'ROOT'. Am I misinterpreting the output data structure?
I found my mistake: I split the decode process into running the tagger and then later running the parser, and I messed up the book-keeping. Sorry for the noise.
I need to represent the output of the dependency parser as a collection of dependency tuples: [dprel, governor, dependency].
So, I wrote:
This is working fine for many examples. However, for the this sentence:
I end up with two nodes with a head of 0. My representation is below; see the two occurrences of 'ROOT'. Am I misinterpreting the output data structure?