Text Annotation JSON

Prev Next

This page outlines the JSON format used for both input and output in the Text Classification Studio. It defines how NLP (Natural Language Processing) data is structured using JavaScript Object Notation (JSON). The format includes the entity's content along with its associated metadata, making it compatible with DDOE's platform.

Read here about the NLP Annotation Studio.


Input JSON format

{
  "shebang": "dataloop", // Indicates the data is intended for Dataloop platform
  "metadata": {
    "dltype": "text-classification", // Type of task: text classification
    "callId": "3154919731610621952", // Unique call identifier
    "companyId": "262834820328732"   // Company/project ID within the platform
  },
  "formatting": "html", // Specifies that the content is HTML-formatted
  "elements": [
    {
      "key": "task-a", // Unique ID for this content block
      "annotatable": true, // Set to true so annotators can label this
      "content": "<p><strong>[A_17]</strong> Hello, this is XYZ from ABC.<br><br><strong>[T_1881]</strong> Everything went well during the call.<br><br><strong>[SELLER_1017]</strong> Yes, I think we're focused on the right approach.<br><br><strong>[PROSPECT_1881]</strong> I’ll definitely follow up on that.</p>" // HTML content for annotation
    },
    {
      "key": "text-b", // Contextual or reference text
      "annotatable": false, // Not for annotation
      "content": "<p>Intent: not_decision_maker<br>Does the customer indicate that they are not the decision-maker?<br><br><br><br> <a href=\"https://gong.app.gong.io/call?id=3154919731610621952&amp;highlights=%5B%7B%22type%22%3A%22SHARE%22%2C%22from%22%3A48%2C%22to%22%3A78%7D%5D\">URL to Call 3154919731610621952</a></p>" // Instruction and external reference
    },
    {
      "key": "task-c",
      "annotatable": true,
      "content": "<p><strong>Hello</strong>, this is XYZ from ABC. Everything went well during the call.</p>"
    },
    {
      "key": "text-d",
      "annotatable": false,
      "content": "<p>Your html texts</p>"
    },
    {
      "key": "text-e",
      "annotatable": false,
      "content": "<p>Your html texts</p>"
    },
    {
      "key": "task-e",
      "annotatable": true,
      "content": "<p>Your html texts</p>"
    },
    {
      "key": "task-g",
      "annotatable": true,
      "content": "<p>Your html texts</p>"
    }
  ]
}

Output JSON format

{
	"annotations": [
		{
  "id": "6569a9bb64a270e5cc8ae821",
  "datasetId": "64b4d464bdf1fccfe1ba5790",
  "url": "https://gate.dataloop.ai/api/v1/items/6569a9bb64a270e5cc8ae821",
  "dataset": "https://gate.dataloop.ai/api/v1/datasets/64b4d464bdf1fccfe1ba5790",
  "createdAt": "2023-12-01T09:39:07.264Z",
  "dir": "/",
  "filename": "/Architecture.txt",
  "type": "file",
  "hidden": false,
  "metadata": {
    "system": {
      "encoding": "7bit",
      "isBinary": false,
      "mimetype": "text/plain", // JSON: "application/json", HTML: "text/html", CSS: "text/css", and Text: "text/plain".
      "originalname": "Architecture.txt",
      "refs": [
        {
          "id": "65941368b9bcb6a3fb4a598d",
          "type": "task"
        },
        {
          "id": "65941368b9bcb6ff2b4a598f",
          "type": "assignment"
        },
        {
          "id": "67b5b294dcaf2107243df699",
          "type": "assignment"
        },
        {
          "id": "67b5b294dcaf213f133df697",
          "type": "task"
        }
      ],
      "size": 465,
      "taskStatusLog": []
    }
  },
  "name": "Architecture.txt",
  "creator": "user@dataloop.ai",
  "updatedAt": "2023-12-01T09:39:07.304Z",
  "updatedBy": "user@dataloop.ai",
  "stream": "https://gate.dataloop.ai/api/v1/items/6569a9bb64a270e5cc8ae821/stream",
  "thumbnail": "https://gate.dataloop.ai/api/v1/items/6569a9bb64a270e5cc8ae821/thumbnail",
  "annotations": [
    {
      "id": "67b5b27511348cc12361627e",
      "datasetId": "64b4d464bdf1fccfe1ba5790",
      "itemId": "6569a9bb64a270e5cc8ae821",
      "url": "https://gate.dataloop.ai/api/v1/annotations/67b5b27511348cc12361627e",
      "item": "https://gate.dataloop.ai/api/v1/items/6569a9bb64a270e5cc8ae821",
      "dataset": "https://gate.dataloop.ai/api/v1/datasets/64b4d464bdf1fccfe1ba5790",
      "type": "text_mark",
      "label": "sentence-2",
      "attributes": [],
      "coordinates": {
        "end": 465,
        "label": "sentence-2",
        "start": 282,
        "type": "block"
      },
      "metadata": {
        "system": {
          "attributes": {},
          "automated": false,
          "clientId": "9df88b6b-44f5-4946-a6e8-ce32e2a8553b",
          "endFrame": 1,
          "endTime": 0,
          "frame": 0,
          "itemLinks": [],
          "objectId": "4",
          "openAnnotationVersion": "1.90.2-prod.0",
          "recipeId": "6569aa2b27d7bdd0605b8fc9",
          "snapshots_": [],
          "startTime": 0,
          "system": false
        },
        "user": {}
      },
      "creator": "user@gmail.com",
      "createdAt": "2025-02-19T10:29:09.919Z",
      "updatedBy": "user@gmail.com",
      "updatedAt": "2025-02-19T10:29:09.919Z",
      "hash": "83855a80fca7f5ef19fc57f67fcafe7af1fbd666",
      "source": "ui"
    }
  ],
  "annotationsCount": 1,
  "annotated": true
}
	]
}

