class_docstr: Extractor implementation for SentencePiece trained models.
  https://github.com/google/sentencepiece
class_docstr_tok: ["Extractor","implementation","for","SentencePiece","trained","models",".","https",":","\/\/github.com\/google\/sentencepiece"]
code: def extract(self) -> Tuple[Dict[str, int], List[Tuple]]:
      sp = self.sp
      vocab = {
          sp.id_to_piece(index): index
          for index in trange(sp.GetPieceSize())
      }
  
      # Merges
      merges = []
      for piece_l in tqdm(vocab.keys(), total=sp.GetPieceSize()):
          for piece_r in vocab.keys():
              merge = f"{piece_l}{piece_r}"
              piece_id = vocab.get(merge, None)
              if piece_id:
                  merges += [(piece_l, piece_r, piece_id)]
      merges = sorted(merges, key=lambda val: val[2])
      merges = [(val[0], val[1]) for val in merges]
  
      return vocab, merges
  
file_path: hf-tokenizers/bindings/python/scripts/sentencepiece_extractor.py
imports: from argparse import ArgumentParser
  from json import dump
  from logging import basicConfig, getLogger
  from os import linesep, remove
  from os.path import exists
  from tempfile import NamedTemporaryFile
  from typing import Dict, List, Tuple
  from requests import get
  from sentencepiece import SentencePieceProcessor
  from tqdm import trange, tqdm
label_desc: Use image node_id 2 for calling the SentencePieceExtractor obj's underlying member method code with example usage: obj.extract() and returns: vocab,  merges