myspace / app.py
aishitdharwal's picture
add files
ee68503
raw
history blame contribute delete
390 Bytes
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()