Spaces:
Sleeping
Sleeping
Download app.py from ahsankh/sentiment_analysis: direct link, hf CLI and curl.
- Browser
- Download file 325 Bytes
-
https://huggingface.co/spaces/ahsankh/sentiment_analysis/resolve/main/app.py
- Command line
-
hf download hf://spaces/ahsankh/sentiment_analysis/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ahsankh/sentiment_analysis/resolve/main/app.py
325 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| sentiment = pipeline("sentiment-analysis") | |
| def get_sentiment(input_text): | |
| return sentiment(input_text) | |
| iface = gr.Interface( | |
| fn = get_sentiment, | |
| inputs = "text", | |
| outputs = ["text"], | |
| description = "get sentiment for the input text" | |
| ) | |
| iface.launch() |