For the complete documentation index, see llms.txt. This page is also available as Markdown.

Extraction Result

Reference documentation on processing an Extraction result using the Mindee SDKs.

You'll need to have a response object as described in the Response Processing section.

Accessing Data Schema Fields

Fields are completely dynamic and depend on your model's Data Schema Overview.

In the client library, you'll have access to the various fields as a key-value mapping type (Python's dict, Java's HashMap, etc).

Accessing a field is done via its name in the Data Schema.

Each field will be one of the following types:

  • A single value, SimpleField class.

  • A nested object (sub-fields), ObjectField class.

  • A list or array of fields, ListField class.

SimpleField - Single-Value Field

Basic field type having the value attribute. See the value section below.

In addition, the Simplefield class has confidence and locations attributes.

Using the response deserialized object from either the polling response or a webhook payload.

from mindee.v2 import ExtractionResponse

def handle_response(response: ExtractionResponse):
    fields = response.inference.result.fields

    my_simple_field = fields.get_simple_field("my_simple_field")

Using the response deserialized object from either the polling response or a webhook payload.

handleResponse(response) {
  const fields = response.inference.result.fields;

  const simpleField = fields.getSimpleField("my_simple_field");
}

Using the $response deserialized object from either the polling response or a webhook payload.

use Mindee\V2\Product\Extraction\ExtractionResponse;

public function handleResponse(ExtractionResponse $response)
{
    $fields = $response->inference->result->fields;

    $simpleField = $fields->getSimpleField('my_simple_field');
}

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

value

The extracted data value. Possible types: string, numeric, boolean. All types can be null.

On the platform, you can specify date and classification types. These are returned as strings.

For numeric values, the API always returns number types, meaning there is no support for explicit float or integer typing. As a result, the SDK always uses floating types for numeric values, if supported by the language. This ensures consistent typing within the SDK with no loss of information.

Using the response deserialized object from either the polling response or a webhook payload.

The value attribute is an Object type under the hood.

You should use the explicitly-typed accessors, this is recommended for clarity. Take a look at your Data Schema to know which typed accessor to use.

If the wrong accessor type is used, an exception will be thrown, something like this:

Using the $response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

The value attribute is an Object type under the hood.

You'll need to explicitly declare the type, otherwise the code will likely not compile. Take a look at your Data Schema to know which type to declare.

If the wrong type method is used, an exception will be thrown, something like this:

The Value attribute is a dynamic type under the hood.

You should explicitly declare the type, this is recommended for clarity. Take a look at your Data Schema to know which type to declare.

If the wrong type is declared, an exception will be raised, something like this:

ObjectField - Nested Object Field

Field having a fields attribute which is a hash table (Python's dict, Java's HashMap, etc) of sub-fields. See the fields section below.

In addition, the ObjectField class has confidence and locations attributes.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the $response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

fields

The sub-fields as a key-value mapping type (Python dict, Java HashMap, etc).

Accessing a sub-field is done via its name in the Data Schema.

Each sub-field will be a Extraction Resultor a ListField - List of Fields.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the $response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

ListField - List of Fields

Field having an items attribute which is a list of fields. See the items section below.

In addition, the ListField class has a confidence attribute.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the $response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

items

List of fields as a variable-length array type (Python list, JavaScript Array, Java List, etc).

Each item in the list will be one of:

There will not be a mix of both types in the same list.

List of SimpleField

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the $response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

List of ObjectField

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the $response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Optional Field Attributes

These field attributes are only filled when their respective features are activated.

The attributes are always present even when not activated.

confidence

The confidence level of the extracted value.

The data are only filled if the Confidence Score & Accuracy Boost feature is activated.

The instance property is always present, however if the feature is not activated, it will always be empty (the exact type depends on language used: null, undefined, None, etc)

The attribute value will be a one of: Certain, High, Medium, Low . The language-appropriate enum type will be available for your convenience, mapped from a string value.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the $response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

locations

A list of the field's locations on the document.

The data are only filled if the Polygons (Bounding Boxes) feature is activated.

It's possible for a single field to have multiple locations, for example when an invoice item spans two pages.

Each location has a page index and a Polygon.

Page indexes are 0-based, so the first page is 0.

A Polygon class contains a list of Points, the specific implementation will depend on the language.

Points are listed in clockwise order, where index 0 is top left.

Point X,Y coordinates are normalized floats from 0.0 to 1.0, relative to the page dimensions.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the $response deserialized object from either the polling response or a webhook payload.

Using the $response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Using the response deserialized object from either the polling response or a webhook payload.

Last updated

Was this helpful?