def text_to_sequence(self, text, reverse=False, padding='post', truncating='post'):
    sequence = self.tokenizer.convert_tokens_to_ids(self.tokenizer.tokenize(text))
    if (len(sequence) == 0):
        sequence = [0]
    if reverse:
        sequence = sequence[::(- 1)]
    return pad_and_truncate(sequence, self.max_seq_len, padding=padding, truncating=truncating)
def text_to_sequence(self, text, reverse=False, padding='post', truncating='post'):
    sequence = self.tokenizer.convert_tokens_to_ids(self.tokenizer.tokenize(text))
    if (len(sequence) == 0):
        sequence = [0]
    if reverse:
        sequence = sequence[::(- 1)]
    return pad_and_truncate(sequence, self.max_seq_len, padding=padding, truncating=truncating)