MCPcopy Create free account
hub / github.com/DataArcTech/ToG / entity_search

Function entity_search

ToG/freebase_func.py:152–163  ·  view source on GitHub ↗
(entity, relation, head=True)

Source from the content-addressed store, hash-verified

150
151
152def entity_search(entity, relation, head=True):
153 if head:
154 tail_entities_extract = sparql_tail_entities_extract% (entity, relation)
155 entities = execurte_sparql(tail_entities_extract)
156 else:
157 head_entities_extract = sparql_head_entities_extract% (entity, relation)
158 entities = execurte_sparql(head_entities_extract)
159
160
161 entity_ids = replace_entities_prefix(entities)
162 new_entity = [entity for entity in entity_ids if entity.startswith("m.")]
163 return new_entity
164
165
166def entity_score(question, entity_candidates_id, score, relation, args):

Callers

nothing calls this directly

Calls 2

execurte_sparqlFunction · 0.85
replace_entities_prefixFunction · 0.85

Tested by

no test coverage detected