File size: 421 Bytes
b9a5094
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import streamlit as st
from transformers import pipeline

# Create a sentiment analysis pipeline
pipe = pipeline('sentiment-analysis')

# Streamlit UI code
st.title("Sentiment Analysis App")
text = st.text_area('Enter some text:', '')  # Provide an initial value for the text_area

if text:
    out = pipe(text)
    st.subheader("Sentiment Analysis Result:")
    st.json(out)  # Display sentiment analysis result as JSON