Skip to content

OpenJarbas/pronomial

Repository files navigation

Pronomial

simple and fast coreference solver, uses pos tags, a word gender classifier and lists of pronouns

Supported languages: English, Portuguese, Spanish, Catalan

Install

pip install pronomial

Usage

from 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 ."
"""

About

Pronomial will work fine for short sentences and should be safe to use in the context of simple things, but it tends to fail horribly in complex sentences.

It you want a proper coreference resolution library I suggest you check out neuralcoref or coreferee

Pronomial should not be used in production most of the time, it is intended as baseline and an experiment on how well this task can be solved using only simple heuristics.