allenai / allennlp

An open-source NLP research library, built on PyTorch.
http://www.allennlp.org
Apache License 2.0
11.77k stars 2.25k forks source link

How can I get the main mention when doing coreference resolution? #1502

Closed meggie-wong closed 6 years ago

meggie-wong commented 6 years ago

Hello,

When I use your tool to do coreference resolution, I need to replace the pronoun with the main mention (Span of the most representative mention). Could you tell me how can I get the main mention in a cluster?

Thanks very much.

DeNeutoy commented 6 years ago

Hi - unfortunately the co-reference model only models clusters, and not heads within clusters. It seems possible that you could extract the main NP/Named Entity from the cluster and use that?

meggie-wong commented 6 years ago

Thanks for your response, while could you give me some instructions on how to extract the main entity form the cluster? I am not so familiar with this field.

rushabhshah10 commented 6 years ago

Hi,

Can you please provide sample code snippet for finding main/head mention using NP within cluster ?