I am using neuralcoref for the task of coreference resolution in a text.
I want to know each sentence has mentions from which coreference clusters. For example, sentence1 has mentions from coreference clusters 1, and 4; sentence 2 has mentions from coreference clusters 10 , 14.
How can I do this?
You can try going though words in each sentence and populate a dictionary of sentence -> clusters if that word is part of a cluster. It assumes the span to be a single word though, which you can try extending to multiple words (bi-grams or tri-grams), in case you want to handle clusters where keys are multi-word.
The output looks like this: