I changed line 46 to self.token_to_id = dict((k, self.full_token_to_id[k]) for k in list(self.full_token_to_id.keys())[:max_vocabulary_size])
But still got the error:
44 full_token_and_id = zip(vocabulary, range(len(vocabulary)))
45 self.full_token_to_id = dict(full_token_and_id)
---> 46 self.token_to_id = dict((k, self.full_token_to_id[k]) for k in list(self.full_token_to_id.keys())[:max_vocabulary_size])
47
48 self.id_to_token = {v: k for k, v in self.token_to_id.items()}
TypeError: 'zip' object is not subscriptable
I have the same problem as here
I changed line 46 to self.token_to_id = dict((k, self.full_token_to_id[k]) for k in list(self.full_token_to_id.keys())[:max_vocabulary_size])
But still got the error: