Spaces:
Sleeping
Sleeping
Update gradio_interface.py
Browse files- gradio_interface.py +11 -8
gradio_interface.py
CHANGED
@@ -40,16 +40,19 @@ def evaluate_text(input_text):
|
|
40 |
# Additional classification report
|
41 |
report = classification_report(ground_truth_labels_list, predicted_labels_list)
|
42 |
|
43 |
-
# Construct output
|
44 |
-
|
45 |
-
"
|
46 |
-
"
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
50 |
}
|
51 |
|
52 |
-
return
|
53 |
|
54 |
# Gradio Interface
|
55 |
iface = gr.Interface(fn=evaluate_text, inputs="text", outputs="json", title="Text Evaluation", description="Enter your text")
|
|
|
40 |
# Additional classification report
|
41 |
report = classification_report(ground_truth_labels_list, predicted_labels_list)
|
42 |
|
43 |
+
# Construct output dictionary
|
44 |
+
output_dict = {
|
45 |
+
"PredictedLabels": predicted_labels,
|
46 |
+
"EvaluationMetrics": {
|
47 |
+
"Accuracy": accuracy,
|
48 |
+
"Precision": precision,
|
49 |
+
"Recall": recall,
|
50 |
+
"F1-Score": f1,
|
51 |
+
"ClassificationReport": report
|
52 |
+
}
|
53 |
}
|
54 |
|
55 |
+
return output_dict
|
56 |
|
57 |
# Gradio Interface
|
58 |
iface = gr.Interface(fn=evaluate_text, inputs="text", outputs="json", title="Text Evaluation", description="Enter your text")
|