matthewwang16czap commited on
Commit
be54301
1 Parent(s): 22d679b
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -4,7 +4,9 @@ import pandas as pd
4
 
5
  model_list = ["distilbert-base-uncased-finetuned-sst-2-english", "cardiffnlp/twitter-roberta-base-sentiment", "finiteautomata/bertweet-base-sentiment-analysis"]
6
  model_name = st.selectbox('Which model to predict?', model_list)
7
- sentiment_pipeline = pipeline(model=model_name)
8
  text = st.text_input("text for sentiment analysis", value="I love you")
9
- result = sentiment_pipeline(text)
10
- st.write(result)
 
 
 
 
4
 
5
  model_list = ["distilbert-base-uncased-finetuned-sst-2-english", "cardiffnlp/twitter-roberta-base-sentiment", "finiteautomata/bertweet-base-sentiment-analysis"]
6
  model_name = st.selectbox('Which model to predict?', model_list)
 
7
  text = st.text_input("text for sentiment analysis", value="I love you")
8
+
9
+ if st.button('Run'):
10
+ sentiment_pipeline = pipeline(model=model_name)
11
+ result = sentiment_pipeline(text)
12
+ st.write(result)