wnli_5_shot

Note

ID: catalog.recipes.wnli_5_shot | Type: SequentialRecipe

{
    "steps": [
        {
            "name": "wnli",
            "path": "glue",
            "type": "load_hf"
        },
        {
            "mix": {
                "test": "validation",
                "train": "train[95%]",
                "validation": "train[5%]"
            },
            "type": "split_random_mix"
        },
        {
            "slices": {
                "demos_pool": "train[:100]",
                "test": "test",
                "train": "train[100:]",
                "validation": "validation"
            },
            "type": "slice_split"
        },
        {
            "mappers": {
                "label": {
                    "0": "entailment",
                    "1": "not entailment"
                }
            },
            "type": "map_instance_values"
        },
        {
            "fields": {
                "choices": [
                    "entailment",
                    "not entailment"
                ],
                "instance": {
                    "text": "classify if this sentence is entailment or not entailment.",
                    "type": "textual_instruction"
                }
            },
            "type": "add_fields"
        },
        {
            "fields": [
                "choices"
            ],
            "type": "normalize_list_fields"
        },
        {
            "inputs": [
                "choices",
                "sentence1",
                "sentence2"
            ],
            "metrics": [
                "metrics.accuracy"
            ],
            "outputs": [
                "label"
            ],
            "type": "form_task"
        },
        {
            "input_format": "Given this sentence: {sentence1}, classify if this sentence: {sentence2} is {choices}.",
            "output_format": "{label}",
            "type": "input_output_template"
        },
        {
            "sampler": {
                "sample_size": 5,
                "type": "random_sampler"
            },
            "source_stream": "demos_pool",
            "target_field": "demos",
            "type": "spread_split"
        },
        {
            "demo_format": "User: {source}\nAgent: {target}\n\n",
            "model_input_format": "{demos}User: {source}\nAgent: ",
            "type": "system_format"
        }
    ],
    "type": "sequential_recipe"
}