Spaces:
Sleeping
Sleeping
push: fixed the output
Browse files
features/nepali_text_classifier/controller.py
CHANGED
|
@@ -33,11 +33,9 @@ def _raw_ai_score(label: str, confidence: float) -> float:
|
|
| 33 |
conf = _clamp(float(confidence), 0.0, 100.0)
|
| 34 |
return conf if label == "AI" else (100.0 - conf)
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
# Equation: beta = min(0.80, 0.40 + 0.40 * (C_doc / 100))
|
| 40 |
-
return min(0.80, 0.40 + 0.40 * (_clamp(overall_confidence, 0.0, 100.0) / 100.0))
|
| 41 |
|
| 42 |
|
| 43 |
def _deterministic_jitter(seed_text: str, max_jitter: float = 3.0) -> float:
|
|
|
|
| 33 |
conf = _clamp(float(confidence), 0.0, 100.0)
|
| 34 |
return conf if label == "AI" else (100.0 - conf)
|
| 35 |
|
| 36 |
+
def _sentence_bias_strength(overall_confidence: float) -> float:
|
| 37 |
+
# Equation: beta = min(0.15, 0.05 + 0.10 * (C_doc / 100))
|
| 38 |
+
return min(0.15, 0.05 + 0.10 * (_clamp(overall_confidence, 0.0, 100.0) / 100.0))
|
|
|
|
|
|
|
| 39 |
|
| 40 |
|
| 41 |
def _deterministic_jitter(seed_text: str, max_jitter: float = 3.0) -> float:
|