def load_data(x): corpus_chars=x.replace(\n, ) idx_to_char=list(set(corpus_chars)) char_to_idx=dict([(char,i) for i,char in enumerate(idx_to_char)]) vocab_size=len(char_to_idx) corpus_indices=[char_to_idx.get(char) for char in corpus_chars] return corpus_indices, char_to_