Spaces:
Sleeping
Sleeping
File size: 390 Bytes
bc98f3f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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() |