hassamniaz7 commited on
Commit
84994e6
·
verified ·
1 Parent(s): 7af97a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -45,11 +45,15 @@ def classify_text(text):
45
 
46
  if len(results) > 0:
47
  # Print the first result
48
- output += f"Label 1: {result['label']}, Score: {result['score']:.4f}\n"
49
 
50
  # Print the second result if it exists
51
  if len(results) > 1:
52
  output += f"Label 2: {results[1]['label']}, Score: {results[1]['score']:.4f}\n"
 
 
 
 
53
 
54
  return output
55
 
 
45
 
46
  if len(results) > 0:
47
  # Print the first result
48
+ output += f"Label 1: {results[0]['label']}, Score: {results[0]['score']:.4f}\n"
49
 
50
  # Print the second result if it exists
51
  if len(results) > 1:
52
  output += f"Label 2: {results[1]['label']}, Score: {results[1]['score']:.4f}\n"
53
+
54
+ # Print the third result if it exists
55
+ if len(results) > 2:
56
+ output += f"Label 3: {results[2]['label']}, Score: {results[2]['score']:.4f}\n"
57
 
58
  return output
59