From 66688d1349917cfe1e460dca6c6e667a81d855b4 Mon Sep 17 00:00:00 2001 From: Rafael Padilla <31217453+rafaelpadilla@users.noreply.github.com> Date: Thu, 25 Apr 2024 09:35:40 -0300 Subject: [PATCH] fixing typo in function name similart_tables_based_on_few_shot_examples -> similar_tables_based_on_few_shot_examples (#473) --- dataherald/sql_generator/dataherald_finetuning_agent.py | 4 ++-- dataherald/sql_generator/dataherald_sqlagent.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dataherald/sql_generator/dataherald_finetuning_agent.py b/dataherald/sql_generator/dataherald_finetuning_agent.py index 5fe0ed4d..bbcbd97d 100644 --- a/dataherald/sql_generator/dataherald_finetuning_agent.py +++ b/dataherald/sql_generator/dataherald_finetuning_agent.py @@ -182,7 +182,7 @@ def get_docs_embedding( def cosine_similarity(self, a: List[float], b: List[float]) -> float: return round(np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b)), 4) - def similart_tables_based_on_few_shot_examples(self, df: pd.DataFrame) -> List[str]: + def similar_tables_based_on_few_shot_examples(self, df: pd.DataFrame) -> List[str]: most_similar_tables = set() if self.few_shot_examples is not None: for example in self.few_shot_examples: @@ -224,7 +224,7 @@ def _run( ) df = df.sort_values(by="similarities", ascending=True) df = df.tail(TOP_TABLES) - most_similar_tables = self.similart_tables_based_on_few_shot_examples(df) + most_similar_tables = self.similar_tables_based_on_few_shot_examples(df) table_relevance = "" for _, row in df.iterrows(): table_relevance += f'Table: `{row["table_name"]}`, relevance score: {row["similarities"]}\n' diff --git a/dataherald/sql_generator/dataherald_sqlagent.py b/dataherald/sql_generator/dataherald_sqlagent.py index 899e6e87..cc9ab1a2 100644 --- a/dataherald/sql_generator/dataherald_sqlagent.py +++ b/dataherald/sql_generator/dataherald_sqlagent.py @@ -246,7 +246,7 @@ def get_docs_embedding( def cosine_similarity(self, a: List[float], b: List[float]) -> float: return round(np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b)), 4) - def similart_tables_based_on_few_shot_examples(self, df: pd.DataFrame) -> List[str]: + def similar_tables_based_on_few_shot_examples(self, df: pd.DataFrame) -> List[str]: most_similar_tables = set() if self.few_shot_examples is not None: for example in self.few_shot_examples: @@ -288,7 +288,7 @@ def _run( ) df = df.sort_values(by="similarities", ascending=True) df = df.tail(TOP_TABLES) - most_similar_tables = self.similart_tables_based_on_few_shot_examples(df) + most_similar_tables = self.similar_tables_based_on_few_shot_examples(df) table_relevance = "" for _, row in df.iterrows(): table_relevance += f'Table: `{row["table_name"]}`, relevance score: {row["similarities"]}\n'