Spaces:
Sleeping
Sleeping
Create app.py
Browse files
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'])
|