dmmiller612 / bert-extractive-summarizer

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

Why model picks first statement as a part of summary always #60

Closed pratikghanwat7 closed 4 years ago

pratikghanwat7 commented 4 years ago

I took the example given by you and started removing the first statement and applied summarization. but each time model gives output with first statement(which was not part of earlier summaries).

SitiBanc commented 4 years ago

I take a look at the code and find these lines: https://github.com/dmmiller612/bert-extractive-summarizer/blob/8d6ed621ed400755255ee8a2b2b5733a2f0dbd9b/summarizer/model_processors.py#L140-L148 It's the default settings for Summarizer to use the first sentence as part of the outputs. Set use_first to False should fix this.

dmmiller612 commented 4 years ago

Yep! Thanks @SitiBanc. This was originally put in for news summarizations, where the first sentence is critical, regardless of the modeling.