Spaces:
Runtime error
Runtime error
panotedi
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,14 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
st.title("CS634 - milestone2 - Tedi Pano")
|
| 3 |
-
|
| 4 |
-
text_input = st.text_input("Enter in a sentence for sentiment analysis" , "I love you so much it hurts sometimes")
|
| 5 |
-
|
| 6 |
from transformers import pipeline
|
|
|
|
| 7 |
|
| 8 |
sentiment_model = pipeline("sentiment-analysis")
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
from transformers import pipeline
|
| 3 |
+
st.title("CS634 - milestone2 - Tedi Pano")
|
| 4 |
|
| 5 |
sentiment_model = pipeline("sentiment-analysis")
|
| 6 |
|
| 7 |
+
with st.form("my_form"):
|
| 8 |
+
text_input = st.text_input("Enter in a sentence for sentiment analysis" , "i love you")
|
| 9 |
+
submitted = st.form_submit_button("Submit")
|
| 10 |
|
| 11 |
+
|
| 12 |
+
if submitted:
|
| 13 |
+
output = sentiment_model(text_input)
|
| 14 |
+
st.write("The sentiment analysis for '" + text_input+ "' is " + output[0]['label'] + " with a certainty score of " + str(output[0]['score']))
|