Spaces:
Build error
Build error
Update app.py
#1
by
themanas021
- opened
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)):
|