diff --git a/src/unitxt/metrics.py b/src/unitxt/metrics.py index bf4448fc6..b8910d3e7 100644 --- a/src/unitxt/metrics.py +++ b/src/unitxt/metrics.py @@ -4741,7 +4741,7 @@ class F1Strings(InstanceMetric): main_score = "f1_strings" reduction_map = {"mean": ["f1_strings"]} prediction_type = str - single_reference_per_prediction = True + single_reference_per_prediction = False _requirements_list = { "spacy": "Please pip install spacy", } @@ -4764,7 +4764,7 @@ def compute( prediction: str, task_data: List[Dict], ) -> dict: - doc_ref = self.nlp(references[0]) + doc_ref = self.nlp(" ".join(references)) set_ref = Counter([token.text.lower() for token in doc_ref]) doc_pred = self.nlp(prediction) set_pred = Counter([token.text.lower() for token in doc_pred])