Spaces:
Sleeping
Sleeping
| from transformers import pipeline | |
| sentiment = pipeline("sentiment-analysis") | |
| import gradio as gr | |
| def analyze(text): | |
| return sentiment(text)[0]['label'] | |
| demo = gr.Interface( | |
| fn=analyze, | |
| inputs="text", | |
| outputs="label", | |
| title="Sentiment Analysis", | |
| description="Enter text to analyze its sentiment (positive/negative)" | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch() |