Spaces:
Runtime error
Runtime error
matthewwang16czap
commited on
Commit
•
a6943e2
1
Parent(s):
1f8c5d1
fix bugs
Browse files
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 |
-
|
|
|
7 |
text = st.text_input("text for sentiment analysis", value="I love you")
|
8 |
-
|
|
|
|
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)
|