descr = [ s.strip().split(' ') for s in descr ]
l = max([ len(s) for s in descr ])
+ #descr = [ [ '<unk>' ] * (l - len(s)) + s for s in descr ]
descr = [ s + [ '<unk>' ] * (l - len(s)) for s in descr ]
return descr
self.token2id = dict([ (t, n) for n, t in enumerate(tokens) ])
self.id2token = dict([ (n, t) for n, t in enumerate(tokens) ])
+ # Tokenize the train and test sets
t = [ [ self.token2id[u] for u in s ] for s in self.train_descr ]
self.train_input = torch.tensor(t, device = self.device)
t = [ [ self.token2id[u] for u in s ] for s in self.test_descr ]