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

Extraction Configuration

Configuration parameters specific to Extraction models.

There are also Basic Model Configuration which can be used with all models.

Optional Features Configuration

Enable or disable Optional Features.

The default activation states for Optional Features are set on the platform. Any values set here will override the defaults.

Leave empty or null to use the default platform values.

For example: if the Polygon feature is enabled on the platform, and polygon is explicitly set to false in the parameters ⇒ the Polygon feature will not be enabled for the API call.

Only the model_id is required.

inference_params = InferenceParameters(
    # ID of the model, required.
    model_id="MY_MODEL_ID",

    # Optional Features: set to `True` or `False` to override defaults

    # Enhance extraction accuracy with Retrieval-Augmented Generation.
    rag=None,
    # Extract the full text content from the document as strings.
    raw_text=None,
    # Calculate bounding box polygons for all fields.
    polygon=None,
    # Boost the precision and accuracy of all extractions.
    # Calculate confidence scores for all fields.
    confidence=None,
    
    # ... any other options ...
)

Dynamic Model Options

These options allow changing how the model performs an inference on a per-call basis.

These features can only be used via API.

These advanced features are not meant for improving the model's overall accuracy.

Instead, make sure the Data Schema has been properly optimized.

Text Context

Give additional guidelines to the model to help it better process a specific document.

Useful when you have important context on the document, and when there isn't sufficient information on the document itself to provide that context to the model.

This is a free-form text format.

As an example, you could remove ambiguity for country or regional differences:

"The parts supplier is in Canada, these amounts are in CAD", if there is no address on the document.

Data Schema

Allows changing the Data Schema on a per-call basis: directly modify the Data Schema: add, remove, or change fields.

The typical use case is when the data needing to be extracted change based on internal business logic.

To download the JSON string appropriate for your model:

  1. Go to your model's page

  2. On the left-hand menu, click on "General Settings"

  3. Scroll down to the "Actions" section

  4. Click on the "Download Data Schema" button:

    The "Download Data Schema" button

Code Sample

The Data Schema can be passed as a JSON string or by instantiating the appropriate classes.

If passed as a JSON string, it will be validated in the client before being sent to the server.

Only the model_id is required.

Last updated

Was this helpful?