class_docstr: Vocabulary class.
  
  :param pad_value: The string value for the padding position.
  :param oov_value: The string value for the out-of-vocabulary terms.
  
  Examples:
      >>> vocab = BertVocabulary(pad_value='[PAD]', oov_value='[UNK]')
      >>> indices = vocab.transform(list('ABCDDZZZ'))
class_docstr_tok: ["Vocabulary","class",".",":","param","pad_value",":","The","string","value","for","the","padding","position",".",":","param","oov_value",":","The","string","value","for","the","out-of-vocabulary","terms",".","Examples",":",">",">",">","vocab","=","BertVocabulary","(","pad_value=","'","[","PAD","]","'",",","oov_value=","'","[","UNK","]","'",")",">",">",">","indices","=","vocab.transform","(","list","(","'ABCDDZZZ","'",")",")"]
docstr: Build a :class:`TermIndex` and a :class:`IndexTerm`.
docstr_tok: ["Build","a",":","class",":","`","TermIndex","`","and","a",":","class",":","`","IndexTerm","`","."]
code: def fit(self, vocab_path: str):
      """Build a :class:`TermIndex` and a :class:`IndexTerm`."""
      with open(vocab_path, "r", encoding="utf-8") as vocab_file:
          for idx, line in enumerate(vocab_file):
              term = line.strip()
              self._context["term_index"][term] = idx
              self._context["index_term"][idx] = term
  
file_path: MatchZoo/matchzoo/preprocessors/units/vocabulary.py
imports: from .stateful_unit import StatefulUnit
label_desc: Use image node_id 2 for calling the BertVocabulary obj's underlying member method code with example usage: obj.fit(vocab_path) without return types