Antik Khan
Add annotations
3d3ae36
Raw
History Blame Contribute Delete
2.75 kB
{
"task": {
"id": "case_37",
"name": "token_reversal_with_exclusion",
"summary": "Reverses each word in the sequence except for specified exclusions.",
"examples": [
{
"input": [
"BOS",
"oCLrZaW",
"V",
"b",
"oCLrZaW",
"TPSI",
"poiVg",
"b",
"b",
"oCLrZaW"
],
"output": [
"BOS",
"WaZrLCo",
"V",
"b",
"WaZrLCo",
"ISPT",
"gViop",
"b",
"b",
"WaZrLCo"
]
},
{
"input": [
"BOS",
"LB",
"TPSI",
"oCLrZaW",
"TPSI",
"TPSI",
"poiVg",
"b",
"V",
"poiVg"
],
"output": [
"BOS",
"BL",
"ISPT",
"WaZrLCo",
"ISPT",
"ISPT",
"gViop",
"b",
"V",
"gViop"
]
},
{
"input": [
"BOS",
"poiVg",
"TPSI",
"no",
"b",
"LB",
"poiVg",
"V",
"no",
"no"
],
"output": [
"BOS",
"gViop",
"ISPT",
"on",
"b",
"BL",
"gViop",
"V",
"on",
"on"
]
},
{
"input": [
"BOS",
"V",
"J",
"J",
"TPSI",
"TPSI",
"oCLrZaW",
"LB",
"poiVg",
"V"
],
"output": [
"BOS",
"V",
"J",
"J",
"ISPT",
"ISPT",
"WaZrLCo",
"BL",
"gViop",
"V"
]
},
{
"input": [
"BOS",
"LB",
"poiVg",
"V",
"b",
"J",
"V",
"LB",
"no",
"b"
],
"output": [
"BOS",
"BL",
"gViop",
"V",
"b",
"J",
"V",
"BL",
"on",
"b"
]
}
],
"is_categorical": true
},
"program": "reversal = rasp.Map(lambda x: x[::-1] if x != exclude else x, sop)\nreturn reversal",
"components": [
{
"id": "L0_MLP",
"hook": "blocks.0.mlp.hook_post",
"role": {
"tag": "MAPPER",
"note": "Reverses each token unless it matches the excluded token, in which case it is passed through unchanged."
},
"rasp_vars": [
"reversal"
],
"labels": [
"map_1"
]
}
]
}