code: def onehot_encode(dataset, char_indices, maxlen):
      
      X = np.zeros((len(dataset), maxlen, len(char_indices.keys())))
      for i, sentence in enumerate(dataset):
          for t, char in enumerate(sentence):
              X[i, t, char_indices[char]] = 1
      return X
docs: One hot encode the tokens
  
      Args:
          dataset  list of lists of tokens
          char_indices  dictionary of {key=character, value=index to use encoding vector}
          maxlen  int  Length of each sample
      Return:
          np array of shape (samples, tokens, encoding length)