task_categories:text-classification size_categories:10K<n<100K language:en SFT region:us
---
dataset_info:
  features:
  - name: ind
    dtype: int32
  - name: activity_label
    dtype: string
  - name: ctx_a
    dtype: string
  - name: ctx_b
    dtype: string
  - name: ctx
    dtype: string
  - name: endings
    sequence: string
  - name: source_id
    dtype: string
  - name: split
    dtype: string
  - name: split_type
    dtype: string
  - name: label
    dtype: string
  splits:
  - name: train
    num_bytes: 43232624
    num_examples: 39905
  - name: validation
    num_bytes: 11175717
    num_examples: 10042
  download_size: 30681161
  dataset_size: 54408341
task_categories:
- text-classification
language:
- en
tags:
- SFT
size_categories:
- 10K<n<100K
---
# Physical Interaction: HellaSwag

- Source: https://huggingface.co/datasets/hellaswag
- Num examples: 
  - 39,905 (train)
  - 10,042 (validation)
- Language: English

```python
from datasets import load_dataset

load_dataset("vietgpt/hellaswag_en")
```

- Format for GPT-3

```python
def preprocess_gpt3(sample):
    ctx = sample['ctx']
    endings = sample['endings']
    label = sample['label']

    if label == '0':
        output = f'\n<|correct|> {endings[0]}\n<|incorrect|> {endings[1]}\n<|incorrect|> {endings[2]}\n<|incorrect|> {endings[3]}'
    elif label == '1':
        output = f'\n<|correct|> {endings[1]}\n<|incorrect|> {endings[0]}\n<|incorrect|> {endings[2]}\n<|incorrect|> {endings[3]}'
    elif label == '2':
        output = f'\n<|correct|> {endings[2]}\n<|incorrect|> {endings[0]}\n<|incorrect|> {endings[1]}\n<|incorrect|> {endings[3]}'
    else:
        output = f'\n<|correct|> {endings[3]}\n<|incorrect|> {endings[0]}\n<|incorrect|> {endings[1]}\n<|incorrect|> {endings[2]}'

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

"""
<|startoftext|><|context|> Then, the man writes over the snow covering the window of a car, and a woman wearing winter clothes smiles. then <|answer|> 
<|correct|> , the man continues removing the snow on his car.
<|incorrect|> , the man adds wax to the windshield and cuts it.
<|incorrect|> , a person board a ski lift, while two men supporting the head of the person wearing winter clothes snow as the we girls sled.
<|incorrect|> , the man puts on a christmas coat, knitted with netting. <|endoftext|>
"""
```