File size: 473 Bytes
1ca0686
5a5e9c5
1ca0686
0bea0ea
1ca0686
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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']))