An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
Hi Becky,
What you’re running into is a known behaviour of the current custom-neural extraction engine: if two tokens that look alike sit on the same OCR text line (or their labelled regions overlap by even a pixel or two), the model may treat them as one “long” value. Microsoft has acknowledged that field / cell merging can still happen when character spacing is tight even in v4 GA and there’s no official fix date yet.
Why it happens
Tight reading-order grouping – internally the model builds “chunks” from the OCR line. If both material codes are caught in the same chunk, they are emitted as one string.
Over-lapping or generous labels – if, during labelling, a bounding box touches any part of the neighbour code, the model learns they belong together.
Lack of negative examples – when most training docs only show a single code per line, the model generalises that pattern and struggles when a second code appears elsewhere.
Practical mitigations
| Action | Details & tips |
|---|---|
| Tighten your labels | In Document Intelligence Studio, switch to Draw region (or Bounding-box) and zoom in – the box should hug only the digits you need. Avoid Shift-selecting a whole line. Microsoft moderators call this out as the first thing to try (learn.microsoft.com). |
| Tighten your labels | In Document Intelligence Studio, switch to Draw region (or Bounding-box) and zoom in – the box should hug only the digits you need. Avoid Shift-selecting a whole line. Microsoft moderators call this out as the first thing to try ([learn.microsoft.com](https://learn.microsoft.com/en-us/answers/questions/2180762/azure-document-intelligence-custom-model-fails-to"Azure Document Intelligence: Custom Model Fails to Separate Adjacent Document Number and Date - Microsoft Q&A")). |
| Add “difficult” samples | Retrain with 10-20 extra POs where the two codes are close together and separately label each instance. Variety helps the model learn the separator. |
| Use the right schema | If the material code appears repeatedly in a line-items grid, label the whole table as a dynamic table and let each code be its own cell instead of a top-level field. |
| Try a Template model | If your PO layout is stable, train a custom template model (anchor on the “Material #” key). Template models use positional anchors and rarely merge distant fields ([learn.microsoft.com](https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/train/custom-model?view=doc-intel-4.0.0&utm_source=chatgpt.com"Custom document models - Document Intelligence - Azure AI services")). |
| Regex post-processing | As a safety net, split strings downstream: re.findall(r'[A-Z0-9]{5,12}', value) will usually separate two concatenated codes. |
| Upgrade & re-test | Make sure you’re on the latest GA API 2024-11-30 and re-publish the model; a few token-splitting tweaks shipped in April 2025. |
| Raise a support ticket | If merging still blocks production, open a ticket with a redacted sample document. Support can forward it to the DI product team, who track these edge cases. |
Until Microsoft rolls out a model change, the best defence is precise labelling plus a light post-processing rule that splits any accidental concatenations. In most projects we see the error rate drop to near-zero once the bounding boxes are tightened and a regex fallback is in place.
Hope this gets your POs flowing again—let me know if you’d like example code or have any follow-up questions!
Best Regards,
Jerald Felix