| import streamlit as st | |
| from transformers import pipeline | |
| # Load the sentiment analysis pipeline | |
| classifier = pipeline("sentiment-analysis") | |
| # Create a title for your app | |
| st.title("Sentiment Analysis App") | |
| # Create a text input box for the user | |
| text = st.text_area("Enter text for vibe check:") | |
| # Analyze the sentiment of the text when the user clicks the button | |
| if st.button("Analyze"): | |
| result = classifier(text) | |
| st.write("Sentiment:", result[0]["label"]) | |
| st.write("Confidence:", result[0]["score"]) |