sivareddyg/graph-parser

The head word for arguments with numbers

mjhosseini opened this issue · 4 comments

Hi Siva,

In the list of relations, when one of the arguments involves a number, the parser gives the number as the argument. However, I was wondering if the head word should be the argument? Or, if there is an easy way to get the head word from your current output. For example, in the sentence: "Mike Smith still had to stop 41 shots and the Coyotes withstood two late penalties.", the parser gives these binary relations:

(stop.1,stop.2) mike-smith 41
(withstood.1,withstood.2) coyotes two

But for my use, I'm interested in
(stop.1,stop.2) mike-smith shots
(withstood.1,withstood.2) coyotes penalties

I know that I can use the types and get the head arguments in these cases, but for the sentences like "Palushaj is one of four Avs forwards who began the season in the American Hockey League.", the same idea gives Avs as the head, while "forwards" seems to be correct. I was wondering if you can guide me how to get the index of "forwards" as the argument in this example?

Thanks,
Javad

Try commenting this line https://github.com/sivareddyg/graph-parser/blob/master/lib_data/lexicon_specialCases.txt#L52

Please post an update and close the issue if solved :).

It resolved the first example. For the second one, it doesn't give anything as output. Does this seem fine?

What is the output you get? can you paste both the parse and the graph.

The graphparser is actually getting the output correct :) I realized that I was filtering the relation because "forwards" gets the POS tag adverb based on Stanford parser (I was expecting a noun or something...). For completeness, I'm pasting the output that I'm getting when I'm not filtering anything:

(<T S[dcl] ba 1 2> (<T NP lex 0 1> () ) (<T S[dcl]\NP fa 0 2> (<L (S[dcl]\NP)/NP is be VBZ O O (S[dcl]\NP)/NP>) (<T NP ba 0 2> (<T NP lex 0 1> () ) (<T NP\NP fa 0 2> (<L (NP\NP)/NP of of IN O O (NP\NP)/NP>) (<T NP ba 0 2> (<T NP lex 0 1> (<T N fa 1 2> (<L N/N four four CD NUMBER O N/N>) (<T N fa 1 2> (<L N/N Avs Avs NNS O O N/N>) () ) ) ) (<T NP\NP fa 0 2> (<L (NP\NP)/(S[dcl]\NP) who who WP O O (NP\NP)/(S[dcl]\NP)>) (<T S[dcl]\NP fa 0 2> (<L (S[dcl]\NP)/NP began begin VBD O O (S[dcl]\NP)/NP>) (<T NP[nb] ba 0 2> (<T NP[nb] fa 0 2> (<L NP[nb]/N the the DT O O NP[nb]/N>) () ) (<T NP\NP fa 0 2> (<L (NP\NP)/NP in in IN O O (NP\NP)/NP>) (<T NP[nb] rp 0 2> (<T NP[nb] fa 0 2> (<L NP[nb]/N the the DT O O NP[nb]/N>) () ) (<L . . . . O O .>) ) ) ) ) ) ) ) ) ) )

(began.1,began.2) forwards season
(of.1,of.2) palushaj forwards
(season.in.1,season.in.2) season american-hockey-league

I'm gonna close the issue. Many thanks for your help!