Dario Lopez Padial commited on
Commit
8475c22
1 Parent(s): dfc310d

Add application file

Browse files
Files changed (2) hide show
  1. app.py +13 -0
  2. requirements.txt +3 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+
5
+ PIPE = pipeline("text-classification", model='hackathon-somos-nlp-2023/roberta-base-bne-finetuned-suicide-es')
6
+
7
+
8
+ def detect_suicide_comment(comentario):
9
+ return PIPE(comentario)
10
+
11
+
12
+ iface = gr.Interface(fn=detect_suicide_comment, inputs="text", outputs="text")
13
+ iface.launch()
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ gradio==3.24.1
2
+ torch==1.13.1
3
+ transformers==4.27.4