Gregoryjr commited on
Commit
be6580d
·
unverified ·
1 Parent(s): 21e7801

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -14,11 +14,11 @@ if con:
14
  res = classifier(text, candidate_labels=["offensive"])
15
  label = res['labels'][0]
16
  score = res['scores'][0]
17
- st.write(f"Prediction: {label}, Score: {score:.2f}")
18
 
19
  if model == "cardiffnlp/twitter-roberta-base-offensive":
20
  classifier = pipeline('text-classification', model='cardiffnlp/twitter-roberta-base-offensive', tokenizer='cardiffnlp/twitter-roberta-base-offensive')
21
  result = classifier(text)
22
  label = result[0]['label']
23
  score = result[0]['score']
24
- st.write(f"Prediction: {label}, Score: {score:.2f}")
 
14
  res = classifier(text, candidate_labels=["offensive"])
15
  label = res['labels'][0]
16
  score = res['scores'][0]
17
+ st.write(f"Prediction: {label}, Score: {score*100}% chance")
18
 
19
  if model == "cardiffnlp/twitter-roberta-base-offensive":
20
  classifier = pipeline('text-classification', model='cardiffnlp/twitter-roberta-base-offensive', tokenizer='cardiffnlp/twitter-roberta-base-offensive')
21
  result = classifier(text)
22
  label = result[0]['label']
23
  score = result[0]['score']
24
+ st.write(f"Prediction: {label}, Score: {score*100}% chance")