Skeleton-to-Response
Skeleton-to-Response copied to clipboard
Some problem about the implement of Cascaded Model
I want to use your Cascaded Model. In your usage description, there are 5 steps in total. The first two steps I successfully run, but fail in third steps.
In the script "hard/train_critic.sh", it requires the folder "../douban_pretrain/checkpoint_epoch19.pkl.clean", while it's not generated before.
Can you tell me how to solve this problem?
In nmt/utils/Model.py, 230-238 rows:
ref_contexts, ref_mask = [], [] for template_input, template_length in zip(template_inputs, template_lengths): emb_ref = self.dec_embedding(template_input) ref_context, _ = self.encoder_ref(emb_ref, template_length) ref_mask_ = sequence_mask(template_length) ref_contexts.append(ref_context) ref_mask.append(ref_mask_) ref_contexts = torch.cat(ref_contexts, 0) ref_mask = torch.cat(ref_mask, 1)
It encodes template_inputs separately, however the encode and mask operation is designed for a batch data. I think this code should be replaced as:
emb_ref = self.dec_embedding(template_inputs) ref_contexts, _ = self.encoder_ref(emb_ref, template_lengths) ref_mask = sequence_mask(template_lengths)
Hi, May I know how do you do the preprocessing? Moreover, where did you get the stop word file? Thanks!