CoolFace
Apppublic

decodingdatascience/test12

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes
app.py19 linesDownload Raw Back to root
1import streamlit as st2from transformers import pipeline3 4# Title of the app5st.title("DDS Sentiment Analysis with Transformers")6 7# Sentiment analysis pipeline8sentiment_pipeline = pipeline("sentiment-analysis")9 10# User input text area11user_input = st.text_area("Enter Text", "Type your text here...")12 13# Analyze button14if st.button("Analyze"):15    # Perform sentiment analysis16    result = sentiment_pipeline(user_input)17    # Display results18    st.write("Sentiment:", result[0]['label'])19    st.write("Confidence:", result[0]['score'])