Skip to content

Commit

Permalink
change stategy "BOTH" to "CONSENSUS_WITH_THRESHOLD"
Browse files Browse the repository at this point in the history
  • Loading branch information
enoch3712 committed Jun 19, 2024
1 parent 508e7e3 commit 842a9dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extract_thinker/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class ClassificationStrategy(Enum):
CONSENSUS = "consensus"
HIGHER_ORDER = "higher_order"
BOTH = "both"
CONSENSUS_WITH_THRESHOLD = "both"


class Process:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 842a9dc

Please sign in to comment.