code: def wordid2str(word_ids, vocab):
      ret = []
      assert len(word_ids.shape) == 2, print(word_ids.shape)
      for i in range(word_ids.shape[0]):
          id_list = word_ids[i, :]
          ret_inst = []
          for j in range(id_list.shape[0]):
              if id_list[j] == vocab.EOS or id_list[j] == vocab.PAD:
                  break
              token = vocab.getWord(id_list[j])
              ret_inst.append(token)
          ret.append(" ".join(ret_inst))
      return ret
  
imports: import os
  import pickle
  from collections import OrderedDict
  import numpy
  import torch
  import torch.nn
  import yaml
  from scipy import sparse
  from sklearn import preprocessing
  from graph4nlp.pytorch.data.data import GraphData
label_desc: Use image node_id 12 for calling a global function with example usage: wordid2str(word_ids, vocab) and returns: ret