Closed sina-b closed 5 years ago
In the correct parse, "Germany" would directly depend on the root, while the preposition "in" depends on "Germany".
That's not the annotation scheme the parser has been trained with. While some annotation schemes strongly prefer lexical heads, it generally helps parser accuracy to have prepositions heading prepositional phrases, and this is the standard analysis for English.
So, the parse is not wrong.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
How to reproduce the behaviour
I just tested the Dependency Parser with the language file en_core_web_lg v2.0.0 in my code and it got me an incorrect parse. My input sentence is "John works in Germany". The resulting parse is:
0 John nsubj PROPN 1 [] 1 works ROOT VERB 1 [John, in, .] 2 in prep ADP 1 [Germany] 3 Germany pobj PROPN 2 [] 4 . punct PUNCT 1 []
My code looks like the following:
In the correct parse, "Germany" would directly depend on the root, while the preposition "in" depends on "Germany".
The double check, I used your online parser and it gives me the same result: https://explosion.ai/demos/displacy?text=John%20works%20in%20Germany.&model=en_core_web_lg&cpu=1&cph=1
Thanks for a quick reply! :)
Your Environment