ShynBui's picture
first commit
b731904
raw
history blame
413 Bytes
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()