factory
Define the base factory for creating task providers.
AbstractTaskMixin
AbstractTaskProviderFactory
Bases: ABC
, BaseModel
The abstract interface for a provider task factory.
We need to define the basic interface for how we can create task providers. The task provider factory is responsible for allowing the creation of task providers for specific backends, (i.e. Anthropic, OpenAI, etc.)
Source code in docprompt/tasks/factory.py
AmazonTaskProviderFactory
Bases: AbstractTaskProviderFactory
, PageOCRMixin
The task provider factory for Amazon.
Source code in docprompt/tasks/factory.py
get_page_ocr_provider(**kwargs)
Get the page OCR provider.
Source code in docprompt/tasks/factory.py
AnthropicTaskProviderFactory
Bases: AbstractTaskProviderFactory
, PageClassificationMixin
, PageMarkerizationMixin
, PageTableExtractionMixin
The task provider factory for Anthropic.
NOTE: We can either utilize the standard Anthropic API or we can utilize AWS Bedrock. In the event that a user wants to utilize the standard Anthropic API.
Source code in docprompt/tasks/factory.py
get_page_classification_provider(**kwargs)
Get the page classification provider.
Source code in docprompt/tasks/factory.py
get_page_markerization_provider(**kwargs)
Get the page markerization provider.
Source code in docprompt/tasks/factory.py
get_page_table_extraction_provider(**kwargs)
Get the page table extraction provider.
Source code in docprompt/tasks/factory.py
DocumentVQAMixin
Bases: AbstractTaskMixin
, Generic[TTaskProvider]
Mixin for multi-page document VQA task.
Source code in docprompt/tasks/factory.py
GCPTaskProviderFactory
Bases: AbstractTaskProviderFactory
, PageOCRMixin
The task provider factory for GCP.
Source code in docprompt/tasks/factory.py
get_page_ocr_provider(project_id, processor_id, **kwargs)
Get the page OCR provider.
Source code in docprompt/tasks/factory.py
PageClassificationMixin
Bases: AbstractTaskMixin
, Generic[TTaskProvider]
Mixin for page classification task.
Source code in docprompt/tasks/factory.py
PageMarkerizationMixin
Bases: AbstractTaskMixin
, Generic[TTaskProvider]
Mixin for page markerization task.
Source code in docprompt/tasks/factory.py
PageOCRMixin
Bases: AbstractTaskMixin
, Generic[TTaskProvider]
Mixin for page OCR task.
Source code in docprompt/tasks/factory.py
PageRasterizationMixin
Bases: AbstractTaskMixin
, Generic[TTaskProvider]
Mixin for page rasterization task.
Source code in docprompt/tasks/factory.py
PageSegmentationMixin
Bases: AbstractTaskMixin
, Generic[TTaskProvider]
Mixin for page segmentation task.
Source code in docprompt/tasks/factory.py
PageTableExtractionMixin
Bases: AbstractTaskMixin
, Generic[TTaskProvider]
Mixin for page table extraction task.
Source code in docprompt/tasks/factory.py
PageTableIdentificationMixin
Bases: AbstractTaskMixin
, Generic[TTaskProvider]
Mixin for page table identification task.
Source code in docprompt/tasks/factory.py
PageVQAMixin
Bases: AbstractTaskMixin
, Generic[TTaskProvider]
Mixin for page VQA task.