Download app.py from rishabhpr/test: direct link, hf CLI and curl.
- Browser
- Download file 515 Bytes
-
https://huggingface.co/spaces/rishabhpr/test/resolve/main/app.py
- Command line
-
hf download hf://spaces/rishabhpr/test/app.py
-
curl -L -o app.py https://huggingface.co/spaces/rishabhpr/test/resolve/main/app.py
515 Bytes
| 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"]) |