include descriptions
Browse files
app.py
CHANGED
@@ -16,7 +16,24 @@ model = AutoModelForSeq2SeqLM.from_pretrained(model_checkpoint)
|
|
16 |
model.config.max_length = 512
|
17 |
model.to(device)
|
18 |
|
|
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
def postproc(input_sentence, preds):
|
22 |
try:
|
@@ -77,7 +94,8 @@ examples=['De acuerdo con las informaciones anteriores , las alumnas se han quej
|
|
77 |
|
78 |
iface = gr.Interface(fn=get_output,
|
79 |
title="Spanish Text Neutralization app",
|
80 |
-
description=
|
|
|
81 |
examples=examples,
|
82 |
# inputs="text",
|
83 |
inputs=gr.inputs.Textbox(label="Introduce some Spanish text here"),
|
|
|
16 |
model.config.max_length = 512
|
17 |
model.to(device)
|
18 |
|
19 |
+
article = """
|
20 |
|
21 |
+
<p style="text-align: justify;">
|
22 |
+
|
23 |
+
Spanish is a beautiful language and it has many ways of referring to people, neutralizing the genders and using some of the resources inside the language. One would say *Todas las personas asistentes* instead of *Todos los asistentes* and it would end in a more inclusive way for talking about people.
|
24 |
+
|
25 |
+
Given any input, our model will generate a gender neutral sentence, correcting any non-inclusive expressions or words. It's a straightforward and fast solution that creates a positive impact in the contemporary social panorama.
|
26 |
+
|
27 |
+
<p align="center">
|
28 |
+
<img src="https://upload.wikimedia.org/wikipedia/commons/2/29/Gender_equality_symbol_%28clipart%29.png" width="250"/>
|
29 |
+
</p>
|
30 |
+
|
31 |
+
One of the toughest challenges when building the app and the model was to find proper data for training the model. Therefore, the team opted to dedicate a considerable amount of time to build it from the scratch. These data has been obtained from a series of guidelines and manuals issued by Spanish Ministry of Health, Social Services and Equality in the matter of the usage of non-sexist language, stipulated in this linked [document](https://www.inmujeres.gob.es/servRecursos/formacion/GuiasLengNoSexista/docs/Guiaslenguajenosexista_.pdf). You can take a look at some details of the process in the linked dataset
|
32 |
+
|
33 |
+
</p>
|
34 |
+
"""
|
35 |
+
|
36 |
+
description = "The purpose of this app is to transform Spanish gendered text into a neutral version, suitable for an unbiased environment"
|
37 |
|
38 |
def postproc(input_sentence, preds):
|
39 |
try:
|
|
|
94 |
|
95 |
iface = gr.Interface(fn=get_output,
|
96 |
title="Spanish Text Neutralization app",
|
97 |
+
description=description,
|
98 |
+
article=article,
|
99 |
examples=examples,
|
100 |
# inputs="text",
|
101 |
inputs=gr.inputs.Textbox(label="Introduce some Spanish text here"),
|