code: def one_hot_sentence(mat: np.ndarray, num_classes: int) -> np.ndarray:
      """
      Convert a 2D matrix of ints into one-hot encoded 3D matrix
  
      Arguments:
          mat (numpy.ndarray): A 2D matrix of labels (int)
          num_classes (int): Number of all possible classes
  
      Returns:
          numpy.ndarray: A 3D matrix
      """
      new_mat = []
      for i in range(mat.shape[0]):
          new_mat.append(one_hot(mat[i], num_classes))
      return np.asarray(new_mat)
  
file_path: nlp-architect/nlp_architect/utils/generic.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import re
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: one_hot_sentence(mat, num_classes) and returns: np