File size: 3,274 Bytes
93ade6b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
annotations_creators:
- synthetic
language:
- en
license:
- agpl-3.0
---

# Coding Excellence Dataset

Claude/Fable-5 のコーディング性能分布を分析し、理想的なコーディングパターンを強化注入した**チャット形式**コード生成データセット。

## 📊 概要

| 項目 | 値 |
|------|------|
| レコード数 | **100,000** |
| 形式 | `{"instruction": "...", "input": "...", "output": "..."}` |
| ファイルサイズ | 623 MB (JSONL, LFS管理) |
| 出力平均長 | 6,052文字 (CoT + コード) |
| ライセンス | AGPL-3.0 |

## 🧠 設計思想

[Glint-Research/Fable-5-traces](https://huggingface.co/datasets/Glint-Research/Fable-5-traces) の4,665レコードを徹底解析し、
Claude (Fable-5) のコーディング性能を支える**5つの決定的因子**を特定:

| # | 因子 | 再現率 |
|---|------|--------|
| 1 | **厚いChain-of-Thought**(平均〜3,000文字の思考過程) | ✅ 100% |
| 2 | **自己指示・自己対話**(91.7%のレコードに含有) | ✅ 100% |
| 3 | **エラー予測と回復**(73.7%がエラー処理に言及) | ✅ 100% |
| 4 | **検証と確認**(62.2%が動作検証を含む) | ✅ 100% |
| 5 | **構造化コード出力**(コメント・設定・logging・export) | ✅ 100% |

## 📈 コード品質指標

| 指標 | カバレッジ |
|------|-----------|
| コメント付きコード | **100%** |
| エラー処理 (try/catch/except) | **100%** |
| 設定管理 (env/config) | **100%** |
| ロギング | **100%** |
| 関数/メソッド定義 | **100%** |
| エクスポート/公開API | 43.4% |

## 🌐 言語分布

| 言語 | 比率 |
|------|------|
| Python | ~32% |
| JavaScript | ~24% |
| TypeScript | ~12% |
| HTML+CSS+JS | ~10% |
| Node.js/Express | ~8% |
| React | ~7% |
| Bash/Shell | ~3% |
| Go | ~2% |

## 🚀 使い方

```python
import json

# データ読み込み
with open("coding_excellence.jsonl") as f:
    data = [json.loads(line) for line in f]

# Hugging Face datasets で読む
from datasets import load_dataset
ds = load_dataset("summerMC/coding-excellence", split="train")

# ChatML形式でファインチューニング
train_data = []
for r in ds:
    messages = [
        {"role": "user", "content": r["instruction"] + ("\n" + r["input"] if r["input"] else "")},
        {"role": "assistant", "content": r["output"]},
    ]
    train_data.append({"messages": messages})
```

## 🔧 カスタム生成

```bash
pip install numpy
python3 coding_excellence_generator.py --records 50000 --output my_data.jsonl --seed 42
```

## 📋 レコード例

```json
{
  "instruction": "Write a production-ready REST API server with proper error handling, logging, and configuration.",
  "input": "Language: python\nRequirements: Configurable behavior, robust error handling, structured logging, input validation.",
  "output": "Let me think through this carefully. We're building a REST API server...\n\n```python\nimport os\nimport sys\nimport json\nimport logging\n...\n```"
}
```

## 📝 ライセンス

AGPL-3.0

## 🙏 クレジット

- [Glint-Research/Fable-5-traces](https://huggingface.co/datasets/Glint-Research/Fable-5-traces) - 元データセット
- summerMC - 分布解析・合成生成