Spaces:
Sleeping
Sleeping
File size: 302 Bytes
d0d90ca |
1 2 3 4 5 6 7 8 9 10 |
import gradio as gr
from transformers import pipeline
sentiment_pipeline = pipeline("sentiment-analysis")
def analyze(text):
result = sentiment_pipeline(text)[0]
return f"Label: {result['label']}, Score: {result['score']:.2f}"
gr.Interface(fn=analyze, inputs="text", outputs="text").launch() |