I’m having some trouble understanding the changes made to the coref resolver in the last version of the Stanford NLP tools.
As an example, below is a sentence and the corresponding CorefChainAnnotation:
The atom is a basic unit of matter, it consists of a dense central nucleus surrounded by a cloud of negatively charged electrons.
{1=[1 1, 1 2], 5=[1 3], 7=[1 4], 9=[1 5]}
I am not sure I understand the meaning of these numbers. Looking at the source doesn’t really help either.
Thank you
The first number is a cluster id (representing tokens, which stand for the same entity), see source code of
SieveCoreferenceSystem#coref(Document). The pair numbers are outout of CorefChain#toString():where position is a set of postion pairs of entity mentioning (to get them use
CorefChain.getCorefMentions()). Here is an example of a complete code (in groovy), which shows how to get from positions to tokens:Output (I do not understand where ‘s’ comes from):