Pronomial is a fast, rule-based coreference solver. It links each pronoun in a text to the noun it most likely refers to, using part-of-speech tags, a word gender classifier, and lists of pronouns. It supports English, Portuguese, Spanish, and Catalan.
pip install pronomialfrom pronomial import replace_corefs
replace_corefs("London has been a major settlement for two millennia. "
"It was founded by the Romans, who named it Londinium.",
lang="en")
"""
"London has been a major settlement for two millennia . "
"London was founded by the Romans , Romans named London Londinium ."
"""See docs/quickstart.md for more examples, and docs/api.md for the full function and class reference.
Pronomial works well on short sentences. It is safe to use for simple text, but it can fail on complex sentences with several competing antecedents.
For a full coreference resolution library, see neuralcoref or coreferee.
Pronomial is a baseline. It shows how well simple heuristics can solve coreference resolution. Do not rely on it for production use.
- TigreGotico/quebra_frases: the tokenizer Pronomial uses to split text into words.
Apache License 2.0. See LICENSE.