From 842a9dc0ea7a493b78358cdc8f69c2d229fdcd14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20Almeida?= Date: Wed, 19 Jun 2024 23:48:52 +0100 Subject: [PATCH] change stategy "BOTH" to "CONSENSUS_WITH_THRESHOLD" --- extract_thinker/process.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extract_thinker/process.py b/extract_thinker/process.py index 9f9588f..37a7457 100644 --- a/extract_thinker/process.py +++ b/extract_thinker/process.py @@ -17,7 +17,7 @@ class ClassificationStrategy(Enum): CONSENSUS = "consensus" HIGHER_ORDER = "higher_order" - BOTH = "both" + CONSENSUS_WITH_THRESHOLD = "both" class Process: @@ -73,7 +73,7 @@ async def classify_async(self, file: str, classifications, strategy: Classificat elif strategy == ClassificationStrategy.HIGHER_ORDER: # Pick the result with the highest confidence return max(group_classifications, key=lambda c: c.confidence) - elif strategy == ClassificationStrategy.BOTH: + elif strategy == ClassificationStrategy.CONSENSUS_WITH_THRESHOLD: if len(set(group_classifications)) == 1: maxResult = max(group_classifications, key=lambda c: c.confidence) if maxResult.confidence >= threshold: