To disambiguate an entire document, I have first completed all proper names and any of their contractions,
and then fed it to coreferee in small groups of sentences that each need resolution.
It generally works fine, but this pair of sentences has created quite incorrect chains:
sentence = '''Harry_Potter loves Hermionie_Granger. Hermionie_Granger quite likes him.
they both loathe Master_Draco_Malfoy who hates them.'''
doc = nlp(sentence)
doc._.coref_chains.print()
Output is:
0: Harry_Potter(0), him(7)
1: Hermionie_Granger(2), Hermionie_Granger(4), they(10)
2: both(11), them(16)
To disambiguate an entire document, I have first completed all proper names and any of their contractions,
and then fed it to coreferee in small groups of sentences that each need resolution.
It generally works fine, but this pair of sentences has created quite incorrect chains:
Output is:
0: Harry_Potter(0), him(7)
1: Hermionie_Granger(2), Hermionie_Granger(4), they(10)
2: both(11), them(16)