smartschat / cort

A toolkit for coreference resolution and error analysis.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Collins head finder iterator should be a list instead?

GavinPHR opened this issue · comments

commented

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.

if traverse_reversed:
to_traverse = reversed(tree)
else:
to_traverse = tree
for val in values:
for child in to_traverse:

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