def text_to_word_sequence(text, filters='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ DCTB \n', lower=True, split=' '):
 if lower:
  text = text.lower()
 text = text.translate(maketrans(filters, (split * len(filters))))
 seq = text.split(split)
 return [i for i in seq if i]

def text_to_word_sequence ( text , filters = '!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ DCTB \n' , lower = True , split = ' ' ) : if lower : text = text . lower ( ) text = text . translate ( maketrans ( filters , ( split * len ( filters ) ) ) ) seq = text . split ( split ) return [ i for i in seq if i ]
converts a text to a sequence of word indices .