Spaces:
Runtime error
Runtime error
panotedi
commited on
Create app.py
Browse files
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']))
|