Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
classifier = pipeline("text-classification", model="matthewburke/korean_sentiment") | |
def predict(text): | |
result = classifier(text, return_all_scores=True)[0] | |
positive_score = result[1]['score'] | |
negative_score = result[0]['score'] | |
return {"positive": positive_score, "negative": negative_score} | |
iface = gr.Interface( | |
fn=predict, | |
inputs='text', | |
outputs='label', | |
examples=[["μνκ° μ¬λ°μλ€"]] | |
) | |
iface.launch() | |