class_docstr: Construct a GPT Tokenizer. Based on Byte-Pair-Encoding with the following peculiarities:
  
  - lowercases all inputs,
  - uses `SpaCy` tokenizer and `ftfy` for pre-BPE tokenization if they are installed, fallback to BERT's
    `BasicTokenizer` if not.
  
  This tokenizer inherits from [`PreTrainedTokenizer`] which contains most of the main methods. Users should refer to
  this superclass for more information regarding those methods.
  
  Args:
      vocab_file (`str`):
          Path to the vocabulary file.
      merges_file (`str`):
          Path to the merges file.
      unk_token (`str`, *optional*, defaults to `"<unk>"`):
          The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
          token instead.
class_docstr_tok: ["Construct","a","GPT","Tokenizer",".","Based","on","Byte-Pair-Encoding","with","the","following","peculiarities",":","-","lowercases","all","inputs",",","-","uses","`","SpaCy","`","tokenizer","and","`","ftfy","`","for","pre-BPE","tokenization","if","they","are","installed",",","fallback","to","BERT's","`","BasicTokenizer","`","if","not",".","This","tokenizer","inherits","from","[","`","PreTrainedTokenizer","`","]","which","contains","most","of","the","main","methods",".","Users","should","refer","to","this","superclass","for","more","information","regarding","those","methods",".","Args",":","vocab_file","(","`","str","`",")",":","Path","to","the","vocabulary","file",".","merges_file","(","`","str","`",")",":","Path","to","the","merges","file",".","unk_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","unk",">","''","`",")",":","The","unknown","token",".","A","token","that","is","not","in","the","vocabulary","can","not","be","converted","to","an","ID","and","is","set","to","be","this","token","instead","."]
docstr: Tokenize a string.
docstr_tok: ["Tokenize","a","string","."]
code: def _tokenize(self, text):
      """Tokenize a string."""
      split_tokens = []
      if self.fix_text is None:
          # Using BERT's BasicTokenizer
          text = self.nlp.tokenize(text)
          for token in text:
              split_tokens.extend(list(self.bpe(token).split(" ")))
      else:
          # Using SpaCy & ftfy (original tokenization process of OpenAI GPT)
          text = self.nlp(text_standardize(self.fix_text(text)))
          for token in text:
              split_tokens.extend(
                  list(self.bpe(token.text.lower()).split(" "))
              )
      return split_tokens
  
imports: import json
  import os
  import re
  import unicodedata
  from typing import Optional, Tuple
  from ...tokenization_utils import PreTrainedTokenizer, _is_control, _is_punctuation, _is_whitespace
  from ...utils import logging
label_desc: Use image node_id 6 for calling the OpenAIGPTTokenizer obj's underlying member method code with example usage: obj._tokenize(text) and returns: split_tokens