Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
|
5 |
+
sentiment_pipeline = pipeline("text-classification", model="tabularisai/multilingual-sentiment-analysis")
|
6 |
+
|
7 |
+
|
8 |
+
st.title('Sentiment Analysis App')
|
9 |
+
user_input = st.text_area('Enter text:')
|
10 |
+
|
11 |
+
if user_input:
|
12 |
+
result = sentiment_pipeline(user_input)[0]
|
13 |
+
st.write(f"**Sentiment:** {result['label']}")
|
14 |
+
st.write(f"**Confidence:** {result['score']:.2f}")
|