Spaces:
Build error
Build error
File size: 473 Bytes
4482830 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import streamlit as st
from transformers import pipeline
st.title("Sentiment Analysis App")
# Load sentiment analysis model from Hugging Face
sentiment_analyzer = pipeline("sentiment-analysis")
# User input
sample = st.text_area("Enter a sentence for sentiment analysis:")
# Predict and display result
if st.button("Predict"):
prediction = sentiment_analyzer(sample)[0]
st.success(f"Sentiment: {prediction['label']} with confidence: {prediction['score']:.2f}")
|