Commit
·
fcf5471
1
Parent(s):
08accd4
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
if st.button("Analyze"):
|
| 11 |
+
result = sentiment_pipeline(user_input)
|
| 12 |
+
st.write("Sentiment", result[0]['label'])
|
| 13 |
+
st.write("Confident Score ", result[0]['score'])
|
| 14 |
+
|