code: def word_to_ids(words, word2id_dict, word_replace_dict, oov_id=None):
      """convert word to word index"""
      word_ids = []
      for word in words:
          word = word_replace_dict.get(word, word)
          word_id = word2id_dict.get(word, oov_id)
          word_ids.append(word_id)
  
      return word_ids
  
imports: import io
  import numpy
  import six
label_desc: Use image node_id 2 for calling a global function with example usage: word_to_ids(words, word2id_dict, word_replace_dict, oov_id) and returns: word_ids