kazu.utils.link_index¶
Classes
The dictionary index looks for LinkingCandidates via a char ngram search between the normalised version of the query string and the synonym_norm of all LinkingCandidates associated with the provided OntologyParser. |
- class kazu.utils.link_index.DictionaryIndex[source]¶
Bases:
object
The dictionary index looks for LinkingCandidates via a char ngram search between the normalised version of the query string and the synonym_norm of all LinkingCandidates associated with the provided OntologyParser.
- __init__(parser, boolean_scorers=None)[source]¶
- Parameters:
parser (OntologyParser)
boolean_scorers (list[BooleanStringSimilarityScorer] | None) – precision can be increased by applying boolean checks on the returned result, for instance, checking that all integers are represented, that any noun modifiers are present etc
- search(query, top_n=15)[source]¶
Search the index with a query string.
Note
This method will only return results with search scores above 0. As a result, it will return fewer than
top_n
results when there are nottop_n
LinkingCandidate
s in the index that score about 0 for the given query.- Parameters:
- Returns:
- Return type: