Spaces:
Sleeping
Sleeping
Commit
•
e115552
1
Parent(s):
e820560
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
model_path = "citizenlab/twitter-xlm-roberta-base-sentiment-
|
5 |
|
6 |
st.set_page_config(page_title="Sentiment Analysis App")
|
7 |
|
|
|
8 |
sentiment_classifier = pipeline("text-classification", model=model_path, tokenizer=model_path)
|
9 |
|
10 |
st.title("Sentiment Analysis App")
|
@@ -19,4 +20,8 @@ if st.button("Analyze Sentiment"):
|
|
19 |
sentiment_score = results[0]["score"]
|
20 |
|
21 |
st.write(f"Sentiment: {sentiment_label}")
|
22 |
-
st.write(f"Confidence Score: {sentiment_score:.2f}")
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
model_path = "citizenlab/twitter-xlm-roberta-base-sentiment-finetunned"
|
5 |
|
6 |
st.set_page_config(page_title="Sentiment Analysis App")
|
7 |
|
8 |
+
|
9 |
sentiment_classifier = pipeline("text-classification", model=model_path, tokenizer=model_path)
|
10 |
|
11 |
st.title("Sentiment Analysis App")
|
|
|
20 |
sentiment_score = results[0]["score"]
|
21 |
|
22 |
st.write(f"Sentiment: {sentiment_label}")
|
23 |
+
st.write(f"Confidence Score: {sentiment_score:.2f}")
|
24 |
+
|
25 |
+
# Run the Streamlit app
|
26 |
+
if _name_ == "_main_":
|
27 |
+
st.write("Enter a message and click 'Analyze Sentiment' to classify its sentiment.")
|