test / app.py
Jyotiprakash4357's picture
added app.py and requirements
99617a7
raw
history blame contribute delete
520 Bytes
import streamlit as st
from transformers import pipeline
# Load sentiment analysis model
sentiment_pipeline = pipeline("sentiment-analysis")
st.title("🔍Sentiment Analysis Dashboard")
st.write("Enter text below to analyze its sentiment.")
# Text input box
user_input = st.text_area("Enter text:", "I love Hugging Face!")
if st.button("Analyze Sentiment"):
result = sentiment_pipeline(user_input)[0]
st.write(f"**Sentiment:** {result['label']}")
st.write(f"**Confidence Score:** {result['score']:.2f}")