Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Cannot use ConllCorefScores for general coref tasks #5363

Closed
david-waterworth opened this issue Aug 17, 2021 · 2 comments · Fixed by allenai/allennlp-models#298
Closed

Cannot use ConllCorefScores for general coref tasks #5363

david-waterworth opened this issue Aug 17, 2021 · 2 comments · Fixed by allenai/allennlp-models#298
Assignees

Comments

@david-waterworth
Copy link

Is your feature request related to a problem? Please describe.
The coreference model implement in allennlp coref.py is based on Higher-order Coreference Resolution with Coarse-to-fine Inference by Lee et al., 2018.

This model considers for a span i, all antecedents j, j<i and introduces a dummy cluster to represents spans with no antecedent. In [DWIE: an entity-centric dataset for multi-task document-level information extraction] by Zaporojects et al. 2021 this was seen as a limitation, they allowed singleton clusters j=i and eliminated the dummy cluster. In my current work I've combined both, a span can either be invalid (belong to the dummy cluster), be a singleton or have an antecedent.

The problem I've run into is due to a single assertion in ConllCorefScores the scores cannot be computed when the model is capable of predicting singletons

https://github.com/allenai/allennlp-models/blob/5012f2387decc806152fcba6ad81345b7627fc2a/allennlp_models/coref/metrics/conll_coref_scores.py#L107

I realise the code is correct in that it's based on models which cannot predict singleton clusters, but it would be nice if it were more general-purpose - specifically the only issue being a single assertion that is only valid for specific models.

@AkshitaB
Copy link
Contributor

@david-waterworth Will it suffice to add an attribute to the metric class that describes whether the model produces singletons or not, and use that to check for that assertion?

@david-waterworth
Copy link
Author

@AkshitaB yes that would be fine, in my case when there are singletons the assert could check assert i >= predicted_index and without singletons the existing check assert i > predicted_index would be retained. Not sure if there's other use cases.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants