Spaces:
Sleeping
Sleeping
import streamlit as st | |
from transformers import pipeline | |
# Title of the app | |
st.title("DDS Sentiment Analysis with Transformers") | |
# Sentiment analysis pipeline | |
sentiment_pipeline = pipeline("sentiment-analysis") | |
# User input text area | |
user_input = st.text_area("Enter Text", "Type your text here...") | |
# Analyze button | |
if st.button("Analyze"): | |
# Perform sentiment analysis | |
result = sentiment_pipeline(user_input) | |
# Display results | |
st.write("Sentiment:", result[0]['label']) | |
st.write("Confidence:", result[0]['score']) |