(sentence)
| 91 | # a function to map word indexes back to real words |
| 92 | idx2word = dict((v, k) for k, v in iteritems(word2idx)) |
| 93 | def get_words(sentence): |
| 94 | return ' '.join(idx2word[i] for i in sentence) |
| 95 | |
| 96 | |
| 97 | # when we sample a fake sentence, we want to ensure not to sample |