DOCMASTER: A Unified Platform for Annotation, Training, & Inference in Document Question-Answering
Alex Nguyen, Zilong Wang, Jingbo Shang, Dheeraj Mekala
TL;DR
DocMaster introduces an on-device, unified platform for annotation, training, and inference in document-question-answering on PDFs, addressing layout-structural and privacy challenges. It provides three integrated interfaces and a backend-frontend dataflow that preserves word-level layout by combining PDF.js rendering with PyMuPDF bounding boxes, with model training via HuggingFace transformers stored in a local SQL database. The platform supports both layout-aware and text-only models and demonstrates private, end-to-end QA workflows entirely on premises. In a UCSD ISEO deployment, DocMaster delivers substantial throughput gains, illustrating the practical impact of a private, end-to-end document QA solution. The work positions DocMaster as an open-source framework to empower organizations to deploy bespoke, privacy-preserving document QA pipelines.
Abstract
The application of natural language processing models to PDF documents is pivotal for various business applications yet the challenge of training models for this purpose persists in businesses due to specific hurdles. These include the complexity of working with PDF formats that necessitate parsing text and layout information for curating training data and the lack of privacy-preserving annotation tools. This paper introduces DOCMASTER, a unified platform designed for annotating PDF documents, model training, and inference, tailored to document question-answering. The annotation interface enables users to input questions and highlight text spans within the PDF file as answers, saving layout information and text spans accordingly. Furthermore, DOCMASTER supports both state-of-the-art layout-aware and text models for comprehensive training purposes. Importantly, as annotations, training, and inference occur on-device, it also safeguards privacy. The platform has been instrumental in driving several research prototypes concerning document analysis such as the AI assistant utilized by University of California San Diego's (UCSD) International Services and Engagement Office (ISEO) for processing a substantial volume of PDF documents.
