Skip to content

Commit 418aaec

Browse files
committed
critical fix for lea_score
1 parent 07891ac commit 418aaec

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tibert/score.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,15 @@ def lea_link_score(links: set) -> int:
246246
return len(links)
247247

248248
def lea_res_score(entity: List[Mention], entities: List[List[Mention]]) -> float:
249-
score = sum(
250-
[
249+
score = 0
250+
for o_entity in entities:
251+
entity_link_score = lea_link_score(lea_link(entity))
252+
if entity_link_score == 0:
253+
continue
254+
score += (
251255
lea_link_score(lea_link(entity).intersection(lea_link(o_entity)))
252-
/ lea_link_score(lea_link(entity))
253-
for o_entity in entities
254-
]
255-
)
256+
/ entity_link_score
257+
)
256258
return score
257259

258260
precisions, recalls, f1s = [], [], []

0 commit comments

Comments
 (0)