avimittal30 commited on
Commit
aeec8d2
1 Parent(s): 71c5dd0

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+
4
+ st.title("Sentiment Bot")
5
+
6
+ Sentiment_pipeline=pipeline("sentiment-analysis")
7
+
8
+ user_input=st.text_area("Enter the review")
9
+
10
+ user_input="I absolutely loved the new movie, it had me on the edge of my seat the whole time!"
11
+ if st.button("Analyse:"):
12
+ result=Sentiment_pipeline(user_input)
13
+ # print(result[0]['label'])
14
+ # print(result[0]['score'])
15
+ st.write("Sentiment", result[0]['label'])
16
+ st.write("Confidence Score", result[0]['score'])