How to Find Coreference Resolution in spaCy

Spread the love

spaCy comes with opensource module for Coreference Resolution we just need to import that module and start using it.

import spacy

nlp = spacy.load('en_coref_md')

doc = nlp(u'My brother has a pet. he loves it.')

print(doc._.has_coref)

print(doc._.coref_clusters)

Ouput:

admin

admin

Leave a Reply

Your email address will not be published. Required fields are marked *