Understanding Annotation Results
A Label Studio annotation consists of regions, stored as a list in the annotation.result field. For instance:
"annotations": [
{
"id": 44553935,
"result": [
{
"id": "zLSY-XLk64",
"type": "choices",
"value": {
"choices": [
"yes"
]
},
"origin": "manual",
"to_name": "query",
"from_name": "understand"
},
{
"id": "uh87CbF1k3",
"type": "choices",
"value": {
"choices": [
"no"
]
},
"origin": "manual",
"to_name": "query",
"from_name": "consistency"
},
{
"id": "Yd_BW-pLht",
"type": "choices",
"value": {
"choices": [
"other"
]
},
"origin": "manual",
"to_name": "query",
"from_name": "consistency_reason"
},
...
]
In most cases, regions have a from_name field, which links to the control tag from your labeling config. Each region's value stores the control's response.
Building the filter
As follows from annotation result understanding, our can identify your answers using a pair (from_name, value).
Based on the annotation.result, you can identify answers using a (from_name, value) pair. The annotation.result is stored as a JSON string in the Label Studio database, allowing us to search like a simple string. To construct a filter let's consider this region:
{
"id": "uh87CbF1k3",
"type": "choices",
"value": {
"choices": ["no"]
},
"origin": "manual",
"to_name": "query",
"from_name": "consistency"
}
- Keep only the part that has value and control tag name.
- Remove
\nand spaces that surround{and}.
As the result we have:
["no"]}, "origin": "manual", "to_name": "query", "from_name": "consistency"
Use the filter in the Data Manager
Now, copy this filter into the Data Manager. Go to Filter → Annotation Result → Contains and paste ["no"]}, "origin": "manual", "to_name": "query", "from_name": "consistency":
