code: def from_config(cls, config, tensorizers: Optional[Dict] = None):
      # TODO this part should be handled more elegantly
      for name in ["text_feats", "tokens"]:
          if name in tensorizers:
              token_tensorizer_name = name
              break
      return cls(
          tensorizers["doc_labels"].vocab,
          tensorizers["word_labels"].vocab,
          getattr(tensorizers["word_labels"], "use_bio_labels", False),
          [
              ConsoleChannel(),
              FileChannel((Stage.TEST,), config.output_path),
          ],
          tensorizers["word_labels"].slot_column,
          tensorizers[token_tensorizer_name].text_column,
          token_tensorizer_name,
      )
  
imports: from typing import Dict, List, Optional
  from pytext.common.constants import DatasetFieldName, Stage
  from pytext.data.data_structures.annotation import CLOSE, escape_brackets, OPEN
  from pytext.metrics.intent_slot_metrics import compute_all_metrics, FramePredictionPair, Node, Span
  from pytext.utils.data import byte_length, get_substring_from_offsets, merge_token_labels_to_slot, parse_slot_string
  from .channel import Channel, ConsoleChannel, FileChannel
  from .metric_reporter import MetricReporter
label_desc: Use image node_id 2 for calling the IntentSlotMetricReporter obj's underlying member method code with example usage: obj.from_config(cls, config, tensorizers) and returns: cls