code: def set_str_to_idx(set_string, feature_dict, tokenizer_name):
      try:
          tokenizer = get_tokenizer_from_registry(tokenizer_name)()
      except ValueError:
          raise Exception(f"Tokenizer {tokenizer_name} not supported")
  
      out = [
          feature_dict.get(item, feature_dict[UNKNOWN_SYMBOL])
          for item in tokenizer(set_string)
      ]
  
      return np.array(out, dtype=np.int32)
  
imports: import re
  from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from ludwig.constants import NAME, PREPROCESSING, SEQUENCE, TEXT, TIMESERIES, TYPE
  from ludwig.utils.data_utils import hash_dict
  from ludwig.utils.strings_utils import get_tokenizer_from_registry, UNKNOWN_SYMBOL
label_desc: Use image node_id 2 for calling a global function with example usage: set_str_to_idx(set_string, feature_dict, tokenizer_name) and returns: np