Anthos23 commited on
Commit
c098053
1 Parent(s): e84e99c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import streamlit as st
2
  from transformers import AutoTokenizer, AutoModelForSequenceClassification, Trainer, TextClassificationPipeline
3
  import operator
4
- import plotly.express as px
5
 
6
  def get_sentiment(out):
7
  d = dict()
@@ -28,7 +28,8 @@ text = st.text_area(f'Ciao! This app uses {model_name}.\nEnter your text to tes
28
  if text:
29
  out = pipe(text)
30
  df = get_sentiment(out[0])
31
- fig = px.pie(df, values='score', names='sentiment')
 
32
 
33
  st.pyplot(fig)
34
 
 
1
  import streamlit as st
2
  from transformers import AutoTokenizer, AutoModelForSequenceClassification, Trainer, TextClassificationPipeline
3
  import operator
4
+ import matplotlib.pyplot as plt
5
 
6
  def get_sentiment(out):
7
  d = dict()
 
28
  if text:
29
  out = pipe(text)
30
  df = get_sentiment(out[0])
31
+ fig, ax = plt.subplots()
32
+ ax.bar(df.index, df[0])
33
 
34
  st.pyplot(fig)
35