panotedi commited on
Commit
1ca0686
·
unverified ·
1 Parent(s): 91a1238

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ st.title("CS634 - milestone2")
3
+
4
+ text_input = st.text_input("Enter in a sentence for sentiment analysis" , "")
5
+
6
+ from transformers import pipeline
7
+
8
+ sentiment_model = pipeline("sentiment-analysis")
9
+
10
+ output = sentiment_model(text_input)
11
+
12
+ if text_input != "":
13
+ st.write("The sentiment analysis for '" + text_input+ "' is " + output[0]['label'] + " with a certainty score of " + str(output[0]['score']))