Sensible

The Sensible Developer Hub

Welcome to the Sensible developer hub. You'll find comprehensive guides and documentation to help you start working with Sensible as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Field query object

A field is the basic unit for writing a SenseML query to extract data from a PDF. The output of a field is a JSON key-value pair that structures the extracted data.

Here is a simple example of a field:

{

  "fields": [
    {
      "id": "name_of_output_key",
      "anchor": "an anchor is some text to match. An anchor can be an array of matches",
      "method": {
        "id": "label",
         "position": "below"
      }
    },
  ]
}

The following image shows this example in the Sensible app:

As the preceding image shows, this is the output of the example field:

{
  "name_of_output_key": {
    "type": "string",
    "value": "Below the matching anchor, this is the data to extract. The anchor is a label for this data."
  }
}

Field parameters

Top-level components for a Field object are as follows:

ParameterValueDescription
id (required)stringThe ID is the name of the field, which Sensible uses as the key in the structured key/value output. If two fields share the same ID, then the second field acts as a fallback if the first returns null. For example, use fallbacks when you want to use a single config to extract data from a document whose formatting can vary. For example, a certificate of insurance can vary in formatting when a new revision is released yearly.
anchor (required)objectThe anchor identifies one or more lines of text in the document where we start method execution. Can be a string, Match object, or array of Match objects. For more information, see Anchor object and Match object.
method (required)objectThe method describes how we want to expand from that anchor and grab your target data. For more information, see Methods and Method object.
typeaccountingCurrency, address, boolean, currency, date, distance, images, name, number, paragraph, percentage, string, table, weightThe type of data we want to extract. This type is also specified in the structured output.
matchfirst,last,allIf there are multiple matches for the anchor, which one to use.
all returns an array of values for each match, under a single field id key. For example something like:
{
"name_of_output_key": [
{
"type": "string",
"value": "extracted data for first match"
},
{
"type": "string",
"value": "extracted data for second match"
} ]
}

Example

The following field example uses all the top-level parameters:

{
  "fields": [
    {
      "id": "name_of_output_key",
      "anchor": "text to match",        
      "type":"accountingCurrency",
      "match":"last",
      "method": {
        "id": "row",
        "position": "right",
      }
    }
  ],
}

Updated 4 days ago


Field query object


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.