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

Function clean_scores

ToG/utils.py:146–153  ·  view source on GitHub ↗
(string, entity_candidates)

Source from the content-addressed store, hash-verified

144
145
146def clean_scores(string, entity_candidates):
147 scores = re.findall(r'\d+\.\d+', string)
148 scores = [float(number) for number in scores]
149 if len(scores) == len(entity_candidates):
150 return scores
151 else:
152 print("All entities are created equal.")
153 return [1/len(entity_candidates)] * len(entity_candidates)
154
155
156def save_2_jsonl(question, answer, cluster_chain_of_entities, file_name):

Callers 2

entity_scoreFunction · 0.85
entity_scoreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected