code: def _encode_words(self, words):
      ids = []
      for word in words:
          if word not in self.str2int:
              self.int2str[len(self.str2int)] = word
              self.str2int[word] = len(self.str2int)
          ids.append(self.str2int[word])
      return ids
  
imports: from typing import Dict, List, Union
  import numpy
  import torch
  import copy
  from transformers.file_utils import ModelOutput
  from numpy.testing import assert_array_equal
  from spacy.tokens import Doc
  from thinc.api import Model, get_current_ops
  from ..data_classes import FullTransformerBatch, HFObjects
  from ..span_getters import get_doc_spans
  from ..layers.transformer_model import forward
label_desc: Use image node_id 7 for calling the DummyTokenizer obj's underlying member method code with example usage: obj._encode_words(words) and returns: ids