Dictionary Table

Key Name

Definition

Parent Key

id

Unique identifier for the item

Root

datasetId

Identifier for the dataset containing the item

Root

url

API URL to access the item

Root

dataset

API URL to access the dataset

Root

createdAt

Timestamp of when the item was created

Root

dir

Directory path of the item

Root

filename

File name of the item

Root

type

Type of the item (e.g., file)

Root

hidden

Boolean indicating if the item is hidden

Root

metadata

Metadata associated with the item

Root

system

System-related metadata

metadata

encoding

Encoding format of the file

system

isBinary

Boolean indicating if the file is binary

system

mimetype

MIME type of the file

system

originalname

Original name of the file

system

refs

List of references related to the file

system

id

Identifier of the reference

refs

type

Type of reference (e.g., task, assignment)

refs

size

Size of the file in bytes

system

taskStatusLog

Log of task statuses related to the item

system

name

Name of the item

Root

creator

Email of the user who created the item

Root

updatedAt

Timestamp of the last update

Root

updatedBy

Email of the user who updated the item

Root

stream

API URL to stream the item

Root

thumbnail

API URL to access the thumbnail

Root

annotations

List of annotations associated with the item

Root

id

Unique identifier for the annotation

annotations

datasetId

Identifier of the dataset associated with the annotation

annotations

itemId

Identifier of the item being annotated

annotations

url

API URL to access the annotation

annotations

item

API URL to access the annotated item

annotations

dataset

API URL to access the dataset of the annotation

annotations

type

Type of annotation (e.g., text_mark)

annotations

label

Label assigned to the annotation

annotations

attributes

List of attributes assigned to the annotation

annotations

coordinates

Coordinates of the text annotation

annotations

end

Ending position of the annotation in text

coordinates

label

Label associated with the annotation block

coordinates

start

Starting position of the annotation in text

coordinates

type

Type of annotation block

coordinates

metadata

Metadata related to the annotation

annotations

system

System metadata for annotation

metadata

attributes

Additional system attributes

system

automated

Boolean indicating if annotation was automated

system

clientId

Client ID associated with annotation

system

endFrame

End frame of the annotation

system

endTime

End time of the annotation

system

frame

Frame index of the annotation

system

itemLinks

Links to related annotation items

system

objectId

Object ID associated with the annotation

system

openAnnotationVersion

Version of annotation system

system

recipeId

Recipe identifier for annotation

system

snapshots_

Snapshots related to the annotation

system

startTime

Start time of the annotation

system

system

Boolean indicating if annotation is system-generated

system

user

User-related metadata

metadata

creator

Email of the user who created the annotation

annotations

createdAt

Timestamp when annotation was created

annotations

updatedBy

Email of the user who updated the annotation

annotations

updatedAt

Timestamp when annotation was last updated

annotations

hash

Unique hash identifier for annotation

annotations

source

Source of the annotation (e.g., UI)

annotations

annotationsCount

Total count of annotations for the item

Root

annotated

Boolean indicating if the item has annotations

Root