DCPL Tech
Enterprise AI & Document IntelligenceAuthored by CTO, DCPL Tech

Autonomous Multi-Vendor Document AI &
Multilingual RAG Ingestion Pipeline

How DCPL Tech engineered a zero-leakage, high-precision Document AI and Retrieval-Augmented Generation (RAG) platform: unifying 10+ irregular vendor invoice formats across English and French, tracking 10-epoch machine learning convergence in Weights & Biases, and deploying local quantized LLMs on NVIDIA CUDA GPUs inside Azure Docker infrastructure.

Domain & Industry International Supply & Financial Operations
Languages Handled Bilingual (English & French)
Deployment Model Azure GPU VM (Dockerized Container)
Privacy Guarantee 100% Zero Public Cloud Data Leakage
10+ Formats
Multi-Vendor Normalization

Replaced fragile regex parsers with spatial bounding coordinates to handle diverse supplier templates seamlessly.

< 4 Sec
End-to-End Throughput

Accelerated via NVIDIA CUDA, cuDNN, and 4-bit GGUF quantization on local Ollama runtime.

10 Epochs
Tracked via W&B

Fine-tuned on 260+ enterprise text chunks with customized NLTK tokenization and verified convergence curves.

340+ Pkgs
Containerized on Azure

Packaged deep learning wheels, CUDA runtimes, and Flask REST APIs into a single immutable Docker image.

Operational Bottleneck Manual Entry, Template Chaos & Strict Data Privacy

1. The Operational Bottleneck & Client Mandate

An international enterprise managing high-volume operations across cross-border divisions faced a critical operational bottleneck in accounts payable and vendor reconciliation. Each week, hundreds of supplier invoices arrived across ten distinct vendor templates—formatted as scanned PDFs, digital PDFs, and Word documents.

To compound complexity, the organization operated across international jurisdictions requiring native support for both English and French billing conventions (e.g., handling Montant Hors Taxes (HT), Taxe sur la Valeur Ajoutée (TVA), Total Toutes Taxes Comprises (TTC), alongside standard English subtotal, VAT, and remittance instructions).

Why Standard Off-The-Shelf Solutions Failed:

  • Strict Compliance & Zero Public Cloud Leaks: Corporate governance barred routing sensitive financial invoices through third-party public cloud endpoints (such as OpenAI or commercial SaaS OCR APIs). All document processing, vectorization, and inference had to execute strictly within dedicated client-controlled infrastructure.
  • Borderless & Irregular Tables: Vendor invoices frequently omitted visual table cell gridlines. Traditional OCR tools concatenated line items unpredictably, merging quantity numbers into item descriptions and corrupting calculation matrices.
  • Linguistic Tokenization Errors: Off-the-shelf English LLMs failed on French financial diacritics and accounting terminology, misinterpreting European decimal commas (e.g., 1.250,50 € vs. $1,250.50) as line separators.
Proprietary Engineering Layout Preservation & Spatial Geometry

2. Layout-Aware Spatial Parsing & Extraction Architecture

Rather than relying on naive text extraction that destroys 2D spatial layouts, DCPL Tech’s machine learning team architected a custom parsing engine that treats document pages as geometric coordinate spaces.

Pipeline Architecture: From Raw Multi-Vendor Document to Verified Accounting Record
01. Ingestion Scanned / Digital PDFs & DOCX DPI Normalization & De-skew
02. Spatial OCR Bounding Box Extraction Geometric Coordinates (x,y,w,h)
03. NLP & RAG NLTK Token Alignment Bilingual Entity Recognition
04. Local LLM GGUF Quantized Inference CUDA Accelerated on Ollama
05. Output Structured JSON & CSV Direct ERP Ingestion Bridge

How Spatial Heuristics Conquered 10+ Vendor Templates:

  • Relative Coordinate Binding: When an invoice label like "Invoice Total:" or "Total TTC" is isolated, the parser calculates the nearest right-hand and bottom-facing numeric clusters within an adaptive geometric bounding window, eliminating template-specific hardcoding.
  • Line-Item Table Reassembly: By evaluating vertical alignment thresholds across columns (Quantity, Description, Unit Price, Tax, Subtotal), our algorithm dynamically reconstructs borderless tables into clean, structured arrays even when lines wrap unpredictably.
  • Confidence Scoring & Anomaly Detection: Every extracted field receives a mathematical confidence score based on character recognition certainty and mathematical balance checks (validating whether Subtotal + Tax == Total).
Multilingual Processing Native French & English Accounting Tax Rules

3. Conquering Bilingual Document Complexity (English & French)

International operations required seamless parsing without needing operators to pre-classify documents by language. Our linguistic pipeline applies automatic language detection and specialized parsing dictionaries:

🇫🇷 French Accounting Tax Lexicon
  • Numéro de Facture: Normalized to canonical invoice_number
  • Montant Hors Taxes (HT): Mapped to subtotal_amount
  • Taux & Montant TVA: Extracted into nested tax_breakdown
  • Total TTC: Mapped to total_amount_payable
  • Date d'échéance: Parsed into standard ISO 8601 dates
