ManjinderUNCC commited on
Commit
184e4e0
·
verified ·
1 Parent(s): 016df4b

Update gradio_interface.py

Browse files
Files changed (1) hide show
  1. 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
- evaluation_results = {
45
- "Accuracy": accuracy,
46
- "Precision": precision,
47
- "Recall": recall,
48
- "F1-Score": f1,
49
- "Classification Report": report
 
 
 
50
  }
51
 
52
- return evaluation_results
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")