nlpyang / PreSumm

code for EMNLP 2019 paper Text Summarization with Pretrained Encoders
MIT License
1.28k stars 463 forks source link

Is there a method on how to restrict the output size? #23

Closed aretius closed 5 years ago

aretius commented 5 years ago

Hey I would want to restrict the output size by words/characters. Are there any methods? I looked at max_length & max_tgt_len however they seem to not be working. I set recall_eval as False max_length as 20 max_tgt_len as 20 min_length as 10 However the output remained of the constant size

Note: Using the below inference command ( Pre Trained CNN DM model Extractive ) python src/train.py -task ext -mode test -test_from ./models/bertext.pt -batch_size 3000 -test_batch_size 500 -bert_data_path ./bert_path/ -log_file ./logs/val_abs_bert_cnndm -sep_optimtrue -use_interval true -visible_gpus -1 -max_pos 512 -max_length 20 -max_tgt_len 20 -alpha 0.95 -min_length 10 -result_path ./results/ -report_rouge false -recall_eval False

nlpyang commented 5 years ago

These hyperparameters are used to control abstractive summarization.

For extractive summarization, please refer to https://github.com/nlpyang/PreSumm/issues/31 for setting the number of selected sentences.