Create Projects
How It Works
$ 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 commandRobosaur will try to create a project for each folder inside the
create.filesfolder. If the contents ofquickstart/token-based/documentslooks like the example below, Robosaur will create two projects namedProject 1andProject 2with each project has one document namedlorem.txtandipsum.txtrespectively. This attribute could be a path to your local drive or any supported object storage, the details can be seen here.$ 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.txtAll successful project creation is saved on the state that is configured by
projectStateattribute. So, the next time you run the same command, there will be no project duplication. It will only process the new project(s) or the failed ones.
Recommended Steps
Select a configuration example from the
quickstartfolder.Specify the
create.filesvalue. As mentioned above, this attribute will be the data source of the projects.Open the app and select your preferred team to work on by clicking your profile on the top right corner.
Create a new project using the Project Creation Wizard (PCW) by clicking the
+ Custom Project.Configure what kind of projects that you want to automate. Go through until the last step, including choosing labelers and reviewers, and click
<> View Scriptin the top right corner.

After that, copy the values.
Paste the value directly to
create.pcwPayloadand make sure thecreate.pcwPayloadSourcevalue is properly filled. See the detailed below.Specify the
pcwAssignmentStrategy. The value could beALL(default) orAUTO. See the detailed below.Run the command.
PCW Payload
Directly on the configuration file which is the recommended approach. Paste the payload to
create.pcwPayloadand make sure the value ofcreate.pcwPayloadSourceis like the example below.{ ... "create": { ... "pcwPayloadSource": { "source": "inline" }, "pcwPayload": <paste the values from PCW> } ... }Use a storage (could be local file or any supported cloud storage). Below is the example using GCS. Paste the value to a JSON file in your bucket and fill
create.pcwPayloadwith the path. Another attributes that must be filled arecreate.pcwPayloadSourceandcredentials. For other supported object storage, see here.
{
...
"credentials": {
"gcs": { "gcsCredentialJson": "<path-to-JSON-service-account-credential>" }
},
"create": {
...
"pcwPayloadSource": {
"source": "gcs",
"bucketName": "my-bucket-name"
},
"pcwPayload": <path-to-the-payload-in-JSON-file>
}
...
}Assignment
List of Assignees (Labelers and Reviewers)
There are two ways to specify the list.
Using the labelers and reviewers that are already assigned on PCW. This is the default approach and you won't have to do a thing because it's already included on the configuration when you paste it from PCW.
Specify the list on your own. Create a file and specify the path on
create.assignmentattribute. The values of the file should be like this below.If
useTeamMemberIdistrue, fill both labelers and reviewers withteamMembeId.If
useTeamMemberIdisfalse, fill both labelers and reviewers with their emails.
{ "labelers": [...], // list of emails "reviewers": [...], // list of emails "useTeamMemberId": false }
Distribution
Currently, we are supporting two assignment distributions.
Across documents (default approach). You would only need to specify
create.pcwAssignmentStrategyvalue. Here is the supported approach.AUTO: distribute documents to labelers using round-robin algorithm, i.e. each document will only be assigned by exactly one labeler.
ALL: labelers will be assigned to all documents.
Please note that the reviewers will be assigned to all projects and documents.
Across projects. To use this approach, you would have to specify the labelers and reviewers list on your own just like mentioned on the List of Assignees section. Follow the steps below.
{ ... "create": { ... "assignment": { "source": "local", "path": "quickstart/token-based/config/assignment.json", "by": "PROJECT", "strategy": "AUTO" }, // remove pcwAssignmentStrategy // remove documentAssignments from pcwPayload ... } }Create the assignment file and specify it on
create.assignment.Fill
projectas the value ofcreate.assignment.byattribute.Select assignment strategy by filling the
create.assignment.strategy. There are two ways supported.AUTO: distribute both labelers and reviewers using round-robin. Only one labeler and reviewer for each project.
ALL: all reviewers and labelers will be assigned to each project.
Remove
create.pcwAssignmentStrategyattribute anddocumentAssignmentsattribute frompcwPayload.
Tagging Projects
Newly created projects from Robosaur can be tagged automatically.
From the PCW payload that you have copied using the recommended approach from the previous section (directly on the config file), add a new field called tagNames under create.pcwPayload.variables.input, and specify the tags for the projects. If the tags did not exist yet, they will be created for you.
{
...
"create": {
...
"pcwPayload": {
...
"variables": {
...
"input": {
...
"tagNames": ["TAG 1", "TAG 2"]
}
}
}
}
...
}Or, if the PCW Payload is on an external file (whether it is local or from a cloud storage), add the tagNames field in variables.input, and specify the tags for the projects.
{
...
"variables": {
...
"input": {
...
"tagNames": ["TAG 1", "TAG 2"]
}
}
}ML-Assisted Labeling
Automate the labeling process on the newly created projects using ML-assisted labeling.
In the config file, add the autoLabel field under create and fill in the required fields. The target API requires the project to have a label set to be able to work properly.
{
...
"create": {
...
"autoLabel": {
"enableAutoLabel": true,
"labelerEmail": "<EMAIL>", // use your Datasaur's account email
"targetApiEndpoint": "<API_ENDPOINT>", // your custom API model
"targetApiSecretKey": "<API_SECRET>", // if needed
"numberOfFilesPerRequest": 1
}
}
...
}With this, every time a project is created, the ML-assisted labeling will be triggered and there will be labels applied on the new project, depending on your custom API model response.
Last updated