File size: 1,030 Bytes
e212e7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import gradio as gr

title = "RoBERTa, tengo una pregunta"
description = "Modelo tipo RoBERTa pre-entrenado con la base de datos de la Bibliotecha Nacional de España y fine-tuned con el corpus SQAC (Spanish Question-Answering Corpus)"
examples = [
    ["El corpus SQAC fue creado por un equipo del Barcelona Supercomputing Center y la sigla proviene de Spanish Question-Answering Corpus.", "¿Qué significa SQAC?"]
]
article = """
<p style="text-align: center">
    NLP en ES 🤗 | <a target=”_blank” href="https://nlp-en-es.org"> nlp-en-es.org </a>
</p>
"""

gr.Interface.load(
    name="huggingface/nlp-en-es/roberta-base-bne-finetuned-sqac",
    inputs=[gr.inputs.Textbox(label="Contexto", lines=5), gr.inputs.Textbox(label="Pregunta")],   
    outputs=gr.outputs.Textbox(label="Respuesta"),
    title=title,
    description=description,
    article=article,
    examples=examples,
    theme="huggingface",
    allow_screenshot=True,
    allow_flagging=True,
    flagging_dir="flagged",
    enable_queue=True
).launch()