Task 1: LLM_CONFIDENCE_THRESHOLD-Zweig entfernt und durch einfaches Return des Embedding-Ergebnisses ersetzt
This commit is contained in:
@@ -496,30 +496,7 @@ class MessageClassifier:
|
||||
if best_score < 0:
|
||||
return None
|
||||
|
||||
# Prüfe, ob die Embedding-Konfidenz ausreicht
|
||||
if best_score >= LLM_CONFIDENCE_THRESHOLD:
|
||||
return ClassificationResult(
|
||||
category=best_category,
|
||||
confidence=best_score,
|
||||
all_scores=scores,
|
||||
latency_ms=latency_ms,
|
||||
fallback=False,
|
||||
)
|
||||
|
||||
# Stufe 2: LLM-Klassifikation, wenn Konfidenz niedrig ist
|
||||
if self._llm_enabled and best_score < LLM_CONFIDENCE_THRESHOLD and self._llm_client:
|
||||
llm_category = self._llm_classify_sync(text)
|
||||
if llm_category:
|
||||
latency_ms = (time.monotonic() - t0) * 1000.0
|
||||
return ClassificationResult(
|
||||
category=llm_category,
|
||||
confidence=0.95, # Hohe Konfidenz für LLM-Klassifikation
|
||||
all_scores=scores,
|
||||
latency_ms=latency_ms,
|
||||
fallback=False,
|
||||
)
|
||||
|
||||
# Ansonsten: originales Embedding-Ergebnis zurückgeben (auch wenn unter Schwellwert)
|
||||
# Direktes Return des Embedding-Ergebnisses
|
||||
return ClassificationResult(
|
||||
category=best_category,
|
||||
confidence=best_score,
|
||||
|
||||
Reference in New Issue
Block a user