This commit is contained in:
Raphael Mitsch 2023-03-05 14:14:16 +01:00
parent 38dce966e5
commit 5f40b3e523
2 changed files with 4 additions and 2 deletions

View File

@ -76,7 +76,7 @@ class InMemoryCandidate(Candidate):
mention: str,
entity_vector: List[float],
prior_prob: float,
entity_freq: int
entity_freq: int,
):
"""
hash_to_str (Callable[[int], str]): Callable retrieving entity name from provided entity/vocab hash.

View File

@ -63,7 +63,9 @@ def _check_kb(kb):
assert alias_string not in kb.get_alias_strings()
# check candidates & probabilities
candidates = sorted(kb._get_alias_candidates("double07"), key=lambda x: x.entity_id_str)
candidates = sorted(
kb._get_alias_candidates("double07"), key=lambda x: x.entity_id_str
)
assert len(candidates) == 2
assert candidates[0].entity_id_str == "Q007"