Spaces:
Runtime error
Runtime error
File size: 490 Bytes
0734723 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
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()
|