testingg / app.py
Akash VP
add application file and requirment
41de639
raw
history blame contribute delete
310 Bytes
import gradio as gr
from transformers import pipeline
classifier = pipeline("sentiment-analysis")
def predict(text):
result = classifier(text)[0]
return f"{result['label']} ({result['score']:.2f})"
gr.Interface(
fn=predict, inputs="text", outputs="text", title="Sentiment analyzer"
).launch()