dialogue_personalization/generate_samples.py [27:36]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        sent_b, _ = t.translate_batch(batch)
        for i in range(len(batch["target_txt"])):
            new_words = []
            for w in sent_b[i][0]:
                if w==config.EOS_idx:
                    break
                new_words.append(w)
                if len(new_words)>2 and (new_words[-2]==w):
                    new_words.pop()
            sent_beam_search = ' '.join([model.vocab.index2word[idx] for idx in new_words])
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



dialogue_personalization/model/common_layer.py [633:644]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            sent_b, _ = t.translate_batch(batch)

            for i in range(len(batch["target_txt"])):
                new_words = []
                for w in sent_b[i][0]:
                    if w==config.EOS_idx:
                        break
                    new_words.append(w)
                    if len(new_words)>2 and (new_words[-2]==w):
                        new_words.pop()
                
                sent_beam_search = ' '.join([model.vocab.index2word[idx] for idx in new_words])
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



