Skip to content

Commit

Permalink
fix sorting table relevance scores (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel309 authored Jun 24, 2024
1 parent 7fcd9e8 commit f3cb505
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ def _run( # noqa: PLR0912
df["similarities"] = df.table_embedding.apply(
lambda x: self.cosine_similarity(x, question_embedding)
)
df = df.sort_values(by="similarities", ascending=True)
df = df.tail(TOP_TABLES)
df = df.sort_values(by="similarities", ascending=False)
df = df.head(TOP_TABLES)
most_similar_tables = self.similar_tables_based_on_few_shot_examples(df)
table_relevance = ""
for _, row in df.iterrows():
Expand Down

0 comments on commit f3cb505

Please sign in to comment.