AI / app.py
Ash808's picture
Update app.py
c51307f verified
raw
history blame contribute delete
369 Bytes
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)