File size: 535 Bytes
1ca0686
 
3112e6e
1ca0686
 
 
3112e6e
 
 
1ca0686
3112e6e
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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']))