(self, word)
| 525 | return self.max_word_length + 1 # <START> token followed by words |
| 526 | |
| 527 | def encode(self, word): |
| 528 | ix = torch.tensor([self.stoi[w] for w in word], dtype=torch.long) |
| 529 | return ix |
| 530 | |
| 531 | def decode(self, ix): |
| 532 | word = ''.join(self.itos[i] for i in ix) |