Spaces:
Runtime error
Runtime error
finiteautomata
commited on
Commit
·
4479a0e
1
Parent(s):
649e10c
Un poco de título y explicación
Browse files
app.py
CHANGED
@@ -6,10 +6,6 @@ import streamlit as st
|
|
6 |
import torch
|
7 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
8 |
|
9 |
-
# Create an input box for context
|
10 |
-
context = st.text_input("Context", "China prohíbe la cría de perros para consumo humano")
|
11 |
-
# Create an input box for text
|
12 |
-
text = st.text_input("Text", "")
|
13 |
model_name = "piubamas/beto-contextualized-hate-speech"
|
14 |
# Load tokenizer and model
|
15 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
@@ -33,6 +29,16 @@ def predict(*args):
|
|
33 |
|
34 |
return [char for char, pred in chars if pred]
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
# Create a button to classify
|
37 |
if st.button("Classify"):
|
38 |
# Classify the text
|
|
|
6 |
import torch
|
7 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
8 |
|
|
|
|
|
|
|
|
|
9 |
model_name = "piubamas/beto-contextualized-hate-speech"
|
10 |
# Load tokenizer and model
|
11 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
|
29 |
|
30 |
return [char for char, pred in chars if pred]
|
31 |
|
32 |
+
|
33 |
+
|
34 |
+
# Create a title
|
35 |
+
st.title("Detección de discurso de odio en medios")
|
36 |
+
|
37 |
+
# Create an input box for context
|
38 |
+
context = st.text_input("Contexto", "China prohíbe la cría de perros para consumo humano")
|
39 |
+
# Create an input box for text
|
40 |
+
text = st.text_input("Comentario", "Chinos hdrmp hay que matarlos a todos")
|
41 |
+
|
42 |
# Create a button to classify
|
43 |
if st.button("Classify"):
|
44 |
# Classify the text
|