class_docstr: This tokenizer allows us to tokenize using both spm and word token boundaries. It works as below:
  1) Splits the sentence into candidate tokens delimited by space
  2) Checks if the given token is part of the word based ontology vocab. If yes, it tokenizes it as a
     full word token
  3) If no, it breaks it down using spm voabulary.
class_docstr_tok: ["This","tokenizer","allows","us","to","tokenize","using","both","spm","and","word","token","boundaries",".","It","works","as","below",":","1",")","Splits","the","sentence","into","candidate","tokens","delimited","by","space","2",")","Checks","if","the","given","token","is","part","of","the","word","based","ontology","vocab",".","If","yes",",","it","tokenizes","it","as","a","full","word","token","3",")","If","no",",","it","breaks","it","down","using","spm","voabulary","."]
docstr: Loads a onto vocabulary file into a dictionary.
  Args:
      vocab_file: path of ontology vocab file
      ontology_vocab_lowercase: convert ontology vocab to lowercase
  Returns:
      set of ontology vocab tokens
docstr_tok: ["Loads","a","onto","vocabulary","file","into","a","dictionary",".","Args",":","vocab_file",":","path","of","ontology","vocab","file","ontology_vocab_lowercase",":","convert","ontology","vocab","to","lowercase","Returns",":","set","of","ontology","vocab","tokens"]
code: def load_ontology_vocab(
      vocab_file: str, ontology_vocab_lowercase: bool
  ):
      """
      Loads a onto vocabulary file into a dictionary.
      Args:
          vocab_file: path of ontology vocab file
          ontology_vocab_lowercase: convert ontology vocab to lowercase
      Returns:
          set of ontology vocab tokens
      """
      with PathManager.open(vocab_file, "r") as reader:
          tokens = reader.readlines()
      tokens = [token.rstrip("\n") for token in tokens]
      if ontology_vocab_lowercase:
          tokens = [token.lower() for token in tokens]
  
      ontology_vocab = set(tokens)
      return ontology_vocab
  
imports: import copy
  import json
  import re
  from collections import OrderedDict
  from typing import List, NamedTuple, Optional, Union
  import torch
  from fairseq.data.encoders.gpt2_bpe import get_encoder
  from fairseq.data.encoders.gpt2_bpe_utils import Encoder
  from pytext.config import ConfigBase
  from pytext.config.component import Component, ComponentType, create_component
  from pytext.data.pickleable_gpt2bpe_encoder import PickleableGPT2BPEEncoder
  from pytext.torchscript.tokenizer import ScriptDoNothingTokenizer, ScriptWordTokenizer
  from pytext.utils.file_io import PathManager
  from pytext.utils.usage import log_class_usage
  from transformers.tokenization_bert import BasicTokenizer, WordpieceTokenizer
label_desc: Use image node_id 1 for calling the SPEandWordTokenizer obj's underlying member method code with example usage: obj.load_ontology_vocab(vocab_file, ontology_vocab_lowercase) and returns: ontology_vocab