(self, id_list)
return sentence
list of id => list of tokens (Single sentence)
list of id => list of tokens (Single sentence)
list of id = > list of tokens ( Single sentence )
def id2sent(self, id_list):
        """list of id => list of tokens (Single sentence)"""
        id_list = self.to_list(id_list)
        sentence = []
        for id in id_list:
            word = self.id2word[id]
            if word not in [EOS_TOKEN, SOS_TOKEN, PAD_TOKEN]:
                sentence.append(word)
            if word == EOS_TOKEN:
                break
        return sentence
def id2sent ( self , id_list ) : id_list = self . to_list ( id_list ) sentence = [ ] for id in id_list : word = self . id2word [ id ] if word not in [ EOS_TOKEN , SOS_TOKEN , PAD_TOKEN ] : sentence . append ( word ) if word == EOS_TOKEN : break return sentence