smartschat / cort

A toolkit for coreference resolution and error analysis.
MIT License
129 stars 34 forks source link

Collins head finder iterator should be a list instead? #24

Closed GavinPHR closed 1 year ago

GavinPHR commented 3 years ago

I noticed some discrepancies between the 2 different traversal orders. reversed() on line 108 returns an iterator and if it gets exhausted in the first iteration of the loop on 111, the subsequent result is incorrect. https://github.com/smartschat/cort/blob/2349f0308a4115acb89d442fe945533bdb3b70e2/cort/core/head_finders.py#L107-L112

Suggest to change from to_traverse = reversed(tree) to to_traverse = list(reversed(tree) )