Anaphora resolution example requested with python-nltk

I studied howto for nltk-drt and in module definitions for nltk.sem.drt , but it’s very difficult for me to figure out how to achieve basic functions with these packages.

An example of a task that I would like to achieve is the following: Given a proposal

Google is one of the largest technology companies. These are the employees of many people.

I would like to write a small function that parses such a sentence and will return a sentence like

Google is one of the largest technology companies. Google employees are many people.

A more realistic test case might be something like

Tom, Dick and Harry were invited to her side, but refused. This made Sherry angry.

allowed

Tom, Dick and Harry were invited to a party at Sherry, but refused. This made Sherry angry.
+4
source share
1 answer

I do not think that DRT (Discourse Theory of Representation) deals with anaphora resolution , like what you wanted. It is dedicated to representing the meaning of sentences in formal logic.

In addition, there is a name for your "more realistic test case" called " cataphora ".

Anafora's resolution is complicated, but you can try Stanford DCoref

And see a few examples here: Resolution Anapora using Stanford Coref

+11
source

Source: https://habr.com/ru/post/1542579/


All Articles