langident
custom_code
Simon Clematide commited on
Commit
996ea64
·
1 Parent(s): 3b1ef7b

Fix confidence score rounding in model output for JSON compatibility

Browse files
Files changed (1) hide show
  1. 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 * 100, 2)}
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