Skip to content

Commit

Permalink
Fix gold_contexts_similarity for table retrieval evaluation (#2815)
Browse files Browse the repository at this point in the history
* fix gold_contexts_similarity for table documents

* check for type of gold_context
  • Loading branch information
tstadel authored Jul 14, 2022
1 parent 82df677 commit e6d8bcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions haystack/pipelines/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1453,8 +1453,8 @@ def _build_eval_dataframe(
df_docs["gold_contexts_similarity"] = df_docs.map_rows(
lambda row: [
calculate_context_similarity(
gold_context,
row["context"] or "",
str(gold_context) if isinstance(gold_context, pd.DataFrame) else gold_context,
str(row["context"]) if isinstance(row["context"], pd.DataFrame) else row["context"] or "",
min_length=context_matching_min_length,
boost_split_overlaps=context_matching_boost_split_overlaps,
)
Expand Down

0 comments on commit e6d8bcd

Please sign in to comment.