IDocumentQA<T>

Interfaces · AiDotNet.Document.Interfaces

Interface for document question answering models.

Implements: IDocumentModel<T>

Known implementations: Dessurt<T>, DocOwl<T>, Donut<T>, InfographicVQA<T>, LayoutLMv2<T>, LayoutLMv3<T>, LayoutXLM<T>, LiLT<T>, MATCHA<T>, Nougat<T>, Pix2Struct<T>, UDOP<T>

For Beginners

Document QA is like having a smart assistant that can read a document and answer your questions about it. You show it a document image and ask questions like “What is the total amount?” or “Who signed this contract?”

Example usage:

How It Works

Document QA models answer natural language questions about document content, combining visual understanding with text comprehension.

Methods

Method Summary
Dictionary<string, DocumentQAResult<T>> ExtractFields(Tensor<T> documentImage, IEnumerable<string> fieldPrompts) Extracts specific fields from a document using natural language prompts.
DocumentQAResult<T> AnswerQuestion(Tensor<T> documentImage, string question) Answers a question about a document.
DocumentQAResult<T> AnswerQuestion(Tensor<T> documentImage, string question, int maxAnswerLength, double temperature) Answers a question with generation parameters.
IEnumerable<DocumentQAResult<T>> AnswerQuestions(Tensor<T> documentImage, IEnumerable<string> questions) Answers multiple questions about a document in a batch.