Spaces:
Sleeping
Sleeping
Download app.py from Lavanya75/SentimentAnalysis: direct link, hf CLI and curl.
- Browser
- Download file 265 Bytes
-
https://huggingface.co/spaces/Lavanya75/SentimentAnalysis/resolve/main/app.py
- Command line
-
hf download hf://spaces/Lavanya75/SentimentAnalysis/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Lavanya75/SentimentAnalysis/resolve/main/app.py
265 Bytes
| import gradio as gr | |
| from textblob import TextBlob | |
| def sentiment_analysis(text): | |
| p = TextBlob(text).sentiment.polarity | |
| return "Positive" if p > 0 else "Negative" if p < 0 else "Neutral" | |
| gr.Interface(sentiment_analysis,"text", "text").launch(ssr_mode=False) |