Deep Learning, Artificial Intelligence, Naturallanguageprocessing, NLP, Machine Learning.
token_index_dict = json.loads(dict_text) Text -> Index Mapping def text_to_index(seq, token_index_dict): idx_lst = [] tok_lst = word_tokenize(seq) for tok in tok_lst: if tok not in token_index_dict.keys(): idx_lst.append(30_000) else: idx_lst.append(token_index_dict[tok]) return idx_lst Example