toxigen

Note

ID: catalog.cards.toxigen | Type: TaskCard

{
    "loader": {
        "name": "train",
        "path": "skg/toxigen-data",
        "type": "load_hf"
    },
    "preprocess_steps": [
        {
            "page_size": 251000,
            "type": "shuffle"
        },
        {
            "mix": {
                "test": "train[80%]",
                "train": "train[20%]"
            },
            "type": "split_random_mix"
        },
        {
            "mappers": {
                "prompt_label": {
                    "0": "not toxic",
                    "1": "toxic"
                }
            },
            "type": "map_instance_values"
        },
        {
            "field_to_field": {
                "prompt": "text"
            },
            "type": "rename_fields"
        },
        {
            "field_to_field": {
                "prompt_label": "label"
            },
            "type": "rename_fields"
        },
        {
            "fields": {
                "classes": [
                    "not toxic",
                    "toxic"
                ],
                "text_type": "text",
                "type_of_class": "toxicity"
            },
            "type": "add_fields"
        }
    ],
    "task": "tasks.classification.multi_class",
    "templates": {
        "items": [
            {
                "input_format": "Given this {text_type}: {text}. Classify if it contains {type_of_class}. classes: {classes}. I would classify this {text_type} as: ",
                "output_format": "{label}",
                "postprocessors": [
                    "processors.take_first_non_empty_line",
                    "processors.toxic_or_not_toxic"
                ],
                "type": "input_output_template"
            }
        ],
        "type": "templates_list"
    },
    "type": "task_card"
}