import streamlit as st from transformers import pipeline # Initialize the sentiment analysis pipeline pipe = pipeline('sentiment-analysis') # Create a text area in the Streamlit app for user input text = st.text_area('Enter some Text') # If the user has entered text, perform sentiment analysis and display the results if text: out = pipe(text) st.json(out)