code: def test_get_vocabulary_hf(pretrained_model_name_or_path):
      tokenizer_type = "hf_tokenizer"
      vocab_file = None
      data = pd.DataFrame(
          [
              "Hello, I'm a single sentence!",
              "And another sentence",
              "And the very very last one",
          ]
      )
      column = data[0]
      preprocessing_parameters = (
          TextPreprocessingConfig()
          .from_dict(
              {
                  "tokenizer": tokenizer_type,
                  "vocab_file": vocab_file,
                  "pretrained_model_name_or_path": pretrained_model_name_or_path,
              }
          )
          .to_dict()
      )
  
      vocabulary = strings_utils.create_vocabulary(
          column,
          tokenizer_type=preprocessing_parameters["tokenizer"],
          num_most_frequent=preprocessing_parameters["most_common"],
          lowercase=preprocessing_parameters["lowercase"],
          vocab_file=preprocessing_parameters["vocab_file"],
          unknown_symbol=preprocessing_parameters["unknown_symbol"],
          padding_symbol=preprocessing_parameters["padding_symbol"],
          pretrained_model_name_or_path=preprocessing_parameters[
              "pretrained_model_name_or_path"
          ],
          compute_idf=False,
          add_special_symbols=False,
      )
  
      tokenizer = strings_utils.get_tokenizer(
          tokenizer_type=preprocessing_parameters["tokenizer"],
          tokenizer_vocab_file=preprocessing_parameters["vocab_file"],
          pretrained_model_name_or_path=preprocessing_parameters[
              "pretrained_model_name_or_path"
          ],
      )
  
      # check special tokens
      assert vocabulary.padding_symbol == tokenizer.get_pad_token()
      assert vocabulary.pad_idx == tokenizer.convert_token_to_id(
          tokenizer.get_pad_token()
      )
      assert vocabulary.unknown_symbol == tokenizer.get_unk_token()
  
      # check all tokens
      for token, idx in tokenizer.get_vocab().items():
          assert vocabulary.str2idx[token] == idx
  
file_path: ludwig/tests/ludwig/utils/test_strings_utils.py
imports: from collections import defaultdict
  import numpy
  import pandas
  import pytest
  from ludwig.schema.features.preprocessing.text import TextPreprocessingConfig
  from ludwig.utils import strings_utils
label_desc: Use image node_id 12 for calling a global function with example usage: test_get_vocabulary_hf(pretrained_model_name_or_path) without return types