Spaces:
Runtime error
Runtime error
import streamlit as st | |
st.title("CS634 - milestone2 - Tedi Pano") | |
text_input = st.text_input("Enter in a sentence for sentiment analysis" , "I love you so much it hurts sometimes") | |
from transformers import pipeline | |
sentiment_model = pipeline("sentiment-analysis") | |
output = sentiment_model(text_input) | |
if text_input != "": | |
st.write("The sentiment analysis for '" + text_input+ "' is " + output[0]['label'] + " with a certainty score of " + str(output[0]['score'])) | |