MCPcopy Create free account
hub / github.com/FlyingFeather/DEA-SQL / run

Method run

get_ner.py:58–79  ·  view source on GitHub ↗

get NER of users' query, and classify the label of entity :param query: user input :return: llm output, consist of entity and its entity label within []

(self, query, dataset)

Source from the content-addressed store, hash-verified

56 return res
57
58 def run(self, query, dataset):
59 """
60 get NER of users' query, and classify the label of entity
61 :param query: user input
62 :return: llm output, consist of entity and its entity label within []
63 """
64
65 generate_sql_prompt = get_ner_prompt(dataset)
66
67 prompt_dict = {
68 "query": query
69 }
70
71 prompt = get_prompt_content(generate_sql_prompt, prompt_dict)
72 res = ask_llm(prompt)
73 res = self.parse_json(res)
74 if "entities" in res:
75 res["limitation"] = res["entities"]
76 for i in ["limitation", "metric", "query"]:
77 if i not in res:
78 res[i] = []
79 return res

Callers 15

step_get_ner_resultsMethod · 0.80
run_chainFunction · 0.80
test_encodeMethod · 0.80
test_encodeMethod · 0.80
test_decodeMethod · 0.80
test_readingMethod · 0.80
test_gradientsMethod · 0.80
test_with_beam_searchMethod · 0.80

Calls 4

parse_jsonMethod · 0.95
get_ner_promptFunction · 0.90
get_prompt_contentFunction · 0.90
ask_llmFunction · 0.90

Tested by 15

test_encodeMethod · 0.64
test_encodeMethod · 0.64
test_decodeMethod · 0.64
test_readingMethod · 0.64
test_gradientsMethod · 0.64
test_with_beam_searchMethod · 0.64
_test_with_paramsMethod · 0.64
test_pipelineMethod · 0.64