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

Function save_2_jsonl

ToG/utils.py:156–160  ·  view source on GitHub ↗
(question, answer, cluster_chain_of_entities, file_name)

Source from the content-addressed store, hash-verified

154
155
156def save_2_jsonl(question, answer, cluster_chain_of_entities, file_name):
157 dict = {"question":question, "results": answer, "reasoning_chains": cluster_chain_of_entities}
158 with open("ToG_{}.jsonl".format(file_name), "a") as outfile:
159 json_str = json.dumps(dict)
160 outfile.write(json_str + "\n")
161
162
163def extract_answer(text):

Callers 4

main_freebase.pyFile · 0.85
main_wiki.pyFile · 0.85
half_stopFunction · 0.85
half_stopFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected