nordlys.logic.el.greedy module¶
Generative model for interpretation set finding
@author: Faegheh Hasibi
-
class
nordlys.logic.el.greedy.
Greedy
(score_th)[source]¶ Bases:
object
-
create_interpretations
(query_inss)[source]¶ Groups CER instances as interpretation sets.
Return list of interpretations, where each interpretation is a dictionary {mention: (en_id, score), ..}
-
disambiguate
(inss)[source]¶ Takes instances and generates set of entity linking interpretations.
Parameters: inss – Instances object Returns: sets of interpretations [{mention: (en_id, score), ..}, …]
-
is_overlapping
(mentions)[source]¶ Checks whether the strings of a set overlapping or not. i.e. if there exists a term that appears twice in the whole set.
- E.g. {“the”, “music man”} is not overlapping
- {“the”, “the man”, “music”} is overlapping.
NOTE: If a query is “yxxz” the mentions {“yx”, “xz”} and {“yx”, “x”} are overlapping.
Parameters: mentions – A list of strings :return True/False
-