From f0202b64ac8ac7286a629eccd73d9a3a8f478e05 Mon Sep 17 00:00:00 2001
From: Maximilian Kimmich <maximilian.kimmich@ims.uni-stuttgart.de>
Date: Fri, 4 Oct 2024 20:38:42 +0200
Subject: [PATCH] Fix text classification tasks not returning first found match

---
 evoprompt/task/text_classification.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/evoprompt/task/text_classification.py b/evoprompt/task/text_classification.py
index af30f15..be67da9 100644
--- a/evoprompt/task/text_classification.py
+++ b/evoprompt/task/text_classification.py
@@ -38,7 +38,7 @@ class TextClassification(Task):
                     flags=re.IGNORECASE,
                 )
                 if matches:
-                    return matches[-1]
+                    return matches[0]
                 else:
                     return response
 
-- 
GitLab