{ "task": { "id": "case_29", "name": "token_abbreviation", "summary": "Creates abbreviations for each token in the sequence.", "examples": [ { "input": [ "BOS", "oCLrZaW", "V", "b", "oCLrZaW", "TPSI", "poiVg", "b", "b", "oCLrZaW" ], "output": [ "BOS", "oCL", "V", "b", "oCL", "TPS", "poi", "b", "b", "oCL" ] }, { "input": [ "BOS", "LB", "TPSI", "oCLrZaW", "TPSI", "TPSI", "poiVg", "b", "V", "poiVg" ], "output": [ "BOS", "LB", "TPS", "oCL", "TPS", "TPS", "poi", "b", "V", "poi" ] }, { "input": [ "BOS", "poiVg", "TPSI", "no", "b", "LB", "poiVg", "V", "no", "no" ], "output": [ "BOS", "poi", "TPS", "no", "b", "LB", "poi", "V", "no", "no" ] }, { "input": [ "BOS", "V", "J", "J", "TPSI", "TPSI", "oCLrZaW", "LB", "poiVg", "V" ], "output": [ "BOS", "V", "J", "J", "TPS", "TPS", "oCL", "LB", "poi", "V" ] }, { "input": [ "BOS", "LB", "poiVg", "V", "b", "J", "V", "LB", "no", "b" ], "output": [ "BOS", "LB", "poi", "V", "b", "J", "V", "LB", "no", "b" ] } ], "is_categorical": true }, "program": "abbreviation = rasp.Map(lambda x: x[:3] if len(x) > 3 else x, sop); return abbreviation", "components": [ { "id": "L0_MLP", "hook": "blocks.0.mlp.hook_post", "role": { "tag": "MAPPER", "note": "Applies elementwise abbreviation rule, truncates to first 3 chars if len>3, else keeps token." }, "rasp_vars": [ "abbreviation" ], "labels": [ "map_1" ] } ] }