NLP & Document AI
Applied ML articles on forecasting, feature engineering, NLP, production ML, graph analytics, conformal prediction, label engineering, and decision-oriented modeling — from real projects at Sofrecom (Orange Wholesale), Tunisia Telecom, Kiota Intelligence, and Zindi.
Insights on NLP, document AI, text representation, and practical language-model workflows. Browse all insights in this category, or view all insights.
Document AI: 4 Production Patterns From PDF to Decision
Most organisations do not really want "document AI" — they want document in, reliable business action out. I use four patterns — direct extraction, classify-and-route, context-augmented extraction, and human review — and the model matters less than the architecture around it.
Result: Start with the simplest pattern that supports a trustworthy decision, then add routing, external context, or human review only when document variability and business risk justify the extra complexity.
Document AI Starts Before Extraction: Route First
In Document AI, an invoice, a contract, an identity document, and a free-form letter are different problems. A production system does not just extract fields - it classifies the document, routes it to the right extraction pipeline, then extracts.
Result: The routing layer decides which schema, model tier, and validation rules apply - and whether uncertainty is high enough to send the document to a human review queue.
Preprocessing Is Vocabulary Design for Noisy NLP Text
In noisy short-text NLP, the model can lose before training starts. Spelling mistakes, abbreviations, slang, and partial sentences fragment the vocabulary for sparse methods such as TF-IDF.
Result: Preprocessing became a vocabulary-design decision: normalise what is safely equivalent, review unknown tokens, and preserve terms that carry domain meaning instead of applying blind dictionary correction.
NLP Classification in 2018 vs LLMs Today: The Interface Changed, the Engineering Didn't
In 2018 I ranked 1st in an IBM Watson AI Lab competition building an NLP classification workflow. Today, a first prototype for a similar problem starts much faster: a system prompt, a structured output schema, one LLM call.
The interface changed — the engineering discipline did not. Clear instructions, useful examples, and well-defined contracts still decide quality, exactly as they did in 2018.
Result: Same engineering principles, expressed through better tools. A vague task definition still creates unreliable outputs.
Document AI: Route First, Classify Before Extraction
The high-leverage decision in Document AI is routing: classify the document type before extraction to apply the right pipeline, schema, and validation. Different documents need different pipelines for quality, cost, latency, and maintainability.
Routing layer decides pipeline, schema, model tier, need for table/long-context reasoning, and whether uncertainty warrants review. Unknown/low-confidence documents should be flagged and queued — don't force them into a pipeline.
Result: Route first. Extract second. Validate always. Better extraction quality with safer handling of unknown document types.
Share on LinkedIn →