class_docstr: Torchscript-enabled version of postprocessing done by SetFeatureMixin.add_feature_data.
code: def forward(
      self, preds: Dict[str, torch.Tensor], feature_name: str
  ) -> FeaturePostProcessingOutputDict:
      predictions = output_feature_utils.get_output_feature_tensor(
          preds, feature_name, self.predictions_key
      )
      probabilities = output_feature_utils.get_output_feature_tensor(
          preds, feature_name, self.probabilities_key
      )
  
      inv_preds: List[List[str]] = []
      filtered_probs: List[torch.Tensor] = []
      for sample_idx, sample in enumerate(predictions):
          sample_preds: List[str] = []
          pos_sample_idxs: List[int] = []
          pos_class_idxs: List[int] = []
          for class_idx, is_positive in enumerate(sample):
              if is_positive == 1:
                  sample_preds.append(
                      self.idx2str.get(class_idx, self.unk)
                  )
                  pos_sample_idxs.append(sample_idx)
                  pos_class_idxs.append(class_idx)
          inv_preds.append(sample_preds)
          filtered_probs.append(
              probabilities[pos_sample_idxs, pos_class_idxs]
          )
  
      return {
          self.predictions_key: inv_preds,
          self.probabilities_key: filtered_probs,
      }
  
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 2 for calling the _SetPostprocessing obj's underlying member method code with example usage: obj.forward(preds, feature_name) and returns: dict