code: def get_numericalize_net(c2_prepared, vocab_map, input_names):
      predict_net = c2_prepared.predict_net
      init_net = core.Net(c2_prepared.init_net)
      final_input_names = input_names.copy()
      with c2_prepared.workspace._ctx:
          vocab_indices = create_vocab_indices_map(
              c2_prepared, init_net, vocab_map
          )
  
          # Add operators to convert string features to ids based on the vocab
          final_predict_net = core.Net(predict_net.name + "_processed")
          final_inputs = set(
              {
                  ext_input
                  for ext_input in input_names
                  if ext_input not in vocab_map.keys()
              }
          )
          for ext_input in final_inputs:
              final_predict_net.AddExternalInput(ext_input)
  
          for feat in vocab_map.keys():
              raw_input_blob = final_predict_net.AddExternalInput(
                  convert_caffe2_blob_name(feat)
              )
              # IndexGet expects flat tensors, so flatten the batch first then
              # Resize it back after the lookup
              flattened_input_blob = final_predict_net.FlattenToVec(
                  raw_input_blob
              )
              flattened_ids = final_predict_net.IndexGet(
                  [vocab_indices[feat], flattened_input_blob]
              )
              final_predict_net.ResizeLike(
                  [flattened_ids, raw_input_blob], [feat]
              )
              final_input_names[
                  input_names.index(feat)
              ] = convert_caffe2_blob_name(feat)
      return final_predict_net, init_net, final_input_names
  
file_path: pytext/pytext/utils/onnx.py
imports: import caffe2.python.predictor.predictor_exporter
  import numpy
  import torch
  from caffe2.python import core, workspace
  from caffe2.python.onnx import backend
  from torch.onnx import ExportTypes, OperatorExportTypes
label_desc: Use image node_id 5 for calling a global function with example usage: get_numericalize_net(c2_prepared, vocab_map, input_names) and returns: final_predict_net,  init_net,  final_input_names