File size: 344 Bytes
47c1e73
 
 
 
 
 
 
d42e33a
47c1e73
a4256f6
1
2
3
4
5
6
7
8
9
10
import gradio as gr
from transformers import pipeline

model = 'mrm8488/electricidad-small-finetuned-amazon-review-classification'

def classify(text):
    cls= pipeline("text-classification", model=model)
    return cls(text)[0]['label'] + '➗ ⭐⭐⭐⭐⭐'

gr.Interface(fn=classify, inputs=["textbox"], outputs="text").launch(debug=True)