Skip to content

Commit

Permalink
fixing typo in function name similart_tables_based_on_few_shot_exampl…
Browse files Browse the repository at this point in the history
…es -> similar_tables_based_on_few_shot_examples (#473)
  • Loading branch information
rafaelpadilla authored Apr 25, 2024
1 parent 6a3df95 commit 66688d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dataherald/sql_generator/dataherald_finetuning_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions dataherald/sql_generator/dataherald_sqlagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 66688d1

Please sign in to comment.