code: def make_array(word_id, words):
      """generate id numpy array from plain text words."""
      ids = [word_id.get(word, unk_token_id) for word in words]
      return np.array(ids, "i")
  
file_path: texar/examples/transformer/utils/preprocess.py
imports: import collections
  import re
  import json
  import os
  import numpy
  import pickle
  import argparse
  from io import open
label_desc: Use image node_id 5 for calling a global function with example usage: make_array(word_id, words) and returns: np