class_docstr: Torchscript-enabled version of preprocessing done by SetFeatureMixin.add_feature_data.
  
  If is_bag is true, forward returns a vector for each sample indicating counts of each token. Else, forward returns a
  multi-hot vector for each sample indicating presence of each token.
code: def __init__(
      self, metadata: TrainingSetMetadataDict, is_bag: bool = False
  ):
      super().__init__()
      if (
          metadata["preprocessing"]["tokenizer"]
          not in TORCHSCRIPT_COMPATIBLE_TOKENIZERS
      ):
          raise ValueError(
              f"{metadata['preprocessing']['tokenizer']} is not supported by torchscript. Please use "
              f"one of {TORCHSCRIPT_COMPATIBLE_TOKENIZERS}."
          )
  
      self.lowercase = metadata["preprocessing"]["lowercase"]
      self.tokenizer = get_tokenizer_from_registry(
          metadata["preprocessing"]["tokenizer"]
      )()
      self.vocab_size = metadata["vocab_size"]
      self.unknown_symbol = UNKNOWN_SYMBOL
      self.unit_to_id = metadata["str2idx"]
      self.is_bag = is_bag
  
imports: import logging
  from typing import Any, Dict, List, Union
  import numpy
  import torch
  from ludwig.constants import COLUMN, HIDDEN, LOGITS, NAME, PREDICTIONS, PROBABILITIES, PROC_COLUMN, SET
  from ludwig.features.base_feature import BaseFeatureMixin, InputFeature, OutputFeature, PredictModule
  from ludwig.features.feature_utils import set_str_to_idx
  from ludwig.schema.features.set_feature import SetInputFeatureConfig, SetOutputFeatureConfig
  from ludwig.types import FeatureMetadataDict, FeaturePostProcessingOutputDict, ModelConfigDict, PreprocessingConfigDict, TrainingSetMetadataDict
  from ludwig.utils import output_feature_utils
  from ludwig.utils.strings_utils import create_vocabulary, UNKNOWN_SYMBOL
  from ludwig.utils.tokenizers import get_tokenizer_from_registry, TORCHSCRIPT_COMPATIBLE_TOKENIZERS
  from ludwig.utils.types import TorchscriptPreprocessingInput
label_desc: Use image node_id 1 to create a new _SetPreprocessing object from inherited base classes: torch.nn with example: obj = _SetPreprocessing(metadata, is_bag)