Datasaur
Search…
Supported Features
Currently Robosaur supports three commands: create-projects , export-projects , and apply-tags. All of these actions can be configured from the same configuration file.
We will use the following config.json file as the example:
{
"datasaur": {
"host": "https://app.datasaur.ai",
"clientId": "<DATASAUR_CLIENT_ID>",
"clientSecret": "<DATASAUR_CLIENT_SECRET>"
},
"projectState": {
"source": "local",
"path": "quickstart/state/projectState.json"
},
"export": {
"source": "local",
"prefix": "quickstart/token-based/export",
"teamId": "<TEAM_ID>",
"statusFilter": [],
"format": "JSON_ADVANCED",
"customScriptId": null
},
"create": {
"teamId": "<TEAM_ID>",
"files": {
"source": "local",
"path": "quickstart/token-based/documents"
},
"assignment": {
"source": "local",
"path": "quickstart/token-based/config/assignment.json"
},
"projectSettings": {
"consensus": 1,
"enableEditLabelSet": false,
"enableEditSentence": false,
"hideLabelerNamesDuringReview": false,
"hideRejectedLabelsDuringReview": true,
"hideLabelsFromInactiveLabelSetDuringReview": false
},
"documentSettings": {
"kind": "TOKEN_BASED",
"customScriptId": null,
"allowCharacterBasedLabeling": false,
"allowArcDrawing": true,
"allowMultiLabels": true,
"allTokensMustBeLabeled": false,
"textLabelMaxTokenLength": 999999,
"sentenceSeparator": "\n",
"tokenizer": "WINK"
}
},
"applyTags": {
"teamId": "<TEAM_ID>",
"source": "inline",
"payload": [
{
"projectId": "<PROJECT_ID_1>",
"tags": ["<TAG_1>", "<TAG_2>"]
},
{
"projectId": "<PROJECT_ID_2>",
"tags": ["<TAG_3>"]
}
]
}
}

create-projects

$ npm run start -- create-projects -h
Usage: robosaur create-projects [options] <configFile>
​
Create Datasaur projects based on the given config file
​
Options:
--dry-run Simulates what the script is doing without creating the projects
--without-pcw Use legacy Robosaur configuration (default: false)
--use-pcw Use the payload from Project Creation Wizard in Datasaur UI (default: true)
-h, --help display help for command
Robosaur will try to create a project for each folder inside the create.files.source folder.
{
"files": {
"source": "local",
"path": "quickstart/token-based/documents"
}
}
If the inside of the directory quickstart/token-based/documents looks like this below, Robosaur will create two projects named Project 1 and Project 2 with each project has one document named lorem.txt and ipsum.txt respectively.
$ ls -lR quickstart/token-based/documents
total 0
drwxr-xr-x 3 user group Project 1
drwxr-xr-x 3 user group Project 2
​
quickstart/token-based/documents/Project 1:
total 8
-rw-r--r-- 1 user group lorem.txt
​
quickstart/token-based/documents/Project 2:
total 8
-rw-r--r-- 1 user group ipsum.txt
For additional configurations refer to this page.

export-projects

$ npm run start -- export-projects -h
Usage: robosaur export-projects [options] <configFile>
​
Export all projects based on the given config file
​
Options:
-u --unzip Unzips the exported projects, only storing the final version accepted by reviewers
-h, --help display help for command
Robosaur will try to export each projects previously created by the create-projects command. Each project will be saved as a separate zip file under the supplied directory in export.prefix. For example, in config.json, this is set to be quickstart/token-based/export like so:
{
"export": {
"source": "local",
"prefix": "quickstart/token-based/export"
}
}
By default, Robosaur will request for a full project export - with each labelers' version of the project document included. For simpler workflows, where we only need the final version of the document, we can use the --unzip option. With this option set, Robosaur will only save the final version of the document to the export destination.
For additional configurations refer to this page.

apply-tags

$ npm run start -- apply-tags -h
Usage: robosaur apply-tags [options] <configFile>
​
Applies tags to projects based on the given config file
​
Options:
-h, --help display help for command
Robosaur will try to apply tags to projects specified in the config file's payload, or from a separate csv file. The csv file can be from local or one of our supported Cloud Services.
If the tag in the config file is not present in the team, Robosaur will create the tag and apply it to the project automatically.
Example config format:
{
"applyTags": {
"teamId": "<TEAM_ID>",
"source": "inline",
"payload": [
{
"projectId": "<PROJECT_ID_1>",
"tags": ["<TAG_1>", "<TAG_2>"]
},
{
"projectId": "<PROJECT_ID_2>",
"tags": ["<TAG_3>"]
}
]
}
}
Example csv format:
tags,projectId
"<TAG_1>,<TAG_4>",<PROJECT_ID_1>
<TAG_2>,<PROJECT_ID_1>
<TAG_3>,<PROJECT_ID_2>
For additional configurations, please refer to this page.