Spaces:
Running
Running
Download app.py from SamiAlghamdi/FirstEver: direct link, hf CLI and curl.
- Browser
- Download file 396 Bytes
-
https://huggingface.co/spaces/SamiAlghamdi/FirstEver/resolve/main/app.py
- Command line
-
hf download hf://spaces/SamiAlghamdi/FirstEver/app.py
-
curl -L -o app.py https://huggingface.co/spaces/SamiAlghamdi/FirstEver/resolve/main/app.py
396 Bytes
| import pandas as pd | |
| from transformers import pipeline | |
| import gradio as gr | |
| # Initialize sentiment analysis pipeline | |
| sentiment_pipeline = pipeline('sentiment-analysis') | |
| def analyze_text(text): | |
| sentiment = sentiment_pipeline(text)[0] | |
| return sentiment['label'] | |
| iface = gr.Interface(fn=analyze_text, inputs=gr.inputs.Textbox(lines=13, label="Enter Text"), outputs="text") | |
| iface.launch() | |