File size: 333 Bytes
8475c22
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from transformers import pipeline
import gradio as gr


PIPE = pipeline("text-classification", model='hackathon-somos-nlp-2023/roberta-base-bne-finetuned-suicide-es')


def detect_suicide_comment(comentario):
    return PIPE(comentario)


iface = gr.Interface(fn=detect_suicide_comment, inputs="text", outputs="text")
iface.launch()