Form Recognizer general document model

This article applies to: Form Recognizer v3.0 checkmark Form Recognizer v3.0.

The General document v3.0 model combines powerful Optical Character Recognition (OCR) capabilities with deep learning models to extract key-value pairs, tables, and selection marks from documents. General document is only available with the v3.0 API. For more information on using the v3.0 API, see our migration guide.

Note

The 2023-02-28-preview version of the general document model adds support for normalized keys.

General document features

  • The general document model is a pre-trained model; it doesn't require labels or training.

  • A single API extracts key-value pairs, selection marks, text, tables, and structure from documents.

  • The general document model supports structured, semi-structured, and unstructured documents.

  • Key names are spans of text within the document that are associated with a value. With the 2023-02-28-preview API version, key names are normalized where applicable.

  • Selection marks are identified as fields with a value of :selected: or :unselected:

Sample document processed in the Form Recognizer Studio

Screenshot of general document analysis in the Form Recognizer Studio.

Key-value pair extraction

The general document API supports most form types and analyzes your documents and extract keys and associated values. It's ideal for extracting common key-value pairs from documents. You can use the general document model as an alternative to training a custom model without labels.

Key normalization (common name)

When the service analyzes documents with variations in key names like Social Security Number, Social Security Nbr, SSN, the output normalizes the key variations to a single common name, SocialSecurityNumber. This normalization simplifies downstream processing for documents where you no longer need to account for variations in the key name.

Screenshot of general document processing in the Form Recognizer Studio.

Development options

Form Recognizer v3.0 supports the following tools:

Feature Resources Model ID
General document model prebuilt-document

Try Form Recognizer

Try extracting data from forms and documents using the Form Recognizer Studio.

You need the following resources:

  • An Azure subscription—you can create one for free

  • A Form Recognizer instance in the Azure portal. You can use the free pricing tier (F0) to try the service. After your resource deploys, select Go to resource to get your key and endpoint.

Screenshot: keys and endpoint location in the Azure portal.

Form Recognizer Studio

Note

Form Recognizer studio and the general document model are available with the v3.0 API.

  1. On the Form Recognizer Studio home page, select General documents

  2. You can analyze the sample document or select the + Add button to upload your own sample.

  3. Select the Analyze button:

    Screenshot: analyze general document menu.

Key-value pairs

Key-value pairs are specific spans within the document that identify a label or key and its associated response or value. In a structured form, these pairs could be the label and the value the user entered for that field. In an unstructured document, they could be the date a contract was executed on based on the text in a paragraph. The AI model is trained to extract identifiable keys and values based on a wide variety of document types, formats, and structures.

Keys can also exist in isolation when the model detects that a key exists, with no associated value or when processing optional fields. For example, a middle name field may be left blank on a form in some instances. Key-value pairs are spans of text contained in the document. For documents where the same value is described in different ways, for example, customer/user, the associated key is either customer or user (based on context).

Data extraction

Model Text extraction Key-Value pairs Selection Marks Tables Common Names
General document ✓*

✓* - Only available in the 2023-02-28-preview API version.

Input requirements

  • For best results, provide one clear photo or high-quality scan per document.

  • Supported file formats:

    Model PDF Image:
    JPEG/JPG, PNG, BMP, and TIFF
    Microsoft Office:
    Word (DOCX), Excel (XLS), PowerPoint (PPT), and HTML
    Read REST API version
    2022/06/30-preview
    Layout
    General Document
    Prebuilt
    Custom

    ✱ Microsoft Office files are currently not supported for other models or versions.

  • For PDF and TIFF, up to 2000 pages can be processed (with a free tier subscription, only the first two pages are processed).

  • The file size for analyzing documents must be less than 500 MB for paid (S0) tier and 4 MB for free (F0) tier.

  • Image dimensions must be between 50 x 50 pixels and 10,000 px x 10,000 pixels.

  • PDF dimensions are up to 17 x 17 inches, corresponding to Legal or A3 paper size, or smaller.

  • If your PDFs are password-locked, you must remove the lock before submission.

  • The minimum height of the text to be extracted is 12 pixels for a 1024 x 768 pixel image. This dimension corresponds to about 8-point text at 150 dots per inch (DPI).

  • For custom model training, the maximum number of pages for training data is 500 for the custom template model and 50,000 for the custom neural model.

  • For custom extraction model training, the total size of training data is 50 MB for template model and 1G-MB for the neural model.

  • For custom classification model training, the total size of training data is 1GB with a maximum of 10,000 pages.

Supported languages and locales

Note

It's not necessary to specify a locale. This is an optional parameter. The Form Recognizer deep-learning technology will auto-detect the language of the text in your image.

Model Language—Locale code Default
General document
  • English (United States)—en-US
English (United States)—en-US

Considerations

  • Keys are spans of text extracted from the document, for semi structured documents, keys may need to be mapped to an existing dictionary of keys.

  • Expect to see key-value pairs with a key, but no value. For example if a user chose to not provide an email address on the form.

Next steps