Download app.py from Ash808/AI: direct link, hf CLI and curl.
- Browser
- Download file 369 Bytes
-
https://huggingface.co/spaces/Ash808/AI/resolve/main/app.py
- Command line
-
hf download hf://spaces/Ash808/AI/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Ash808/AI/resolve/main/app.py
369 Bytes
| import streamlit as st | |
| from transformers import pipeline | |
| # Initialize the sentiment analysis pipeline | |
| pipe = pipeline('sentiment-analysis') | |
| # Create a text area in the Streamlit app for user input | |
| text = st.text_area('Enter some Text') | |
| # If the user has entered text, perform sentiment analysis and display the results | |
| if text: | |
| out = pipe(text) | |
| st.json(out) | |