nordlys.logic.el.ltr module¶
LTR Entity Linking Approach¶
Class for Learning-to-Rank entity linking approach
Author: | Faegheh Hasibi |
---|
-
class
nordlys.logic.el.ltr.
LTR
(query, entity, elastic, fcache, model=None, threshold=None, cmns_th=0.1)[source]¶ Bases:
object
-
get_candidate_inss
()[source]¶ Detects mentions and their candidate entities (with their commoness scores) and generates instances
Returns: Instances object
-
get_features
(ins, cand_ens=None)[source]¶ Generates the features set for each instance.
Parameters: - ins – instance object
- cand_ens – dictionary of candidate entities {en_id: cmns, …}
Returns: dictionary of features {ftr_name: value, …}
-
link
()[source]¶ Links the query to the entity.
Returns: dictionary [{“mention”: xx, “entity”: yy, “score”: zz}, …]
-
static
load_yerd
(gt_file)[source]¶ Reads the Y-ERD collection and returns a dictionary.
Parameters: gt_file – Path to the Y-ERD collection Returns: dictionary {(qid, query, en_id, mention) …}
-