Commit
·
efac340
1
Parent(s):
6211123
a bit debug
Browse files- ocr_qa_assessment.py +3 -5
ocr_qa_assessment.py
CHANGED
@@ -18,12 +18,10 @@ class QAAssessmentPipeline(Pipeline):
|
|
18 |
return predictions, probabilities
|
19 |
|
20 |
def postprocess(self, outputs, **kwargs):
|
21 |
-
predictions
|
|
|
22 |
label = predictions[0][0].replace("__label__", "") # Remove __label__ prefix
|
23 |
-
confidence = float(
|
24 |
-
probabilities[0][0]
|
25 |
-
) # Convert to float for JSON serialization
|
26 |
|
27 |
# Format as JSON-compatible dictionary
|
28 |
-
model_output = {"label": label, "
|
29 |
return model_output
|
|
|
18 |
return predictions, probabilities
|
19 |
|
20 |
def postprocess(self, outputs, **kwargs):
|
21 |
+
predictions = outputs
|
22 |
+
print(f"Predictions: {predictions}")
|
23 |
label = predictions[0][0].replace("__label__", "") # Remove __label__ prefix
|
|
|
|
|
|
|
24 |
|
25 |
# Format as JSON-compatible dictionary
|
26 |
+
model_output = {"label": label, "score": round(score, 4)}
|
27 |
return model_output
|