(self, sentence, var=False)
return id_list
list of tokens => list of id (Single sentence)
list of tokens => list of id (Single sentence)
list of tokens = > list of id ( Single sentence )
def sent2id(self, sentence, var=False):
        """list of tokens => list of id (Single sentence)"""
        id_list = [self.word2id[word] for word in sentence]
        if var:
            id_list = to_var(torch.LongTensor(id_list), eval=True)
        return id_list
def sent2id ( self , sentence , var = False ) : id_list = [ self . word2id [ word ] for word in sentence ] if var : id_list = to_var ( torch . LongTensor ( id_list ) , eval = True ) return id_list