From b2bb6e0bae470bb1d59743e296d2b917b54dd33b Mon Sep 17 00:00:00 2001 From: LucasDedieu Date: Fri, 22 Aug 2025 17:24:39 +0200 Subject: [PATCH] fix: use val_docs instead of val_data in tuning scorer --- edsnlp/tune.py | 6 +++++- tests/tuning/config.yml | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/edsnlp/tune.py b/edsnlp/tune.py index 8b7c03ead..7c6cfdf28 100644 --- a/edsnlp/tune.py +++ b/edsnlp/tune.py @@ -292,7 +292,11 @@ def on_validation_callback(all_metrics): raise scorer = GenericScorer(**kwargs["scorer"]) val_data = kwargs["val_data"] - score = scorer(nlp, val_data) + print(val_data) + # val_docs = list(chain.from_iterable(val_data)) + val_docs = list(val_data) + print(val_docs) + score = scorer(nlp, val_docs) for key in metric: score = score[key] return score diff --git a/tests/tuning/config.yml b/tests/tuning/config.yml index e38655cd4..1c87a02b8 100644 --- a/tests/tuning/config.yml +++ b/tests/tuning/config.yml @@ -113,6 +113,14 @@ val_data: span_setter : 'gold_spans' span_attributes : ['sosy', 'unit', 'negation'] bool_attributes : ['negation'] # default standoff to doc converter + '@readers': standoff + path: tests/training/dataset/ + converter: + - '@factory': eds.standoff_dict2doc + span_setter : 'gold_spans' + span_attributes : ['sosy', 'unit', 'negation'] + bool_attributes : ['negation'] # default standoff to doc converter + # 🚀 TRAIN SCRIPT OPTIONS train: