Oliver Li commited on
Commit
46d426f
1 Parent(s): 684d14e

added score interval based display for postive results

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -46,7 +46,7 @@ if st.button("Analyze"):
46
  sentiment_pipeline = load_model(selected_model)
47
  result = sentiment_pipeline(text)
48
  st.write(f"Sentiment: {result[0]['label']} (confidence: {result[0]['score']:.2f})")
49
- if result[0]['label'] == 'POSITIVE':
50
  st.balloons()
51
  elif result[0]['label'] in ['NEGATIVE', 'LABEL_0'] and result[0]['score']> 0.9:
52
  st.error("Hater detected.")
 
46
  sentiment_pipeline = load_model(selected_model)
47
  result = sentiment_pipeline(text)
48
  st.write(f"Sentiment: {result[0]['label']} (confidence: {result[0]['score']:.2f})")
49
+ if result[0]['label'] in ['POSITIVE', 'LABEL_1'] and result[0]['score']> 0.9:
50
  st.balloons()
51
  elif result[0]['label'] in ['NEGATIVE', 'LABEL_0'] and result[0]['score']> 0.9:
52
  st.error("Hater detected.")