class_docstr: Prepare document data for Document Classification.
  OCR (Optical character recognition) is applied to get the document texts and bounding boxes.
  Both texts and images will be processed.
class_docstr_tok: ["Prepare","document","data","for","Document","Classification",".","OCR","(","Optical","character","recognition",")","is","applied","to","get","the","document","texts","and","bounding","boxes",".","Both","texts","and","images","will","be","processed","."]
docstr: Get the OCR features, and avoid running OCR multiple times.
  
  Parameters
  ----------
  doc_path
      The document path.
  doc_image
      The document image.
  
  Returns
  -------
  Extracted words, image pixel features, and bounding boxes.
docstr_tok: ["Get","the","OCR","features",",","and","avoid","running","OCR","multiple","times",".","Parameters","--","--","--","--","--","doc_path","The","document","path",".","doc_image","The","document","image",".","Returns","--","--","--","-","Extracted","words",",","image","pixel","features",",","and","bounding","boxes","."]
code: def get_ocr_features(self, doc_path, doc_image):
      """
      Get the OCR features, and avoid running OCR multiple times.
  
      Parameters
      ----------
      doc_path
          The document path.
      doc_image
          The document image.
  
      Returns
      -------
      Extracted words, image pixel features, and bounding boxes.
      """
      # The OCR process is time-consuming, so apply OCR on each image only once.
      if doc_path not in self.documents:
          ocr_res = self.apply_ocr(doc_image)
          # store the ocr results.
          self.documents.update({doc_path: ocr_res})
      else:
          # reuse the ocr results.
          ocr_res = self.documents[doc_path]
  
      words = ocr_res["words"]
      normalized_word_boxes = ocr_res[BBOX]
  
      return words, normalized_word_boxes
  
imports: import logging
  import os
  import warnings
  from io import BytesIO
  from typing import Any, Dict, List, Optional, Union
  import numpy
  import PIL
  import pytesseract
  import torch
  from nptyping import NDArray
  from PIL import ImageFile
  from torch import nn
  from torchvision import transforms
  from ..constants import AUTOMM, BBOX, DOCUMENT_PDF
  from .collator import PadCollator, StackCollator
  from .utils import construct_image_processor, image_mean_std
label_desc: Use image node_id 5 for calling the DocumentProcessor obj's underlying member method code with example usage: obj.get_ocr_features(doc_path, doc_image) and returns: words,  normalized_word_boxes