class_docstr: Class that holds a vocabulary for the dataset.
class_docstr_tok: ["Class","that","holds","a","vocabulary","for","the","dataset","."]
docstr: Convert a sentence to a list of ids, with special tokens added.
docstr_tok: ["Convert","a","sentence","to","a","list","of","ids",",","with","special","tokens","added","."]
code: def encode(self, sentence):
      """Convert a sentence to a list of ids, with special tokens added."""
      word_ids = [
          self.word_to_id(cur_word) for cur_word in sentence.split()
      ]
      return np.array(
          [self.bos] + word_ids + [self.eos], dtype=np.int32
      )
  
imports: import random
  import numpy
  from textattack.shared.utils import LazyLoader
label_desc: Use image node_id 9 for calling the Vocabulary obj's underlying member method code with example usage: obj.encode(sentence) and returns: np