Document JSON

To import annotations to a Document Project, you need to import a JSON file of the annotations.

The annotations JSON in Document Project contains four main fields: metadata, instances, tags, and freeText.

{
    "metadata": {},
    "instances": [],
    "tags": [],
    "freeText": ""
}

🚧

The fields that are marked in bold in the descriptions are mandatory.

Metadata

{
    "name": "example1.txt",
    "url": "string"
 }

Description:

  • "name": “string” - Document name as stated in the CSV file or generated by SDK.
  • “url”: “string” - The URL from the attached CSV.

Instances

[
    {
      "className": "Spam",
      "start": 562,
      "end": 634,
      "attributes": [
        {
          "name": "first",
          "groupName": "Type"
        }
      ]
    }
]

Description:

  • “className”: string - Class name (one of the class names in “classes.json”).
  • “start”: number - The index of the instance’s first character. The index of the first character is 0.
  • “end”: number - The index of the instance’s last character.
  • “attributes”: array of objects - List of attributes for the instance.
    • "name": string - Attribute name
    • "groupName": string - Attribute group name

Tags

[
        "Spam",
        "Non-Spam"
]

Description:

  • "Tag": string - The names of the tags that are added to the document.

Free text

"freeText": "the document describes residency"

Description:

  • "freeText": string - The text entered in the Free Text section in the editor.

Did this page help you?