Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,11 @@ pipe = pipeline("sentiment-analysis", model="rickxzo/review-sentiment-analysis",
|
|
| 8 |
st.title("Sentiment Analysis with Transformer Model")
|
| 9 |
text = st.text_area("Enter some text:")
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
# Perform sentiment analysis when text is provided
|
| 12 |
if text:
|
| 13 |
out = pipe(text)
|
| 14 |
-
st.json(out[0])
|
|
|
|
| 8 |
st.title("Sentiment Analysis with Transformer Model")
|
| 9 |
text = st.text_area("Enter some text:")
|
| 10 |
|
| 11 |
+
sentiment={
|
| 12 |
+
"LABEL_2":"Positive",
|
| 13 |
+
"LABEL_1":"Negative",
|
| 14 |
+
}
|
| 15 |
# Perform sentiment analysis when text is provided
|
| 16 |
if text:
|
| 17 |
out = pipe(text)
|
| 18 |
+
st.json(sentiment[out[0]["label"]])
|