code: def token2one_hot(tvec, vocab_size):
      
      arr = np.zeros((len(tvec), vocab_size))
  
      tvec_range = np.arange(len(tvec))
      tvec = np.asarray(tvec)
      arr[tvec_range[tvec >= 0], tvec[tvec >= 0]] = 1
      return arr
docs: Note: everything out of the vucabulary is transformed into `np.zeros(vocab_size)`