Spaces:
Sleeping
Sleeping
nurindahpratiwi
commited on
Commit
·
552acce
1
Parent(s):
3c12279
change some line
Browse files
app.py
CHANGED
@@ -3,19 +3,13 @@ from transformers import pipeline
|
|
3 |
|
4 |
# title
|
5 |
st.title("Sentiment Analysis App")
|
6 |
-
|
7 |
-
# subtitle
|
8 |
-
st.markdown("Enter a text and select a pretrained model to get the sentiment analysis:")
|
9 |
-
|
10 |
-
st.markdown("Link to the app - [sentiment-analysis-streamlit on 🤗 Spaces](https://huggingface.co/spaces/rd448/sentiment-analysis-streamlit)")
|
11 |
|
12 |
# text input
|
13 |
text = st.text_input("Enter text here", "I love you")
|
14 |
|
15 |
-
# Model
|
16 |
-
|
17 |
-
model_names = ["cardiffnlp/twitter-xlm-roberta-base-sentiment-multilingual"]
|
18 |
-
model = st.selectbox("Select a pretrained model", model_names)
|
19 |
|
20 |
# Sentiment analysis function
|
21 |
def analyze_sentiment(text, model):
|
|
|
3 |
|
4 |
# title
|
5 |
st.title("Sentiment Analysis App")
|
6 |
+
st.markdown("You can input 8 different language: arabic, english, french, german, hindi, italian, portuguese, spanish")
|
|
|
|
|
|
|
|
|
7 |
|
8 |
# text input
|
9 |
text = st.text_input("Enter text here", "I love you")
|
10 |
|
11 |
+
# Model initiate
|
12 |
+
model = "cardiffnlp/twitter-xlm-roberta-base-sentiment-multilingual"
|
|
|
|
|
13 |
|
14 |
# Sentiment analysis function
|
15 |
def analyze_sentiment(text, model):
|