Spaces:
Sleeping
Sleeping
File size: 539 Bytes
95ef49a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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']) |