Text Project - Import annotation format
To import annotations to a Text Project, you need to import a JSON file of the annotations.
The annotations JSON in Text 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.
- "status": “string” - The document status. It can be:
NotStarted
,InProgress
,QualityCheck
,Returned
,Skipped
, orCompleted
. - “projectId”: "integer" - The project ID.
- "annotatorEmail": “string” - The assigned annotator’s email address.
- "qaEmail": “string” - The assigned QA’s email address.
- "lastAction": objects - The user who last made changes to an instance.
- "email": “string” - The email address of the last user who made the changes.
- "timestamp": "integer" - The date and time when the last change was made. Format example: "timestamp": “1626152220563”
- The object
name
is mandatory.- If the object
lastAction
exists, then thetimestamp
are mandatory.
Instances
Entity
[
{
"type": "entity",
"className": "Spam",
"start": 562,
"end": 634,
"attributes": [
{
"name": "first",
"groupName": "Type"
}
]
}
]
Description:
- “type”: string - Instance type. If it’s
entity
, then the instance is an annotation. If it’stag
, then the instance is a tag. - “classId”: integer - Class ID (one of the class IDs in “classes.json”)
- “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.
- “id”: "integer" - Attribute ID (must be in “classes.json”)
- “groupId”: integer - Attribute group ID (must be in “classes.json”)
- "name": string - Attribute name
- "groupName": string - Attribute group name
- “creationType”: string - The way in which the instance was created. Currently, only
manual
is the available option. - "createdBy": objects
- "email": string - The email address of the user who created the instance.
- "role": string - The role of the user who created the instance.
- "createdAt": string - The date and time when the instance was created.
- "updatedBy": objects
- "email": string - The email address of the user who updated the instance.
- "role": string - The role of the user who updated the instance.
- "updatedAt": string - The date and time when the instance was updated.
- If the objects
createdBy
andupdatedBy
exist, thenrole
are mandatory.- The fields
start
andend
are mandatory.- If the array
attributes
exists, it can be either empty or it can contain objects with the following fields:name
andgroupName
.
Tags
[
{
"type": "tag",
"className": "Spam",
"attributes": [
{
"name": "first",
"groupName": "Type"
}
]
}
]
Description:
- “type”: string - Instance type. If it’s
entity
, then the instance is an annotation. If it’stag
, then the instance is a tag. - “classId”: integer - Class ID (one of the class IDs in “classes.json”)
- “className”: string - Class name (one of the class names in “classes.json”).
- “attributes”: array of objects - List of attributes for the instance.
- “id”: "integer" - Attribute ID (must be in “classes.json”)
- “groupId”: integer - Attribute group ID (must be in “classes.json”)
- "name": string - Attribute name
- "groupName": string - Attribute group name
- “creationType”: string - The way in which the instance was created. Currently, only
manual
is the available option. - "createdBy": objects
- "email": string - The email address of the user who created the instance.
- "role": string - The role of the user who created the instance.
- "createdAt": string - The date and time when the instance was created.
- "updatedBy": objects
- "email": string - The email address of the user who updated the instance.
- "role": string - The role of the user who updated the instance.
- "updatedAt": string - The date and time when the instance was updated.
- If the objects
createdBy
andupdatedBy
exist, thenrole
are mandatory.- If the array
attributes
exists, it can be either empty or it can contain objects with the following fields:name
andgroupName
.
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.
Updated 7 months ago