mounikaHYC's picture
create app.py
b9a5094
raw
history blame contribute delete
421 Bytes
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