Spaces:
Build error
Build error
Download app.py from wajidwazir/Sentiment: direct link, hf CLI and curl.
- Browser
- Download file 391 Bytes
-
https://huggingface.co/spaces/wajidwazir/Sentiment/resolve/main/app.py
- Command line
-
hf download hf://spaces/wajidwazir/Sentiment/app.py
-
curl -L -o app.py https://huggingface.co/spaces/wajidwazir/Sentiment/resolve/main/app.py
391 Bytes
| import streamlit as st | |
| from transformers import pipeline | |
| sentiment_task = pipeline("sentiment-analysis") | |
| st.title("Sentiment Analysis App") | |
| userinput=st.text_area("Enter text for analysis") | |
| if userinput: | |
| result=sentiment_task(userinput) | |
| st.write("Sentiment analysis result:") | |
| st.write(f"label]:{ result[0]['label']}]") | |
| st.write(f"confidence]:{ result[0]['score']:,4f}]") | |