| | --- |
| | 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) |