Naruto9's picture
Update app.py
7f90657 verified
raw
history blame
343 Bytes
import streamlit as st
from transformers import pipeline
# Initialize the sentiment analysis pipeline
pipe = pipeline('sentiment-analysis')
# Create a text input area in the Streamlit app
text = st.text_area('Enter some text!')
# Process the text and display the results if there's input
if text:
out = pipe(text)
st.json(out)