James Ellis
James Ellis

Reputation: 111

Spacy: count frequeny of an entity when referenced by different names

I want to count the frequency of an entity using Spacy. However, at times the entity is also called something else. For example:

"... president Joe Biden. The president boarded air force one."

I would want my counter to return 2 for Joe Biden because he has been referenced once as 'Joe Biden', and 'president' in the following sentence. Is there a way this can be done with Spacy in a general way? i.e also work for "CEO Tim Cook. The CEO did XYZ" etc.

Thanks for the help!

Upvotes: 2

Views: 481

Answers (1)

polm23
polm23

Reputation: 15623

You need a coreference model to do this. A coreference model tells you what mentions (spans of text, like entities) refer to the same thing.

spaCy doesn't have a working coreference model at the moment, but one is in progress, or you can try coreferee.

Upvotes: 2

Related Questions