How to make a QA model generate full sentences

Hello everyone,

I’ve fine tuned t5-base for generative QA using a combination of domain data and the squad dataset. The model is able to answer most questions correctly, however it’s extremely succinct while I would like it to generate full sentences.

I’ve tried increasing the min_length, but doing so forbids the model from ever answering succinctly. Some questions should be answered in 3 or so words, while others should be answered in multiple sentences.

Training Data Format

"Architecturally, the school has a Catholic character. Atop the Main Building's gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend ""Venite Ad Me Omnes"". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary.",To whom did the Virgin Mary allegedly appear in 1858 in Lourdes France?,"{'text': array(['Saint Bernadette Soubirous'], dtype=object), 'answer_start': array([515])}"
"Architecturally, the school has a Catholic character. Atop the Main Building's gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend ""Venite Ad Me Omnes"". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary.",What is in front of the Notre Dame Main Building?,"{'text': array(['a copper statue of Christ'], dtype=object), 'answer_start': array([188])}"
"Architecturally, the school has a Catholic character. Atop the Main Building's gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend ""Venite Ad Me Omnes"". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary.",The Basilica of the Sacred heart at Notre Dame is beside to which structure?,"{'text': array(['the Main Building'], dtype=object), 'answer_start': array([279])}"

Fine Tuning Script

I’m using the script described in this article: Question answering

Inference

prompt = "question ... context: ..."

pipeline = pipeline(
    task="text2text-generation",
    model="path to my model",
    num_workers=32,
    batch_size=16,
)

answer = pipeline(
            prompt,
            min_length=5,
            max_length=len(prompt), 
            do_sample=True,
)[0]["generated_text"]

Any help would be appreciated.