File size: 413 Bytes
b731904
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import os

from utils import *
from transformers import pipeline
import gradio as gr


pipe = pipeline("text-classification", model="ShynBui/comment_classification_v2", token=os.environ['HF_TOKEN'])



def classification(text):
    classi = pipe(covert_pyVI(text))

    return classi[0]['label'], classi[0]['score']

iface = gr.Interface(fn=classification, inputs="text", outputs=["text", "text"])
iface.launch()