process_visual_data = (AddData({"question": "What is described here?"})|TransformersDocumentQandA()).set_name("Visual data processing")
The TransformersDocumentQandA task is utilized for processing visual data because it is effective at handling the structural data typically found in documents. About default parameters, see:
The set_name method is utilized to enhance the clarity and structure of step-by-step execution logging.
This pipeline extracts images from pages, processes them, and saves their descriptions in memory for future formatting. Theprocess_visual_datapipeline is executed for each found image.
The set_name method is utilized to enhance the clarity and structure of step-by-step execution logging.
Similarly to image_processing pipeline, this pipeline extracts tables from pages, processes them, and saves their descriptions in memory for future formatting. The process_visual_datapipeline is executed for each found table.
The set_namemethod is utilized to enhance the clarity and structure of step-by-step execution logging.
This pipeline extracts texts from pages, processes them with TransformersTextSummarizationTask, and saves text summaries in memory for future formatting.
The set_name method is utilized to enhance the clarity and structure of step-by-step execution logging.
Note that even though nested pipelines are added sequentially one after another, they are added to the main pipeline rather than to each other, as the ExecutionSchema of the main pipeline was already initialized.
Run program
We wrapped pipeline in Evaluator and provided logging_level to log messages:
res =Evaluator( pipeline, logging.INFO).run({"path_to_file": f"{PATH}/pfizer-report.pdf","pages": [10, 11, 12]})
Inputs
"path_to_file": path that directs to a file that should be in programs.multimodal.pdf_document_processing.
"pages": pages that will be used.
Results
The results should include formatted output containing descriptions for images and tables, as well as text summaries for each page.