google-research / pegasus

Apache License 2.0
1.61k stars 316 forks source link

how to get summary of more than 1 line? #207

Open kapilkathuria opened 3 years ago

kapilkathuria commented 3 years ago

I am trying Abstractive summary with Pegasus by following the example code give here on huggingface:

https://huggingface.co/transformers/model_doc/pegasus.html#usage-example

here is my sample code and results: image

it seems it produces summary of 1 line only. Is there way to get more than 1 line of summary?

Darshan2104 commented 2 years ago

add max_length and min_length in model.generate and set the size of token you want to generate

example : model.generate(**tokens, max_length= 150, min_length=30)