Simon Clematide
commited on
Commit
·
996ea64
1
Parent(s):
3b1ef7b
Fix confidence score rounding in model output for JSON compatibility
Browse files- langident.py +1 -1
langident.py
CHANGED
@@ -25,5 +25,5 @@ class LangDetectionPipeline(Pipeline):
|
|
25 |
) # Convert to float for JSON serialization
|
26 |
|
27 |
# Format as JSON-compatible dictionary
|
28 |
-
model_output = {"language": label, "score": round(confidence
|
29 |
return model_output
|
|
|
25 |
) # Convert to float for JSON serialization
|
26 |
|
27 |
# Format as JSON-compatible dictionary
|
28 |
+
model_output = {"language": label, "score": round(confidence, 2)}
|
29 |
return model_output
|