task_categories:text-classification size_categories:n<1K language:en SFT region:us
---
dataset_info:
  features:
  - name: premise
    dtype: string
  - name: choice1
    dtype: string
  - name: choice2
    dtype: string
  - name: question
    dtype: string
  - name: idx
    dtype: int32
  - name: label
    dtype:
      class_label:
        names:
          '0': choice1
          '1': choice2
  splits:
  - name: train
    num_bytes: 49233
    num_examples: 400
  - name: validation
    num_bytes: 12479
    num_examples: 100
  download_size: 45911
  dataset_size: 61712
task_categories:
- text-classification
language:
- en
tags:
- SFT
size_categories:
- n<1K
---
# COPA

- Source: https://huggingface.co/datasets/super_glue
- Num examples: 
  - 400 (train)
  - 100 (validation)
- Language: English

```python
from datasets import load_dataset

load_dataset("vietgpt/copa_en")
```

- Format for GPT-3

```python
def preprocess_gpt3(sample):
    premise = sample['premise']
    choice1 = sample['choice1']
    choice2 = sample['choice2']
    label = sample['label']

    if label == 0:
        output = f'\n<|correct|> {choice1}\n<|incorrect|> {choice2}'
    elif label == 1:
        output = f'\n<|correct|> {choice2}\n<|incorrect|> {choice1}'

    return {'text': f'<|startoftext|><|context|> {premise} <|answer|> {output} <|endoftext|>'}

"""
<|startoftext|><|context|> My body cast a shadow over the grass. <|answer|> 
<|correct|> The sun was rising.
<|incorrect|> The grass was cut. <|endoftext|>
"""
```