MPLUGDocOwl<T>
Models & Types · AiDotNet.VisionLanguage.Document
mPLUG-DocOwl: modular MLLM for document understanding with visual abstractor.
Inheritance: NeuralNetworkBase<T> → VisionLanguageModelBase<T> → MPLUGDocOwl<T>
Implements: IDocumentUnderstandingModel<T>
For Beginners
mPLUG-DocOwl is a document understanding model from Alibaba with a visual abstractor for efficient document processing. Default values follow the original paper settings.
How It Works
mPLUG-DocOwl (Alibaba, 2023) is a modularized multimodal large language model for document understanding. It uses a visual abstractor module to compress high-resolution document image features into a compact set of visual tokens, bridging the ViT encoder and LLM decoder for efficient document VQA, information extraction, and document classification.
References:
- Paper: “mPLUG-DocOwl: Modularized Multimodal Large Language Model for Document Understanding” (Alibaba, 2023)
Example
// Create an mPLUG-DocOwl model for document understanding
// with visual abstractor for efficient document feature compression
var architecture = new NeuralNetworkArchitecture<double>(
inputType: InputType.TwoDimensional,
taskType: NeuralNetworkTaskType.ImageClassification,
inputHeight: 224, inputWidth: 224, inputDepth: 3, outputSize: 512);
// ONNX inference mode with pre-trained model
var model = new MPLUGDocOwl<double>(architecture, "mplugdocowl.onnx");
// Training mode with native layers
var trainModel = new MPLUGDocOwl<double>(architecture, new MPLUGDocOwlOptions());
Constructors
| Constructor | Summary |
|---|---|
MPLUGDocOwl(NeuralNetworkArchitecture<T> architecture, MPLUGDocOwlOptions options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer) |
|
MPLUGDocOwl(NeuralNetworkArchitecture<T> architecture, string modelPath, MPLUGDocOwlOptions options) |
Properties
| Property | Summary |
|---|---|
bool IsOcrFree { get; } |
|
int DecoderEmbeddingDim { get; } |
|
int EmbeddingDimension { get; } |
|
int MaxGenerationLength { get; } |
Methods
| Method | Summary |
|---|---|
ModelMetadata<T> GetModelMetadata() |
|
Tensor<T> AnswerDocumentQuestion(Tensor<T> documentImage, string question) |
|
Tensor<T> EncodeImage(Tensor<T> image) |
|
Tensor<T> ExtractText(Tensor<T> documentImage) |
|
Tensor<T> GenerateFromImage(Tensor<T> image, string prompt) |
Generates text from a document image using mPLUG-DocOwl’s visual abstractor pipeline. |