The preceding recipe handled coreference between named entities. This recipe will add pronouns to the mix.
This recipe will use an interactive version to help you explore the properties of the coreference algorithm. The system is very dependent on the quality of the named-entity detection, so use examples that the HMM is likely to get right. This was trained on Wall Street Journal articles from the '90s.
Saddle up your console and type the following command:
java -cp lingpipe-cookbook.1.0.jar:lib/lingpipe-4.1.0.jar: com.lingpipe.cookbook.chapter7.Coreference
In the resulting command prompt, type this:
Enter text followed by new line >John Smith went to Washington. He was a senator. Sentence Text=John Smith went to Washington. mention text=John Smith type=PERSON id=0 mention text=Washington type=LOCATION id=1 Sentence Text= He was a senator. mention text=He type=MALE_PRONOUN id=0
The shared ID between
He
andJohn Smith
indicates the coreference between...