🇬🇧 English Commercial Lexicon
  • Invoice # / Ref No: Cleaned from irregular header watermarks
  • Net Subtotal / Goods Amount: Reconciled against item tallies
  • Value Added Tax (VAT) / GST: Multi-rate breakdown
  • Gross Total / Amount Due: Cross-checked with payment terms
  • Remittance Details: Automated extraction of IBAN, BIC, and Swift codes
RAG Pipeline & MLOps Custom NLTK Tokens & 10-Epoch W&B Monitoring

4. Custom RAG, Domain Tokenization & 10-Epoch W&B Monitoring

To enable intelligent contextual querying across historical invoices and supplier contracts, DCPL Tech built a specialized Retrieval-Augmented Generation (RAG) pipeline. Rather than dumping raw PDF dumps into naive vector stores, we tailored the entire chunking and embedding architecture:

Domain Tokenization via NLTK

Standard sentence tokenizers shatter tabular invoice data into meaningless fragments. We engineered custom sentence and entity boundary rules using nltk, preserving financial context across 260+ domain text chunks so that line-item descriptions remained bonded to their respective unit prices and vendor metadata.

10-Epoch Fine-Tuning Tracked in Weights & Biases (W&B)

Our ML engineering team tracked loss curves, gradient norms, and retrieval precision across 10 complete training epochs inside Weights & Biases. This systematic experiment tracking enabled us to identify the exact convergence checkpoint that eliminated extraction hallucinations while avoiding overfitting on specific vendor layouts.

GGUF Quantization via Ollama

To achieve sub-second document extraction without requiring expensive multi-GPU clusters, models were quantized into 4-bit and 8-bit GGUF format and orchestrated via local Ollama runtimes, slashing VRAM consumption by 65% with zero perceptible loss in extraction precision.

🚀 NVIDIA CUDA & cuDNN Acceleration

Vector embedding and local LLM transformer layers were compiled directly against NVIDIA CUDA and cuDNN libraries, utilizing tensor cores to process multi-page high-resolution invoice batches in parallel.

Cloud & DevOps Enterprise Dockerization on Azure GPU Infrastructure

5. Enterprise Dockerization & Azure GPU Infrastructure

Deploying deep learning in an enterprise production environment is notorious for "dependency drift"—where system-level CUDA drivers, C++ compilers, and Python packages conflict. DCPL Tech solved this through strict, immutable containerization:

Azure GPU VM Production Deployment 340+ Python Libraries Bundled

Our DevOps engineers engineered a multi-stage Docker build encapsulating over 340 Python dependencies (including PyTorch CUDA binaries, NLTK token dictionaries, spatial geometry libraries, and the Flask REST API bridge). Deployed directly to an Azure GPU-enabled Virtual Machine:

GPU Pass-Through Configured NVIDIA Container Toolkit for direct hardware GPU access inside Docker.
Flask API Microservice Exposed asynchronous endpoints for upload, extraction status, and JSON payload export.
Persistent Azure Mounts Secured invoice storage using Azure Blob mounts with role-based access control (RBAC).
Measurable Impact Client Praise & Operational Efficiency

6. Measurable Business Outcomes & Client Impact

85%+ Reduction in Manual Processing Time

Finance teams that previously spent between 12 to 20 minutes manually transcribing and cross-verifying each complex invoice now process entire supplier batches in seconds, with extraction completed in under 4 seconds per multi-page document.

🔒

100% Data Sovereignty & Zero SaaS Leaks

By deploying fully local GGUF models on Azure GPU infrastructure rather than passing financial records through third-party AI APIs, the client maintains total data isolation and regulatory compliance with international financial privacy mandates.

🌐

Unified Cross-Border Accounting

Both French and English supplier invoices flow into a single unified JSON schema, eliminating manual currency conversions and language-dependent bookkeeping splits.

Enthusiastic Client Demonstration

Presented directly to international stakeholders and business leadership, receiving enthusiastic commendation for reliability, speed, and seamless handling of complex borderless line items.

Technical Architecture Complete AI & Infrastructure Matrix

7. Complete Technology Stack

OCR & Geometry Spatial Bounding Engine
NLP & Tokenization NLTK & spaCy (FR/EN)
Experiment Tracking Weights & Biases (W&B)
GPU Acceleration NVIDIA CUDA & cuDNN
Local LLM Quantization GGUF Format via Ollama
API Microservice Python Flask REST Bridge
Containerization Docker (340+ Packages)
Cloud Infrastructure Azure GPU Virtual Machine
Explore Our Full Capabilities

Looking to Build or Deploy Custom AI & Automation?

Discover DCPL Tech's comprehensive AI Practice covering Speech-to-Text MoM generation, Selenium web automation, Computer Vision, Local LLM architectures, and MLOps.

View AI Technology Practice →
Enterprise AI Architecture Consultation

Discuss Your Document AI & RAG Architecture with our CTO

Whether you need to parse complex documents with zero cloud leakage, deploy quantized LLMs on your own infrastructure, or build custom RAG pipelines, let's talk technical feasibility.