docstr: Processes GLUE datasets
  Args:
      file_name: path to file
      task_name: GLUE task name
      tokenizer: such as AutoTokenizer
      max_seq_length: max sequence length minus 2 for [CLS] and [SEP]
      use_cache: whether to use data cache
docstr_tok: ["Processes","GLUE","datasets","Args",":","file_name",":","path","to","file","task_name",":","GLUE","task","name","tokenizer",":","such","as","AutoTokenizer","max_seq_length",":","max","sequence","length","minus","2","for","[","CLS","]","and","[","SEP","]","use_cache",":","whether","to","use","data","cache"]
code: def __init__(
      self,
      file_name: str,
      task_name: str,
      tokenizer: TokenizerSpec,
      max_seq_length: str,
      use_cache: bool = True,
      compute_features: bool = True,
  ):
      """
      Processes GLUE datasets
      Args:
          file_name: path to file
          task_name: GLUE task name
          tokenizer: such as AutoTokenizer
          max_seq_length: max sequence length minus 2 for [CLS] and [SEP]
          use_cache: whether to use data cache
      """
      original_file_name = file_name
      logging.info(f"Processing {file_name}")
      data_dir, file_name = os.path.split(file_name)
      file_name = file_name[:-4]
      self.tokenizer = tokenizer
      evaluate = False if "train" in file_name else True
  
      if task_name not in processors:
          raise ValueError(
              f"{task_name} not supported. Choose from {processors.keys()}"
          )
  
      if task_name == "mnli" and "dev_mismatched" in file_name:
          self.task_name = "mnli-mm"
      else:
          self.task_name = task_name
  
      processor = processors[self.task_name]()
      output_mode = output_modes[self.task_name]
      self.label_list = processor.get_labels()
  
      # TODO: use a different variable to decide whether to trust the user provided filename. This is a temporary workaround for T5 GLUE and XNLI.
      if not compute_features:
          if not os.path.exists(original_file_name):
              raise ValueError(
                  f"Could not find file : {original_file_name}"
              )
          self.examples = processor.get_examples(original_file_name)
      else:
          self.examples = (
              processor.get_dev_examples(data_dir)
              if evaluate
              else processor.get_train_examples(data_dir)
          )
      processor_name = type(processor).__name__
      vocab_size = getattr(tokenizer, "vocab_size", 0)
      if compute_features:
          cached_features_file = os.path.join(
              data_dir,
              "cached_{}_{}_{}_{}_{}".format(
                  processor_name,
                  file_name,
                  tokenizer.name,
                  str(max_seq_length),
                  str(vocab_size),
              ),
          )
  
          if use_cache and os.path.exists(cached_features_file):
              logging.info(f"loading from {cached_features_file}")
              with open(cached_features_file, "rb") as reader:
                  self.features = pickle.load(reader)
          else:
              token_params = {
                  "bos_token": None,
                  "eos_token": tokenizer.eos_token,
                  "pad_token": tokenizer.pad_token,
                  "cls_token": tokenizer.cls_token,
                  "sep_token_extra": tokenizer.eos_token
                  if "roberta" in tokenizer.name.lower()
                  else None,
              }
  
              self.features = self.convert_examples_to_features(
                  self.examples,
                  self.label_list,
                  max_seq_length,
                  tokenizer,
                  output_mode,
                  **token_params,
              )
              master_device = (
                  not torch.distributed.is_initialized()
                  or torch.distributed.get_rank() == 0
              )
              if master_device:
                  logging.info(
                      f"Saving train features into {cached_features_file}"
                  )
                  with open(cached_features_file, "wb") as writer:
                      pickle.dump(self.features, writer)
  
imports: import os
  import pickle
  from typing import Dict, List, Optional, Union
  import numpy
  import torch
  from nemo.collections.common.tokenizers.tokenizer_spec import TokenizerSpec
  from nemo.collections.nlp.data.glue_benchmark.data_processors import ColaProcessor, MnliMismatchedProcessor, MnliProcessor, MrpcProcessor, QnliProcessor, QqpProcessor, RteProcessor, Sst2Processor, StsbProcessor, WnliProcessor, XNLIProcessor
  from nemo.core.classes import Dataset
  from nemo.core.neural_types import CategoricalValuesType, ChannelType, MaskType, NeuralType, RegressionValuesType
  from nemo.utils import logging
label_desc: Use image node_id 2 to create a new GLUEDataset object from inherited base classes: Dataset with example: obj = GLUEDataset(file_name, task_name, tokenizer, max_seq_length, use_cache, compute_features)