Anisha0401's picture
app.py
0ff342f verified
raw
history blame
511 Bytes
from transformers import pipeline
import gradio as gr
# Load the sentiment-analysis pipeline
sentiment_pipeline = pipeline("tabularisai/multilingual-sentiment-analysis")
def analyze_sentiment(text):
result = sentiment_pipeline(text)
return result[0]
# Create a Gradio interface
iface = gr.Interface(
fn=analyze_sentiment,
inputs="text",
outputs="text",
title="Sentiment Analysis",
description="Enter some text to analyze its sentiment."
)
# Launch the interface
iface.launch()