Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
model = pipeline("text2text-generation", model="hafsa101010/mbart-neutralization")
|
| 5 |
+
|
| 6 |
+
def neutralize_text(input_text):
|
| 7 |
+
result = model(input_text, max_length=128, do_sample=False)
|
| 8 |
+
return result[0]["generated_text"]
|
| 9 |
+
|
| 10 |
+
demo = gr.Interface(
|
| 11 |
+
fn=neutralize_text,
|
| 12 |
+
inputs="text",
|
| 13 |
+
outputs="text",
|
| 14 |
+
title="Neutralizador para Lenguaje Inclusivo",
|
| 15 |
+
description="Convierte frases en lenguaje no inclusivo s inclusivo."
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
+
demo.launch()
|