File size: 297 Bytes
25cab40
feadba9
25cab40
feadba9
 
 
 
 
 
 
25cab40
1
2
3
4
5
6
7
8
9
10
11
12
import gradio as gr
from transformers import pipeline

model = 'hackathon-pln-es/Detect-Acoso-Twitter-Es'

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)