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

Method __init__

gen_sql.py:70–85  ·  view source on GitHub ↗
(self, logger_name, filter_mode="complex", prompt_mode="v2", n_shots=2,
                 few_shot_mode="masked_ques_sim")

Source from the content-addressed store, hash-verified

68
69class Text2SQL:
70 def __init__(self, logger_name, filter_mode="complex", prompt_mode="v2", n_shots=2,
71 few_shot_mode="masked_ques_sim"):
72 self.model = 'gpt-3.5-turbo'
73 self.ner = NER()
74 self.filter_characters = FilterCharacters()
75 self.sql_type = SqlType.SINGLE_TABLE.value
76 self.table_character_dict = {}
77 self.filter_characters_mode = args.filter_mode
78 self.logger = get_logger(logger_name)
79 self.question_type = QuestionType.EASY.value
80 self.aggregation_type = AggregationType.NON.value
81 self.dataset = ""
82 self.n_shots = args.n_shots
83 self.few_shot_mode = args.few_shot_mode
84 self.sql_prompt_fewshot = SQLPromptFewshot()
85 self.sql_prompt_error = SQLPromptError()
86
87 def get_features_by_llm(self, query, table_info, limitation, metric, main_metric, mode="en"):
88 numbers = len(limitation.split(","))

Callers

nothing calls this directly

Calls 5

NERClass · 0.90
FilterCharactersClass · 0.90
get_loggerFunction · 0.90
SQLPromptFewshotClass · 0.90
SQLPromptErrorClass · 0.90

Tested by

no test coverage detected