code: def word2id(self, xs):
          
          if isinstance(xs, list):
              return [self._word2id.get(x, self.UNK) for x in xs]
          return self._word2id.get(xs, self.UNK)
docs: Map word(s) to its id(s)
  
          Parameters
          ----------
          xs : str or list
              word or a list of words
  
          Returns
          -------
          int or list
              id or a list of ids