Luciferalive themanas021 commited on
Commit
1fbc1a9
1 Parent(s): 25ba03e

Update app.py (#1)

Browse files

- Update app.py (f667cbe22d8b498c9a8c8860b04f08de9465b1a2)


Co-authored-by: Manas Chopra <themanas021@users.noreply.huggingface.co>

Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -15,6 +15,10 @@ def classify_feedback(feedback_text):
15
  top_labels = result["labels"][:2]
16
  scores = result["scores"][:2]
17
 
 
 
 
 
18
  # Generate HTML content for displaying the scores as meters/progress bars
19
  html_content = ""
20
  for i in range(len(top_labels)):
 
15
  top_labels = result["labels"][:2]
16
  scores = result["scores"][:2]
17
 
18
+ # Check if the accuracy of the top label is less than 30%
19
+ if scores[0] < 0.5:
20
+ return "Please provide another relevant feedback."
21
+
22
  # Generate HTML content for displaying the scores as meters/progress bars
23
  html_content = ""
24
  for i in range(len(top_labels)):