what is procced function for this Question generation is the task of automatically…
- User
what is procced function for this Question generation is the task of automatically generating questions from a text paragraph. The most straight-forward way for this is answer aware question generation. In answer aware question generation the model is presented with the answer and the passage and asked to generate a question for that answer by considering the passage context. While there are many papers available for QG task, it's still not as mainstream as QA. One of the reasons is most of the earlier papers use complicated models/processing pipelines and have no pre-trained models available. Few recent papers, specifically UniLM and ProphetNet have SOTA pre-trained weights availble for QG but the usage seems quite complicated.
This project is aimed as an open source study on question generation with pre-trained transformers (specifically seq-2-seq models) using straight-forward end-to-end methods without much complicated pipelines. The goal is to provide simplified data processing and training scripts and easy to use pipelines for inference.
Initial experiments Initial experiments are conducted using the SQuADv1 dataset and T5 model with different input processing formats as described below.
answer aware question generation For answer aware models the input text can be processed in two ways.
- prepend format:
Here the answer is simply added before the context and seperated by sep token. For example
42 [SEP] 42 is the answer to life, the universe and everything.
for T5 model the input is processed like this
answer: 42 context: 42 is the answer to life, the universe and everything.
- highlight format
Here the answer span is highlighted within the text with special highlight tokens.
42 is the answer to life, the universe and everything.
This idea is proposed in the "A Recurrent BERT-based Model for Question Generation" paper. See section 4.3
answer extraction models As the answer aware models need answers for generating question, we need something which can extract answer like spans from the text. This can be done using various methods like NER, noun-phrase extarction etc. But here a model is trained to extract answer like spans, to see how it'll work. With T5, answer extarction is done using the text-to-format.
As the highlight format will need to know the position of extracted answer spans the input for answer extraction is processed as follows
split the text into senteces. for each sentence that has answers, highlight the sentence with tokens. for the target text join the answers in that sentence with tokens. For example for this text
Python is a programming language. Created by Guido van Rossum and first released in 1991.
following examples will be created
Input text: Python is a programming language. Created by Guido van Rossum and first released in 1991.
- Assistant
- User
code using arat5
- Assistant