code: def wordid2str(word_ids, vocab: 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:
                  break
              token = vocab.getWord(id_list[j])
              ret_inst.append(token)
          ret.append(" ".join(ret_inst))
      return ret
  
file_path: graph4nlp/examples/pytorch/nmt/utils.py
imports: import logging
  import math
  import os
  import pickle
  import torch
  import torchtext.vocab
  from torch.optim.lr_scheduler import LambdaLR
  from graph4nlp.pytorch.modules.utils.vocab_utils import Vocab
label_desc: Use image node_id 4 for calling a global function with example usage: wordid2str(word_ids, vocab) and returns: ret