MANMEET75 commited on
Commit
666102f
·
verified ·
1 Parent(s): c6deb3c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
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}")