The challenge
We need to define which class the search query belongs to and distribute the queries between several categories inside the class. There’s a list of queries (related to travel and dining), each with an unknown class and category. Performers are asked to first select the search query’s class and then define the category it belongs to within this class. Here’s what it might look like:
{
"view": {
"type": "view.list",
"items": [
{
"type": "view.alert",
"theme": "info",
"label": "QUERY",
"content": {
"type": "view.text",
"content": {
"type": "data.input",
"path": "query"
}
}
},
{
"type": "field.button-radio-group",
"label": "Please select query category:",
"options": [
{
"label": "Kitchen",
"value": "kitchen"
},
{
"label": "Travel",
"value": "travel"
}
],
"data": {
"type": "data.output",
"path": "domain"
},
"validation": {
"type": "condition.required"
}
},
{
"type": "helper.if",
"condition": {
"type": "condition.equals",
"data": {
"type": "data.output",
"path": "domain"
},
"to": "kitchen"
},
"then": {
"type": "field.radio-group",
"label": "What is the intent of the query?",
"options": [
{
"label": "Restaurant review",
"value": "review",
"hint": "Anything related to whether a restaurant is worth the visit"
},
{
"label": "Restaurant reservation",
"value": "reservation",
"hint": "Intention to reserve a table in the restaurant"
},
{
"label": "Nutritional information",
"value": "nutrition",
"hint": "Intention to know information about how healthy food or amount of calories "
},
{
"label": "Recipe",
"value": "recipe",
"hint": "Anything related to how to prepare food or food substitution"
}
],
"data": {
"type": "data.output",
"path": "intent"
},
"validation": {
"type": "condition.required",
"hint": "please select the relevant intent"
}
}
},
{
"type": "helper.if",
"condition": {
"type": "condition.equals",
"data": {
"type": "data.output",
"path": "domain"
},
"to": "travel"
},
"then": {
"type": "field.radio-group",
"label": "What is the intent of the query?",
"options": [
{
"label": "Book a hotel",
"value": "bookhotel",
"hint": "Anything related to reservation a flight or hotel"
},
{
"label": "Timezone",
"value": "timezone",
"hint": "Intention to get information about timezone"
},
{
"label": "Travel suggestion",
"value": "travel_suggestion",
"hint": "Query related to recommendation on a travel"
},
{
"label": "Exchange rate",
"value": "exchange_rate",
"hint": "Intention to know price to buy such currency"
},
{
"label": "Vaccine",
"value": "vaccine",
"hint": "Query which contains information about vaccines in certain region"
}
],
"data": {
"type": "data.output",
"path": "intent"
},
"validation": {
"type": "condition.required",
"hint": "please select the relevant intent"
}
}
}
]
},
"plugins": [
{
"type": "plugin.toloka",
"layout": {
"kind": "scroll",
"taskWidth": 300
}
}
]
}