AWS / app.py
Suhani0409's picture
create.py
c09799d verified
Raw History Blame Contribute Delete
414 Bytes
import gradio as gr
from transformers import pipeline
# Load sentiment model
classifier = pipeline("sentiment-analysis")
def analyze_sentiment(text):
result = classifier(text)
return result[0]
interface = gr.Interface(
fn=analyze_sentiment,
inputs="text",
outputs="label",
title="Sentiment Analysis App",
description="Analyze sentiment using Hugging Face model"
)
interface.launch()