Courseiva

AI-102 Practice Question: Azure AI Document Intelligence pre-built models

You need to extract product codes (e.g., 'PRD-12345') from scanned invoices using Azure AI Document Intelligence. The product codes always follow a pattern of three uppercase letters, a hyphen, and five digits. Which approach should you use?

⚠ Common exam trap

Candidates often assume that the pre-built invoice model can handle custom regex fields, but in Azure AI Document Intelligence, regex field extraction is only available in custom models. The correct approach is to use a custom skill in Azure AI Search with a regex, not to rely on the pre-built model.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Build a custom skill in Azure AI Search using a Python regex

The pre-built invoice model in Azure AI Document Intelligence does not support adding custom fields with regex patterns; custom field extraction with regex is only available in custom models. Option B is correct: you can build a custom skill in Azure AI Search using a Python regex to extract the product codes from the text output of Document Intelligence. This approach allows you to apply a regex pattern to the extracted content, providing accurate and flexible extraction without needing to train a model or use a large language model. Option C is less suitable because training a custom NER model requires labeled data and may not guarantee exact pattern matching. Option D is overkill for a simple regex pattern.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use the pre-built invoice model in Azure AI Document Intelligence with a regex field extraction

    Why it's wrong here

    The pre-built invoice model does not support custom fields with regex; such extraction is only available in custom models within Document Intelligence. Therefore, this approach is not feasible as described.

  • Build a custom skill in Azure AI Search using a Python regex

    Why this is correct

    Building a custom skill in Azure AI Search allows you to run a Python regex on the text extracted by Document Intelligence. This is a straightforward and effective way to extract codes matching the specified pattern.

  • Train a custom NER model in Azure AI Language

    Why it's wrong here

    Training a custom NER model in Azure AI Language is incorrect because it operates on pre-extracted text, not directly on scanned images. The scenario specifically requires processing scanned invoices, which demands Optical Character Recognition (OCR) and document structure understanding, a core capability of Azure AI Document Intelligence. This option is tempting because NER is precisely for extracting specific entities like product codes based on patterns or context. It would be the correct choice if the input was already digitised text, such as from emails or plain text documents, where the visual layout is not a factor.

  • Use Azure OpenAI GPT-4 with document vision to extract the codes

    Why it's wrong here

    While GPT-4 with vision can read text from images, it relies on probabilistic language generation rather than deterministic pattern matching, making it unreliable for extracting codes that follow a fixed regex pattern like three uppercase letters, a hyphen, and five digits. This approach is tempting because GPT-4 excels at interpreting unstructured or ambiguous document content, such as extracting invoice totals from varied layouts, where a rules-based engine would fail.

About these practice questions

This AI-102 question is part of Courseiva's 945-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AI-102 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI-102 exam.