code: def get_word_input(data, word_dict, embed, embed_dim):
      """
      Get word input.
      """
      batch_size = len(data)
      max_sequence_length = max(len(d) for d in data)
      sequence_length = max_sequence_length
      word_input = np.zeros(
          (max_sequence_length, batch_size, embed_dim), dtype=np.float32
      )
      ids = np.zeros((sequence_length, batch_size), dtype=np.int32)
      masks = np.zeros((sequence_length, batch_size), dtype=np.float32)
      lengths = np.zeros([batch_size], dtype=np.int32)
  
      for batch_idx in range(0, min(len(data), batch_size)):
          batch_data = data[batch_idx]
  
          lengths[batch_idx] = len(batch_data)
  
          for sample_idx in range(
              0, min(len(batch_data), sequence_length)
          ):
              word = batch_data[sample_idx]["word"].lower()
              if word in word_dict.keys():
                  word_input[sample_idx, batch_idx] = embed[
                      word_dict[word]
                  ]
                  ids[sample_idx, batch_idx] = word_dict[word]
              masks[sample_idx, batch_idx] = 1
  
      word_input = np.reshape(word_input, (-1, embed_dim))
      return word_input, ids, masks, lengths
  
file_path: nni/examples/trials/ga_squad/data.py
imports: import csv
  import json
  from random import shuffle
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: get_word_input(data, word_dict, embed, embed_dim) and returns: word_input,  ids,  masks,  lengths