From 7b78da66bff3c45154eef9ef056017340211953e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maik=20Fr=C3=B6be?= Date: Wed, 13 Nov 2024 13:32:12 +0100 Subject: [PATCH] allow that label column is missing --- cli/__main__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/__main__.py b/cli/__main__.py index 508c674..7b59284 100644 --- a/cli/__main__.py +++ b/cli/__main__.py @@ -479,7 +479,9 @@ def prepare_relevance_judgments( ) # TODO: Instead update existing data and migrate annotations? - group_pool = pool[pool["group"] == group] + group_pool = pool[pool["group"] == group].copy() + if 'label' not in group_pool.columns: + group_pool['label'] = group_pool['query'].map(lambda i: []) echo( f"Uploading {len(group_pool)} documents to project '{project.name}'...") with NamedTemporaryFile() as tmp_file: