Spaces:
Sleeping
Sleeping
Download app.py from mounikaHYC/TestMyFirstSpace: direct link, hf CLI and curl.
- Browser
- Download file 421 Bytes
-
https://huggingface.co/spaces/mounikaHYC/TestMyFirstSpace/resolve/main/app.py
- Command line
-
hf download hf://spaces/mounikaHYC/TestMyFirstSpace/app.py
-
curl -L -o app.py https://huggingface.co/spaces/mounikaHYC/TestMyFirstSpace/resolve/main/app.py
421 Bytes
| import streamlit as st | |
| from transformers import pipeline | |
| # Create a sentiment analysis pipeline | |
| pipe = pipeline('sentiment-analysis') | |
| # Streamlit UI code | |
| st.title("Sentiment Analysis App") | |
| text = st.text_area('Enter some text:', '') # Provide an initial value for the text_area | |
| if text: | |
| out = pipe(text) | |
| st.subheader("Sentiment Analysis Result:") | |
| st.json(out) # Display sentiment analysis result as JSON | |