File size: 318 Bytes
08480b0
 
 
 
 
 
1
2
3
4
5
6
7
import json
FIELDS = ('id','original_id','source','scenario','clean','adv','gt','task','attack')
JSON_FIELDS = ('clean','adv','gt','task')
def decode_record(row):
    """Recover the nine-field native record from a Hugging Face row."""
    return {k: json.loads(row[k]) if k in JSON_FIELDS else row[k] for k in FIELDS}