King-8 commited on
Commit
cba3001
·
verified ·
1 Parent(s): 910d1bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -30,15 +30,21 @@ def classify_confidence(text):
30
  label = id2label[predicted_class]
31
  prediction = label_map[label]
32
  score = round(probs[0][predicted_class].item() * 100, 2)
 
33
 
34
- return f"{prediction} ({score}%)"
35
 
36
  iface = gr.Interface(
37
  fn=classify_confidence,
38
  inputs=gr.Textbox(lines=3, placeholder="Enter a statement..."),
39
  outputs="text",
40
- title="Confidence Classifier",
41
- description="Enter a statement and the model will classify it as 'confident' or 'not confident'.",
 
 
 
 
 
42
  )
43
 
44
  iface.launch()
 
30
  label = id2label[predicted_class]
31
  prediction = label_map[label]
32
  score = round(probs[0][predicted_class].item() * 100, 2)
33
+ color = "green" if label == "LABEL_0" else "red"
34
 
35
+ return f"<b>Prediction:</b> <span style='color: {color}; font-weight: bold'>{label_text}</span> ({score}%)"
36
 
37
  iface = gr.Interface(
38
  fn=classify_confidence,
39
  inputs=gr.Textbox(lines=3, placeholder="Enter a statement..."),
40
  outputs="text",
41
+ title="🌟 Confidence Classifier",
42
+ description="""
43
+ Enter a statement, and this model will predict whether it shows confidence or not.
44
+
45
+ 🔍 <i>Built using a fine-tuned DistilBERT model</i>
46
+ 💡 <i>Great for journaling, speech prep, or daily reflections</i>
47
+ """,
48
  )
49
 
50
  iface.launch()