Spaces:
Running
Running
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) |