StaticfunctionalityThis functionality processes uploaded images using a Donut AI-Model running on the DJL ONNX-Engine to answer questions about documents. As soon as the file(s) selected changes the AI is contacted via AJAX and the questions are answered. Nothing happens if no file is selected.
PDF Support: The functionality automatically detects PDF files and processes them accordingly:
Image Orientation: The Donut model is sensitive to image rotation. There are two ways to provide orientation of the image to process:
Manual Rotation (Priority): Add a data-cb-Rotate attribute to the input element:
data-cb-Rotate="90" - Rotate image 90° clockwisedata-cb-Rotate="180" - Rotate image 180°data-cb-Rotate="270" - Rotate image 270° clockwise (90° counter-clockwise)Automatic Detection (Fallback): If no data-cb-Rotate attribute is provided AND the Tesseract OCR engine is active (OCR is set in Active_AI plugin property), the system will automatically detect and correct image orientation using Tesseract's OSD (Orientation and Script Detection). Hint: If you experience wrong results on images taken with an iPhone, consider enabling OCR for automatic rotation correction. Since some iPhones don't visibly show when they rotate an image that is taken by camera and directly imported, like when selecting file and taking a photo as the selection.
No Rotation: If data-cb-Rotate is not provided and OCR is not set in Active_AI plugin property, images are processed as-is leading to potential wrong results with images that are rotated.
maxPages: 5 will
only process the first 5 pages of any PDF. Defaults to 5.Questions are acquired from DOM elements within the parent.parent container of the HTMLInputElement toProcess that're tagged with the class AI_ONNX_DONUT_QA_Question. Each such element should have:
Provided by the CodBi.
Provided by the CodBi.
Provides the AI_ONNX_DONUT_QA.functionality.
Remarks
Maintainer: Callari, Salvatore (Salvatore.Callari@Ansbach.de)