• Ankur Goyal's avatar
    Add DocumentQuestionAnswering pipeline (#18414) · 2ef77421
    Ankur Goyal authored
    
    
    * [WIP] Skeleton of VisualQuestionAnweringPipeline extended to support LayoutLM-like models
    
    * Fixup
    
    * Use the full encoding
    
    * Basic refactoring to DocumentQuestionAnsweringPipeline
    
    * Cleanup
    
    * Improve args, docs, and implement preprocessing
    
    * Integrate OCR
    
    * Refactor question_answering pipeline
    
    * Use refactored QA code in the document qa pipeline
    
    * Fix tests
    
    * Some small cleanups
    
    * Use a string type annotation for Image.Image
    
    * Update encoding with image features
    
    * Wire through the basic docs
    
    * Handle invalid response
    
    * Handle empty word_boxes properly
    
    * Docstring fix
    
    * Integrate Donut model
    
    * Fixup
    
    * Incorporate comments
    
    * Address comments
    
    * Initial incorporation of tests
    
    * Address Comments
    
    * Change assert to ValueError
    
    * Comments
    
    * Wrap `score` in float to make it JSON serializable
    
    * Incorporate AutoModeLForDocumentQuestionAnswering changes
    
    * Fixup
    
    * Rename postprocess function
    
    * Fix auto import
    
    * Applying comments
    
    * Improve docs
    
    * Remove extra assets and add copyright
    
    * Address comments
    Co-authored-by: default avatarAnkur Goyal <ankur@impira.com>
    2ef77421
test_pipelines_document_question_answering.py 9.96 KB