Fix get_matching_ents (#10451)

* Fix get_matching_ents

Not sure what happened here - the code prior to this commit simply does
not work. It's already covered by entity linker tests, which were
succeeding in the NEL PR, but couldn't possibly succeed on master.

* Fix test

Test was indented inside another test and so doesn't seem to have been
running properly.
This commit is contained in:
Paul O'Leary McCann 2022-03-08 00:56:57 +09:00 committed by GitHub
parent 7ed7908716
commit 61ba5450ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 56 additions and 56 deletions

View File

@ -263,11 +263,11 @@ cdef class Example:
kept. Otherwise only the character indices need to match.
"""
gold = {}
for ent in self.reference:
for ent in self.reference.ents:
gold[(ent.start_char, ent.end_char)] = ent.label
keep = []
for ent in self.predicted:
for ent in self.predicted.ents:
key = (ent.start_char, ent.end_char)
if key not in gold:
continue