sergiopaniego HF Staff commited on
Commit
88bc194
·
verified ·
1 Parent(s): 4f1aff0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -5,9 +5,9 @@ classifier = pipeline("text-classification", model="sergiopaniego/modernbert-ban
5
 
6
  def get_text_classification(text_input):
7
  prediction = classifier(text_input)
8
- for i in range(len(prediction['labels'])):
9
- output[prediction['labels'][i]] = prediction['scores'][i]
10
- return output
11
 
12
  examples = [["When did you send me my new card?"]]
13
 
 
5
 
6
  def get_text_classification(text_input):
7
  prediction = classifier(text_input)
8
+ formatted_text = f"{prediction[0]['label']}: {prediction[0]['score']}"
9
+
10
+ return formatted_text
11
 
12
  examples = [["When did you send me my new card?"]]
13