class_docstr: The ``QuestionAnsweringTask`` is a :class:`~flash.Task` for extractive question answering. For more details, see
  `question_answering`.
  
  You can change the backbone to any question answering model from `HuggingFace/transformers
  <https://huggingface.co/transformers/model_doc/auto.html#automodelforquestionanswering>`_ using the ``backbone``
  argument.
  
  .. note:: When changing the backbone, make sure you pass in the same backbone to the :class:`~flash.Task` and the
      :class:`~flash.core.data.data_module.DataModule` object! Since this is a QuestionAnswering task, make sure you
      use a QuestionAnswering model.
  
  Args:
      backbone: backbone model to use for the task.
      max_source_length: Max length of the sequence to be considered during tokenization.
      max_target_length: Max length of each answer to be produced.
      padding: Padding type during tokenization.
      doc_stride: The stride amount to be taken when splitting up a long document into chunks.
      loss_fn: Loss function for training.
      optimizer: Optimizer to use for training.
      lr_scheduler: The LR scheduler to use during training.
      metrics: Metrics to compute for training and evaluation. Defauls to calculating the ROUGE metric.
          Changing this argument currently has no effect.
      learning_rate: Learning rate to use for training, defaults to `3e-4`
      enable_ort: Enable Torch ONNX Runtime Optimization: https://onnxruntime.ai/docs/#onnx-runtime-for-training
      n_best_size: The total number of n-best predictions to generate when looking for an answer.
      version_2_with_negative: If true, some of the examples do not have an answer.
      max_answer_length: The maximum length of an answer that can be generated. This is needed because the start and
          end predictions are not conditioned on one another.
      null_score_diff_threshold: The threshold used to select the null answer: if the best answer has a score that is
          less than the score of the null answer minus this threshold, the null answer is selected for this example.
          Only useful when `version_2_with_negative=True`.
      use_stemmer: Whether Porter stemmer should be used to strip word suffixes to improve matching.
class_docstr_tok: ["The","``","QuestionAnsweringTask","``","is","a",":","class",":","`","~flash.Task","`","for","extractive","question","answering",".","For","more","details",",","see","`","question_answering","`",".","You","can","change","the","backbone","to","any","question","answering","model","from","`","HuggingFace\/transformers","<","https",":","\/\/huggingface.co\/transformers\/model_doc\/auto.html","#","automodelforquestionanswering",">","`","_","using","the","``","backbone","``","argument",".","..","note",":",":","When","changing","the","backbone",",","make","sure","you","pass","in","the","same","backbone","to","the",":","class",":","`","~flash.Task","`","and","the",":","class",":","`","~flash.core.data.data_module.DataModule","`","object","!","Since","this","is","a","QuestionAnswering","task",",","make","sure","you","use","a","QuestionAnswering","model",".","Args",":","backbone",":","backbone","model","to","use","for","the","task",".","max_source_length",":","Max","length","of","the","sequence","to","be","considered","during","tokenization",".","max_target_length",":","Max","length","of","each","answer","to","be","produced",".","padding",":","Padding","type","during","tokenization",".","doc_stride",":","The","stride","amount","to","be","taken","when","splitting","up","a","long","document","into","chunks",".","loss_fn",":","Loss","function","for","training",".","optimizer",":","Optimizer","to","use","for","training",".","lr_scheduler",":","The","LR","scheduler","to","use","during","training",".","metrics",":","Metrics","to","compute","for","training","and","evaluation",".","Defauls","to","calculating","the","ROUGE","metric",".","Changing","this","argument","currently","has","no","effect",".","learning_rate",":","Learning","rate","to","use","for","training",",","defaults","to","`","3e-4","`","enable_ort",":","Enable","Torch","ONNX","Runtime","Optimization",":","https",":","\/\/onnxruntime.ai\/docs\/","#","onnx-runtime-for-training","n_best_size",":","The","total","number","of","n-best","predictions","to","generate","when","looking","for","an","answer",".","version_2_with_negative",":","If","true",",","some","of","the","examples","do","not","have","an","answer",".","max_answer_length",":","The","maximum","length","of","an","answer","that","can","be","generated",".","This","is","needed","because","the","start","and","end","predictions","are","not","conditioned","on","one","another",".","null_score_diff_threshold",":","The","threshold","used","to","select","the","null","answer",":","if","the","best","answer","has","a","score","that","is","less","than","the","score","of","the","null","answer","minus","this","threshold",",","the","null","answer","is","selected","for","this","example",".","Only","useful","when","`","version_2_with_negative=True","`",".","use_stemmer",":","Whether","Porter","stemmer","should","be","used","to","strip","word","suffixes","to","improve","matching","."]
code: def validation_step(
      self, batch: Any, batch_idx: int, dataloader_idx: int = 0
  ):
      self.common_step("val", batch)
  
imports: import collections
  import os
  import warnings
  from typing import Any, Callable, Iterable, List, Mapping, Optional, Sequence, Union
  import numpy
  import torch
  from pytorch_lightning import Callback
  from pytorch_lightning.utilities import rank_zero_info
  from torch import Tensor
  from torch.nn import Module
  from torchmetrics.text.rouge import ROUGEScore
  from flash.core.data.io.input import DataKeys
  from flash.core.model import Task
  from flash.core.registry import ExternalRegistry, FlashRegistry
  from flash.core.utilities.imports import _TOPIC_TEXT_AVAILABLE
  from flash.core.utilities.providers import _HUGGINGFACE
  from flash.core.utilities.types import LR_SCHEDULER_TYPE, METRICS_TYPE, OPTIMIZER_TYPE
  from flash.text.ort_callback import ORTCallback
  from flash.text.question_answering.collate import TextQuestionAnsweringCollate
  from flash.text.question_answering.output_transform import QuestionAnsweringOutputTransform
label_desc: Use image node_id 7 for calling the QuestionAnsweringTask obj's underlying member method code with example usage: obj.validation_step(batch, batch_idx, dataloader_idx) without return types