User guide
Creating a project
Creating a project on Codr.
Role-based access
In order to create a project, you must be assigned the "Researcher" role.
Understanding the project schema
The underlining workings of the project schema is quite complex, but we try to make it as simple as possible to understand so that you can easily pick it up and use it to it's fullest potential.
Codr's dot notation tokens
Codr has a custom dot-notation systax that can be used in several parts of the project configuration. There are three tokens searched for within certian parameters, these are: $sample
, $value
, and $index
. Each token is described below including what their purpose is, where to use it, and examples.
$sample
The $sample
dot-notation token references the root of a dataset sample item. It can be used in a projects inputs.[*].value
and outputs.[*].options
.
Example:
const exampleInputOne = {
type: 'text',
// value is a string
value: '$sample.value',
}
$value
The $value
dot-notation token references the object that the inputs.[*].value
string points to and can be used inside the inputs.[*].format
string.
Example:
const exampleInputOne = {
type: 'text',
// items is an tuple
value: '$sample.items',
// this grabs the items in the tuple.
format: 'Tuple value: $value.[0], $value.[1]',
}
const exampleInputTwo = {
type: 'text',
// object is defined as: { title: string, body: string }
value: '$sample.object',
// this grabs the title and body from the value and formats it to the screen.
format: '### $value.title:\n\n$value.body',
}
$index
The $index
dot-notation token references the array index of an item. It can be used inside inputs.[*].header
Example:
const exampleInputOne = {
type: 'text',
collapsible: true,
// items is an array of string being displayed in collapsible components.
value: '$sample.items.[*]',
// $index is used to reference the item index for collapsible inputs.
header: 'Item $index',
}
Configuration deep dive
General configuration
{
"general": {
"title": "project title",
"slug": "/project-slug",
"type": "labeling",
"bgClassColor": "bg-pink-600",
"guidelines": "Project \n Guidelines",
"anonymize": false
},
...
}
Display configuration
// Complete display example
{
...
"display": {
"inputs": [
{ "type": "text", "value": "Some text here" },
],
"outputs": [
{ "type": "range", "range": [1, 10] },
],
},
...
}
Inputs
Inputs can be very simple, but they can also be quite complex. Below you will find an example of a complex input element.
// Complex input example
{
"type": "text",
"value": "$sample.hops.[*]",
"format": "```java\n$value\n```",
"collapsible": true,
"header": "Hop $index"
}
Sample configuration
As the name implies, the sample configuration allows you to configure how to handle your dataset samples. Currently there are two parameters within this section, model
and skipValidation
.
model
The model
parameter is expecting a JSON meta-schema. The quickest way to learn how to write a meta-schema is through JSON-Schema's getting started page. An example of a meta-schema in action is our project configuration meta-schema, which can be found here.
skipValidation
The skipValidation
parameter is as it sounds, it skips the model validation process. To ensure Codr properly reads your dataset samples, we validate each sample against the model. If you wish, you may enable skipValidation
to either speed up the setup process, or remove the annoyance on the rare occasion that your samples are known to be very different.
Enabling `skipValidation`
If you choose to enable this feature, please be warned that you may run into errors. It is recommended to leave skipValidation
set to false
.
Example
{
"sample": {
"skipValidation": false,
"model": {
"type": "object",
"properties": {
"sample_id": { "type": "string" },
"app_name": { "type": "string" },
"class_name": { "type": "string" },
"method_name": { "type": "string" },
"information_accessed": { "type": "string" },
"apis": {
"type": "array",
"items": {
"type": "array",
"items": { "type": "string" },
"minItems": 2,
"maxItems": 2
}
},
"hops": {
"type": "array",
"items": { "type": "string" }
},
"options": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["sample_id", "apis", "hops", "options"]
}
}
}
API definitions
General
Parameter | Required | Description |
---|---|---|
type | true | Type of annotation task the project is to perform. Options are: classification , labeling , or translation . |
title | true | The title of the project |
slug | false | The URL slug for the project |
bgColorClass | false | The background color class for the project. Please use Tailwind CSS class names |
guidelines | true | The guidelines for the project. |
anonymize | false | When exporting, do you want to automatically remove all user-referenced data from the annotations? |
Display
Parameter | Required | Description |
---|---|---|
inputs | true | An array of inputs |
outputs | true | An array of outputs |
Display.inputs
Parameter | Required | Description |
---|---|---|
type | true | Type of data to be displayed. Options are text |
value | false | Location of the data in the sample to use in the formatted string. Must be a $sample dot notation string |
format | false | Text to display; can include data from value using $value dot notation. |
collapsible | false | Whether or not to display the input in a collapsible UI component. |
header | false | Header for collapsible object, $index value supported. |
Display.outputs
Parameter | Required | Description |
---|---|---|
type | true | Options are short-text , long-text , range , multiple-choice , or radio |
range | false | A tuple defined as an array of two numbers [min, max] ; **Required for type range ** |
prompt | false | An optional bit of text to describe what information to input. Markdown is accepted. |
values | false | An array of strings; **Required for type multiple-choice and radio ** |
Sample
Parameter | Required | Description |
---|---|---|
skipValidation | false | If true, dataset items being imported into Codr will skip model validation. |
model | true | Project dataset sample format, used for data validation. |