class_docstr: Document Question Answering pipeline using any `AutoModelForDocumentQuestionAnswering`. The inputs/outputs are
  similar to the (extractive) question answering pipeline; however, the pipeline takes an image (and optional OCR'd
  words/boxes) as input instead of text context.
  
  This document question answering pipeline can currently be loaded from [`pipeline`] using the following task
  identifier: `"document-question-answering"`.
  
  The models that this pipeline can use are models that have been fine-tuned on a document question answering task.
  See the up-to-date list of available models on
  [huggingface.co/models](https://huggingface.co/models?filter=document-question-answering).
class_docstr_tok: ["Document","Question","Answering","pipeline","using","any","`","AutoModelForDocumentQuestionAnswering","`",".","The","inputs\/outputs","are","similar","to","the","(","extractive",")","question","answering","pipeline",";","however",",","the","pipeline","takes","an","image","(","and","optional","OCR'd","words\/boxes",")","as","input","instead","of","text","context",".","This","document","question","answering","pipeline","can","currently","be","loaded","from","[","`","pipeline","`","]","using","the","following","task","identifier",":","`","``","document-question-answering","''","`",".","The","models","that","this","pipeline","can","use","are","models","that","have","been","fine-tuned","on","a","document","question","answering","task",".","See","the","up-to-date","list","of","available","models","on","[","huggingface.co\/models","]","(","https",":","\/\/huggingface.co\/models","?","filter=document-question-answering",")","."]
code: def _sanitize_parameters(
      self,
      padding=None,
      doc_stride=None,
      max_question_len=None,
      lang: Optional[str] = None,
      tesseract_config: Optional[str] = None,
      max_answer_len=None,
      max_seq_len=None,
      top_k=None,
      handle_impossible_answer=None,
      **kwargs,
  ):
      preprocess_params, postprocess_params = {}, {}
      if padding is not None:
          preprocess_params["padding"] = padding
      if doc_stride is not None:
          preprocess_params["doc_stride"] = doc_stride
      if max_question_len is not None:
          preprocess_params["max_question_len"] = max_question_len
      if max_seq_len is not None:
          preprocess_params["max_seq_len"] = max_seq_len
      if lang is not None:
          preprocess_params["lang"] = lang
      if tesseract_config is not None:
          preprocess_params["tesseract_config"] = tesseract_config
  
      if top_k is not None:
          if top_k < 1:
              raise ValueError(
                  f"top_k parameter should be >= 1 (got {top_k})"
              )
          postprocess_params["top_k"] = top_k
      if max_answer_len is not None:
          if max_answer_len < 1:
              raise ValueError(
                  f"max_answer_len parameter should be >= 1 (got {max_answer_len}"
              )
          postprocess_params["max_answer_len"] = max_answer_len
      if handle_impossible_answer is not None:
          postprocess_params[
              "handle_impossible_answer"
          ] = handle_impossible_answer
  
      return preprocess_params, {}, postprocess_params
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/pipelines/document_question_answering.py
imports: import re
  from typing import List, Optional, Tuple, Union
  import numpy
  from ..utils import ExplicitEnum, add_end_docstrings, is_pytesseract_available, is_torch_available, is_vision_available, logging
  from .base import PIPELINE_INIT_ARGS, ChunkPipeline
  from .question_answering import select_starts_ends
label_desc: Use image node_id 2 for calling the DocumentQuestionAnsweringPipeline obj's underlying member method code with example usage: obj._sanitize_parameters(padding, doc_stride, max_question_len, lang, tesseract_config, max_answer_len, max_seq_len, top_k, handle_impossible_answer) and returns: preprocess_params,  dict,  postprocess_params