Closed johncs999 closed 4 years ago
Sorry for the late reply. Can you take a look at the beam_size used during inference? We used 50 in the paper, but it might not be set in config/test/config-test-keyphrase-one2seq.yml
.
Thinks for your reply. I tried to use 50 but the results are similar when using --eval_topbeam
. The logs at last step for CatSeqD are:
Step 100000/100000; acc: 55.31; ppl: 7.76; xent: 2.05; lr: 0.00002; 13308/1128 tok/s; 48167 sec
The whole CatSeqD training config file is:
model_type: keyphrase
tgt_type: verbatim_append
data: data/keyphrase/meng17/kp20k
save_checkpoint_steps: 10000
keep_checkpoint: 20
seed: 3435
train_steps: 100000
valid_steps: 200000 # no validation
report_every: 100
encoder_type: brnn
rnn_type: GRU
word_vec_size: 100
rnn_size: 150
layers: 1
optim: adam
learning_rate: 1e-3
max_grad_norm: 2
batch_size: 32
valid_batch_size: 128
dropout: 0.1
global_attention: mlp
tensorboard: 'true'
log_file_level: DEBUG
copy_attn: 'true'
reuse_copy_attn: 'true'
coverage_attn: 'true'
context_gate: 'both'
input_feed: 1
share_embeddings: 'true'
bridge: 'true'
orth_reg: 'true'
lambda_orth_reg: 1
sem_cov: 'true'
lambda_sem_cov: 0.03
tgt_enc: 'rnn'
detach_tgt_enc: 'true'
num_negsample: 16
use_ending_state: 'true'
exp: kp20k-one2seq-birnn-GRU150-EMB100-ATTNmlp-Dropout00-OR1-SC03
save_model: models/keyphrase/meng17-one2seq/kp20k.one2seq.birnn.Dropout00-OR1-SC03
log_file: output/keyphrase/meng17-one2seq/kp20k.one2seq.birnn.Dropout00-OR1-SC03.log
tensorboard_log_dir: runs/keyphrase/meng17-one2seq/kp20k.one2seq.birnn.Dropout00-OR1-SC03/
world_size: 1
gpu_ranks:
- 0
# 1
master_port: 5000
And the translating command is:
python kp_gen_eval.py -tasks pred eval report -config config/test/config-test-keyphrase-one2seq.yml \
-data_dir data/keyphrase/meng17/ -ckpt_dir models/keyphrase/meng17-one2seq/ \
-output_dir output/meng17-one2seq-topbeam-selfterminating/kp20k-one2seq-birnn-GRU150-EMB100-ATTNmlp-Dropout00-OR1-SC03/ \
-testsets semeval -gpu 0 --verbose --beam_size 50 --batch_size 32 \
--max_length 40 --onepass --beam_terminate topbeam --eval_topbeam
You raised a very good point. If --eval_topbeam
is enabled, it only evaluates with the top-scored sequence in beam search, which is not super useful in the KP setting. Besides, please --beam_terminate full
rather than topbeam
for reproducing the results. topbeam
can be much faster with certain performance degradation. Sorry about the confusion.
python kp_gen_eval.py -tasks pred eval report -config config/test/config-test-keyphrase-one2seq.yml \ -data_dir data/keyphrase/meng17/ -ckpt_dir models/keyphrase/meng17-one2seq/ \ -output_dir output/meng17-one2seq-topbeam-selfterminating/kp20k-one2seq-birnn-GRU150-EMB100-ATTNmlp-Dropout00-OR1-SC03/ \ -testsets semeval -gpu 0 --verbose --beam_size 50 --batch_size 32 \ --max_length 40 --onepass --beam_terminate full
Thanks a lot !
Hi, memray, thanks for your codes, it really helps ! I still have a few questions about the codes:
tgt_enc: 'rnn'
detach_tgt_enc: 'true'
num_negsample: 16
use_ending_state: 'true'
...
lambda_orth_reg: 1 lambda_sem_cov: 0.03