dmmiller612 / bert-extractive-summarizer

Easy to use extractive text summarization with BERT
MIT License
1.39k stars 305 forks source link

Limit the summarization length #52

Closed padmalcom closed 4 years ago

padmalcom commented 4 years ago

Hi, first of all thanks for the great project.

Is there a way to limit the output of the summarizer? We use it to display a summarization in a table which get's very ugly when text length differ a lot.

sonnylaskar commented 4 years ago

You can pass the parameter ratio as ?ratio=0.1 to define the compression expected. To get a predictable length, you could compute ratio by considering the length of the input and the expected output length.

dmmiller612 commented 4 years ago

Yep, the ratio parameter controls the size of the summarization.

padmalcom commented 4 years ago

Thank you all!