Commit
·
30d0bb7
1
Parent(s):
9a815f6
fix: add missing filler_ratio and update WITHOUT reference scoring ranges
Browse files- Add filler_ratio back to detect_filler_words() return value
- Update WITHOUT reference scoring: 81-100%=5, 61-80%=4, 41-60%=3, 21-40%=2, 0-20%=1
- Show percentage in reason message for clarity
- app/services/articulation.py +16 -13
app/services/articulation.py
CHANGED
|
@@ -384,25 +384,28 @@ class ArticulationService:
|
|
| 384 |
energy_score * weights['energy']
|
| 385 |
)
|
| 386 |
|
| 387 |
-
# Convert to 1-5 scale
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
if score_5 >= 5:
|
| 392 |
category = "Sempurna"
|
| 393 |
-
reason = "Artikulasi sangat jelas dan konsisten"
|
| 394 |
-
elif
|
|
|
|
| 395 |
category = "Baik"
|
| 396 |
-
reason = "Artikulasi jelas dengan tempo stabil"
|
| 397 |
-
elif
|
|
|
|
| 398 |
category = "Cukup"
|
| 399 |
-
reason = "Artikulasi cukup jelas, ada sedikit variasi tempo"
|
| 400 |
-
elif
|
|
|
|
| 401 |
category = "Kurang"
|
| 402 |
-
reason = "Artikulasi kurang jelas, tempo tidak stabil"
|
| 403 |
else:
|
|
|
|
| 404 |
category = "Buruk"
|
| 405 |
-
reason = "Artikulasi tidak jelas dan sulit dipahami"
|
| 406 |
|
| 407 |
print(f"\n📊 Score Breakdown (WITHOUT REFERENCE):")
|
| 408 |
print(f" Clarity: {clarity_score:.1f}% (weight: {weights['clarity']*100:.0f}%)")
|
|
|
|
| 384 |
energy_score * weights['energy']
|
| 385 |
)
|
| 386 |
|
| 387 |
+
# Convert to 1-5 scale based on percentage ranges
|
| 388 |
+
# 81-100% = 5, 61-80% = 4, 41-60% = 3, 21-40% = 2, 0-20% = 1
|
| 389 |
+
if total_score >= 81:
|
| 390 |
+
score_5 = 5
|
|
|
|
| 391 |
category = "Sempurna"
|
| 392 |
+
reason = f"Artikulasi sangat jelas ({total_score:.1f}%) dan konsisten"
|
| 393 |
+
elif total_score >= 61:
|
| 394 |
+
score_5 = 4
|
| 395 |
category = "Baik"
|
| 396 |
+
reason = f"Artikulasi jelas ({total_score:.1f}%) dengan tempo stabil"
|
| 397 |
+
elif total_score >= 41:
|
| 398 |
+
score_5 = 3
|
| 399 |
category = "Cukup"
|
| 400 |
+
reason = f"Artikulasi cukup jelas ({total_score:.1f}%), ada sedikit variasi tempo"
|
| 401 |
+
elif total_score >= 21:
|
| 402 |
+
score_5 = 2
|
| 403 |
category = "Kurang"
|
| 404 |
+
reason = f"Artikulasi kurang jelas ({total_score:.1f}%), tempo tidak stabil"
|
| 405 |
else:
|
| 406 |
+
score_5 = 1
|
| 407 |
category = "Buruk"
|
| 408 |
+
reason = f"Artikulasi tidak jelas ({total_score:.1f}%) dan sulit dipahami"
|
| 409 |
|
| 410 |
print(f"\n📊 Score Breakdown (WITHOUT REFERENCE):")
|
| 411 |
print(f" Clarity: {clarity_score:.1f}% (weight: {weights['clarity']*100:.0f}%)")
|