huggingface / neuralcoref

✨Fast Coreference Resolution in spaCy with Neural Networks
https://huggingface.co/coref/
MIT License
2.84k stars 474 forks source link

appositive noun phrase #309

Open Fan-Luo opened 3 years ago

Fan-Luo commented 3 years ago

Hi,

I run into several cases that when appositive noun or noun phrase follows another noun phrase, the coreference is not resolved to the main phrase as expected.

For example: text = "Princess Marie-Cécile of Prussia (Marie-Cécile Kira Viktoria Luise; born 28 May 1942 in Cadinen, Kreis Elbing) is the daughter of Louis Ferdinand, Prince of Prussia, and his wife is Grand Duchess Kira Kirillovna of Russia, Her paternal grandparents were William, German Crown Prince, and Duchess Cecilie of Mecklenburg-Schwerin; maternally, she is a granddaughter of Cyril Vladimirovich, Grand Duke of Russia, and Princess Victoria Melita of Saxe-Coburg and Gotha"

doc._.coref_resolved = "Princess Marie-Cécile of Prussia (Marie-Cécile Kira Viktoria Luise; born 28 May 1942 in Cadinen, Kreis Elbing) is the daughter of Louis Ferdinand, Prince of Prussia, and (Marie-Cécile Kira Viktoria Luise wife is Grand Duchess Kira Kirillovna of Russia, (Marie-Cécile Kira Viktoria Luise paternal grandparents were William, German Crown Prince, and Duchess Cecilie of Mecklenburg-Schwerin; maternally, (Marie-Cécile Kira Viktoria Luise is a granddaughter of Cyril Vladimirovich, Grand Duke of Russia, and Princess Victoria Melita of Saxe-Coburg and Gotha"

Expected to be resolved as Princess Marie-Cécile of Prussia, instead of (Marie-Cécile Kira Viktoria Luise.

Code:

import neuralcoref 
neuralcoref.add_to_pipe(nlp, greedyness=0.55) 

Environment:

spacy: 2.3.5 neuralcoref: 4.0

Best Regards

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.