Paraj01's picture
Create app.py
3cc2bda verified
raw
history blame
499 Bytes
from transformers import pipeline
import gradio as gr
classifier = pipeline("sentiment-analysis")
def classify_text(text):
result=classifier(text)
label=result[0]['label']
score = result[0]['score']
return f"{label} with score {score}"
interface = gr.Interface(
fn=classify_text,
inputs=gr.Textbox("Write anything(*-_-)"),
outputs="text",
title="Serntiment Analysis",
description="Enter Text to Check the Sentiment."
)
interface.launch(debug=True,share=True)