File size: 973 Bytes
25cab40
feadba9
dbceef5
25cab40
feadba9
 
3776020
1f7675d
3776020
 
 
 
 
 
 
feadba9
 
 
 
3776020
f035c02
3776020
 
 
 
 
38e8bc0
3776020
38e8bc0
 
 
25cab40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import gradio as gr
from transformers import pipeline
from presentation import main_title, examples

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

article = """
# UNL: Universidad Nacional de Loja
### Miembros del equipo
- Anderson Quizhpe
- Luis Negrón
- David Pacheco
- Bryan Requenes
- Paul Pasaca
"""
def classify(text):
    cls= pipeline("text-classification", model=model)
    return cls(text)[0]['label']

gr.Interface(fn=classify, inputs=[gr.inputs.Textbox(
                lines=5,
                label="Texto a analizar:",
                placeholder="Introduce o elige un ejemplo de twit:",
                optional=False,
            )], outputs=[gr.outputs.Textbox(label="Predicción"),
                              ], description=main_title,
        examples=examples,
        article=article,
        theme="peach",
        thumbnail="None",
        css="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css").launch(debug=True)