Datasets:
upadted README with docs
Browse files
README.md
CHANGED
|
@@ -20,4 +20,81 @@ configs:
|
|
| 20 |
data_files:
|
| 21 |
- split: train
|
| 22 |
path: data/train-*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
data_files:
|
| 21 |
- split: train
|
| 22 |
path: data/train-*
|
| 23 |
+
license: mit
|
| 24 |
+
task_categories:
|
| 25 |
+
- text-generation
|
| 26 |
+
language:
|
| 27 |
+
- en
|
| 28 |
+
tags:
|
| 29 |
+
- code
|
| 30 |
+
pretty_name: python docstring dataset
|
| 31 |
+
size_categories:
|
| 32 |
+
- 100K<n<1M
|
| 33 |
---
|
| 34 |
+
# Python Docstring Diff Dataset
|
| 35 |
+
|
| 36 |
+
This dataset contains training samples for models that generate Python documentation patches.
|
| 37 |
+
Each example provides a Python source file with its docstrings removed and a corresponding unified diff patch that restores the documentation.
|
| 38 |
+
|
| 39 |
+
The dataset is designed for training or evaluating language models that assist with:
|
| 40 |
+
|
| 41 |
+
* Automatic code documentation
|
| 42 |
+
* Docstring generation
|
| 43 |
+
* Code review automation
|
| 44 |
+
* Developer tooling
|
| 45 |
+
* Dataset Structure
|
| 46 |
+
|
| 47 |
+
Each entry contains the following fields:
|
| 48 |
+
|
| 49 |
+
Field Description
|
| 50 |
+
-------------------
|
| 51 |
+
instruction| Task instruction given to the model
|
| 52 |
+
code| Python source code with docstrings removed
|
| 53 |
+
response| A unified diff patch that adds the correct docstrings
|
| 54 |
+
file| Original file path from the source project
|
| 55 |
+
|
| 56 |
+
## Task Format
|
| 57 |
+
|
| 58 |
+
The model receives a Python file missing its documentation and must produce a unified diff that adds appropriate docstrings.
|
| 59 |
+
|
| 60 |
+
Example input:
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
def load_json(path):
|
| 64 |
+
with open(path) as f:
|
| 65 |
+
return json.load(f)
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
Example expected output:
|
| 69 |
+
```diff
|
| 70 |
+
--- a/file.py
|
| 71 |
+
+++ b/file.py
|
| 72 |
+
@@
|
| 73 |
+
def load_json(path):
|
| 74 |
+
+ """Load JSON data from a file path."""
|
| 75 |
+
with open(path) as f:
|
| 76 |
+
return json.load(f)
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
## Data Sources
|
| 80 |
+
|
| 81 |
+
The dataset was generated by scanning Python packages within a virtual environment's site-packages directory.
|
| 82 |
+
Docstrings were extracted from functions, classes, async functions, methods, and modules using Python's AST parser.
|
| 83 |
+
|
| 84 |
+
* Low-quality documentation was filtered out using heuristics such as:
|
| 85 |
+
* Minimum docstring length
|
| 86 |
+
* Removal of TODO or placeholder documentation
|
| 87 |
+
* Deduplication of similar examples
|
| 88 |
+
|
| 89 |
+
## Intended Use
|
| 90 |
+
|
| 91 |
+
This dataset is useful for training models that perform:
|
| 92 |
+
|
| 93 |
+
* automatic docstring generation
|
| 94 |
+
* documentation patch creation
|
| 95 |
+
* codebase documentation improvement tools
|
| 96 |
+
* AI-assisted code review systems
|
| 97 |
+
|
| 98 |
+
## License
|
| 99 |
+
|
| 100 |
+
This dataset is released under the MIT License.
|