matthewwang16czap commited on
Commit
a6943e2
1 Parent(s): 1f8c5d1
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -3,6 +3,8 @@ from transformers import pipeline
3
  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
- sentiment_pipeline = st.selectbox('Which model to predict?', model_list)
 
7
  text = st.text_input("text for sentiment analysis", value="I love you")
8
- st.write(sentiment_pipeline([text]))
 
 
3
  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)