File size: 1,981 Bytes
ab74fae a7e153d 0cadca0 e37b912 0cadca0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
---
dataset_info:
features:
- name: function_name
dtype: string
- name: docstring
dtype: string
- name: masked_code
dtype: string
- name: implementation
dtype: string
- name: start_line
dtype: int32
- name: end_line
dtype: int32
- name: file_content
dtype: string
splits:
- name: train
num_bytes: 420616564
num_examples: 2760
download_size: 64655948
dataset_size: 420616564
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
---
# Stack-Smol-Docstrings
This dataset contains Python functions extracted from [the-stack-smol](https://huggingface.co/datasets/bigcode/the-stack-smol),
filtered for high-quality docstrings and implementations. Each sample includes
the function's docstring, implementation, and a masked version of the code where the
function is replaced with a comment.
The dataset is designed for code completion tasks where a model needs to restore a
function that has been replaced with a comment. The model is provided with:
1. The full file context with the function replaced by a comment
2. The docstring of the function
3. The function name
The model's task is to generate code that replaces the comment with a proper implementation
of the function based on the docstring and surrounding context.
## Dataset Structure
Each sample contains:
- `function_name`: Name of the function
- `docstring`: The function's docstring
- `masked_code`: The full file with the function replaced by a comment
- `implementation`: The original function implementation
- `start_line`: The starting line number of the function in the original file
- `end_line`: The ending line number of the function in the original file
- `file_content`: The full original file content
## Quality Filtering
Functions are filtered based on:
- Docstring quality (length, structure, descriptiveness)
- Implementation quality (no SQL strings, reasonable number of variables, sufficient complexity) |