Luciferalive commited on
Commit
d775997
1 Parent(s): 81422e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -12,14 +12,14 @@ def classify_feedback(feedback_text):
12
  result = classifier(feedback_text, labels, multi_label=True)
13
 
14
  # Get the top two labels associated with the feedback
15
- top_labels = [label for label, _ in result["labels"][:2]]
16
- scores = [score for _, score in result["scores"][:2]]
17
 
18
  return {top_labels[i]: scores[i] for i in range(len(top_labels))}
19
 
20
  # Create Gradio interface
21
- feedback_textbox = gr.inputs.Textbox(label="Enter your feedback:")
22
- feedback_output = gr.outputs.Textbox(label="Top 2 Labels with Scores:")
23
 
24
  gr.Interface(
25
  fn=classify_feedback,
 
12
  result = classifier(feedback_text, labels, multi_label=True)
13
 
14
  # Get the top two labels associated with the feedback
15
+ top_labels = result["labels"][:2]
16
+ scores = result["scores"][:2]
17
 
18
  return {top_labels[i]: scores[i] for i in range(len(top_labels))}
19
 
20
  # Create Gradio interface
21
+ feedback_textbox = gr.Textbox(label="Enter your feedback:")
22
+ feedback_output = gr.Textbox(label="Top 2 Labels with Scores:")
23
 
24
  gr.Interface(
25
  fn=classify_feedback,