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


Groups CER instances as interpretation sets.

Return list of interpretations, where each interpretation is a dictionary {mention:
 (en_id, score), ..}

Takes instances and generates set of entity linking interpretations.

Parameters:inss – Instances object
Returns:sets of interpretations [{mention: (en_id, score), ..}, …]

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


prunes based on a static threshold of ranking score.


Deletes containment mentions, if they have lower score.