Commit
·
e2538ff
1
Parent(s):
71e37d2
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
st.title("AI Community 9th Dec Workshop Bot")
|
5 |
+
sentiment_analysis = pipeline("sentiment-analysis")
|
6 |
+
#user input
|
7 |
+
user_input = st.text_area("Enter the comment to analyze")
|
8 |
+
#analysis button
|
9 |
+
if st.button("Analyze"):
|
10 |
+
result = sentiment_analysis(user_input)
|
11 |
+
st.write("Sentiment", result[0]['label'])
|
12 |
+
st.write("Score", result[0]['score'])
|