Spaces:
Build error
Build error
Download app.py from Ajeet001/Sentiment_Analysis: direct link, hf CLI and curl.
- Browser
- Download file 383 Bytes
-
https://huggingface.co/spaces/Ajeet001/Sentiment_Analysis/resolve/main/app.py
- Command line
-
hf download hf://spaces/Ajeet001/Sentiment_Analysis/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Ajeet001/Sentiment_Analysis/resolve/main/app.py
383 Bytes
| # Filename: sentiment_app.py | |
| import gradio as gr | |
| from transformers import pipeline | |
| classifier = pipeline("sentiment-analysis") | |
| def analyze_sentiment(text): | |
| return classifier(text)[0]['label'] | |
| gr.Interface( | |
| fn=analyze_sentiment, | |
| inputs=gr.Textbox(label="Enter Text"), | |
| outputs=gr.Textbox(label="Sentiment"), | |
| title="📝 Sentiment Analyzer" | |
| ).launch(share=True) | |