| { |
| "task": { |
| "id": "case_33", |
| "name": "token_length_parity", |
| "summary": "Checks if each token's length is odd or even.", |
| "examples": [ |
| { |
| "input": [ |
| "BOS", |
| "oCLrZaW", |
| "V", |
| "b", |
| "oCLrZaW", |
| "TPSI", |
| "poiVg", |
| "b", |
| "b", |
| "oCLrZaW" |
| ], |
| "output": [ |
| "BOS", |
| false, |
| false, |
| false, |
| false, |
| true, |
| false, |
| false, |
| false, |
| false |
| ] |
| }, |
| { |
| "input": [ |
| "BOS", |
| "LB", |
| "TPSI", |
| "oCLrZaW", |
| "TPSI", |
| "TPSI", |
| "poiVg", |
| "b", |
| "V", |
| "poiVg" |
| ], |
| "output": [ |
| "BOS", |
| true, |
| true, |
| false, |
| true, |
| true, |
| false, |
| false, |
| false, |
| false |
| ] |
| }, |
| { |
| "input": [ |
| "BOS", |
| "poiVg", |
| "TPSI", |
| "no", |
| "b", |
| "LB", |
| "poiVg", |
| "V", |
| "no", |
| "no" |
| ], |
| "output": [ |
| "BOS", |
| false, |
| true, |
| true, |
| false, |
| true, |
| false, |
| false, |
| true, |
| true |
| ] |
| }, |
| { |
| "input": [ |
| "BOS", |
| "V", |
| "J", |
| "J", |
| "TPSI", |
| "TPSI", |
| "oCLrZaW", |
| "LB", |
| "poiVg", |
| "V" |
| ], |
| "output": [ |
| "BOS", |
| false, |
| false, |
| false, |
| true, |
| true, |
| false, |
| true, |
| false, |
| false |
| ] |
| }, |
| { |
| "input": [ |
| "BOS", |
| "LB", |
| "poiVg", |
| "V", |
| "b", |
| "J", |
| "V", |
| "LB", |
| "no", |
| "b" |
| ], |
| "output": [ |
| "BOS", |
| true, |
| false, |
| false, |
| false, |
| false, |
| false, |
| true, |
| true, |
| false |
| ] |
| } |
| ], |
| "is_categorical": true |
| }, |
| "program": "length_parity_checker = rasp.Map(lambda x: len(x) % 2 == 0, sop)\nreturn length_parity_checker", |
| "components": [ |
| { |
| "id": "L0_MLP", |
| "hook": "blocks.0.mlp.hook_post", |
| "role": { |
| "tag": "MAPPER", |
| "note": "Computes a boolean per token indicating whether its length is even." |
| }, |
| "rasp_vars": [ |
| "length_parity_checker" |
| ], |
| "labels": [ |
| "map_1" |
| ] |
| } |
| ] |
| } |
|
|