milestone3 / app.py
panotedi
Update app.py
3112e6e unverified
raw
history blame
535 Bytes
import streamlit as st
from transformers import pipeline
st.title("CS634 - milestone2 - Tedi Pano")
sentiment_model = pipeline("sentiment-analysis")
with st.form("my_form"):
text_input = st.text_input("Enter in a sentence for sentiment analysis" , "i love you")
submitted = st.form_submit_button("Submit")
if submitted:
output = sentiment_model(text_input)
st.write("The sentiment analysis for '" + text_input+ "' is " + output[0]['label'] + " with a certainty score of " + str(output[0]['score']))