Update app.py
Browse files
app.py
CHANGED
@@ -46,6 +46,7 @@ def classify_text(text):
|
|
46 |
|
47 |
# Loop through up to 3 results
|
48 |
for i, result in enumerate(results[:3]):
|
|
|
49 |
output += f"Label {i+1}: {result['label']}, Score: {result['score']:.4f}\n"
|
50 |
|
51 |
return output
|
|
|
46 |
|
47 |
# Loop through up to 3 results
|
48 |
for i, result in enumerate(results[:3]):
|
49 |
+
# Each result should be a dictionary, so access it with ['label'] and ['score']
|
50 |
output += f"Label {i+1}: {result['label']}, Score: {result['score']:.4f}\n"
|
51 |
|
52 |
return output
|