paiml commited on
Commit
11161d9
·
verified ·
1 Parent(s): 8769808

Test upload via alimentar NDJSON API

Browse files
Files changed (1) hide show
  1. README.md +98 -0
README.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ task_categories:
4
+ - text-generation
5
+ language:
6
+ - en
7
+ tags:
8
+ - code
9
+ - python
10
+ - doctest
11
+ - transpilation
12
+ - rust
13
+ size_categories:
14
+ - n<1K
15
+ ---
16
+
17
+ # Python Doctest Corpus
18
+
19
+ A curated corpus of Python doctest examples designed for training Python-to-Rust transpilers and testing code translation systems.
20
+
21
+ ## Dataset Description
22
+
23
+ This dataset contains Python function signatures, doctest inputs, and expected outputs that serve as high-quality training data for:
24
+
25
+ - **Transpilation training**: Teaching models to translate Python patterns to Rust
26
+ - **Test validation**: Verifying that transpiled code produces correct outputs
27
+ - **Code understanding**: Benchmarking code comprehension systems
28
+
29
+ ## Schema
30
+
31
+ | Column | Type | Description |
32
+ |--------|------|-------------|
33
+ | `source` | string | Source project identifier |
34
+ | `version` | string | Git commit SHA or version |
35
+ | `module` | string | Module path (e.g., `example_math.math_tool`) |
36
+ | `function` | string | Function name being tested |
37
+ | `input` | string | Python doctest input (e.g., `>>> square(5)`) |
38
+ | `expected` | string | Expected output value |
39
+ | `signature` | string | Full Python function signature with type hints |
40
+
41
+ ## Quality Score
42
+
43
+ Quality score validated using `alimentar quality score --profile doctest-corpus`:
44
+
45
+ - **Grade**: B (90.3%)
46
+ - **Critical Checks**: All passing
47
+ - **High Priority Checks**: All passing
48
+
49
+ ## Example
50
+
51
+ ```python
52
+ def square(x: int) -> int:
53
+ """
54
+ >>> square(5)
55
+ 25
56
+ >>> square(0)
57
+ 0
58
+ """
59
+ return x * x
60
+ ```
61
+
62
+ Becomes:
63
+ ```json
64
+ {
65
+ "source": "reprorusted-python-cli",
66
+ "function": "square",
67
+ "input": ">>> square(5)",
68
+ "expected": "25",
69
+ "signature": "def square(x: int) -> int"
70
+ }
71
+ ```
72
+
73
+ ## Usage
74
+
75
+ ```python
76
+ from datasets import load_dataset
77
+
78
+ dataset = load_dataset("paiml/python-doctest-corpus")
79
+
80
+ for example in dataset["train"]:
81
+ print(f"{example['function']}: {example['input']} -> {example['expected']}")
82
+ ```
83
+
84
+ ## License
85
+
86
+ Apache 2.0
87
+
88
+ ## Citation
89
+
90
+ ```bibtex
91
+ @dataset{python_doctest_corpus,
92
+ author = {PAIML},
93
+ title = {Python Doctest Corpus},
94
+ year = {2025},
95
+ publisher = {HuggingFace},
96
+ url = {https://huggingface.co/datasets/paiml/python-doctest-corpus}
97
+ }
98
+ ```