Datasets:
docs: add condition-3-zh-5k to README (schema, configs, usage)
Browse files
README.md
CHANGED
|
@@ -231,15 +231,18 @@ Keyword-swapped variants are produced using [Legesher](https://github.com/legesh
|
|
| 231 |
|
| 232 |
## Available Configs
|
| 233 |
|
| 234 |
-
| Config
|
| 235 |
-
| ---------------- | --------------------- | -------- | ------------------------------------------------------------------------------------------------ |
|
| 236 |
-
| `condition-1-en`
|
| 237 |
-
| `condition-2-ur`
|
| 238 |
-
| `condition-2-zh`
|
| 239 |
-
| `condition-2-es`
|
|
|
|
| 240 |
|
| 241 |
## Schema
|
| 242 |
|
|
|
|
|
|
|
| 243 |
| Column | Type | Description |
|
| 244 |
| ------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 245 |
| `code` | string | Python source code. For condition-2 configs, this is the transpiled (keyword-swapped) version. For condition-1, this is the original English source. |
|
|
@@ -249,16 +252,31 @@ Keyword-swapped variants are produced using [Legesher](https://github.com/legesh
|
|
| 249 |
| `license` | string | SPDX license identifier for the source file. |
|
| 250 |
| `token_count` | int64 | Token count computed using the CohereLabs/tiny-aya-base tokenizer. |
|
| 251 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 252 |
## Experimental Conditions
|
| 253 |
|
| 254 |
The Language Decoded experiment uses a ladder of six conditions to isolate the mechanism behind code's reasoning benefit. This dataset currently provides data for conditions 1 and 2:
|
| 255 |
|
| 256 |
-
| Condition | Name | Purpose
|
| 257 |
-
| --------------- | -------------------- | -------------------------------------------------------------------------- |
|
| 258 |
-
| Baseline | No fine-tuning | Establishes the performance floor
|
| 259 |
-
| Condition 1 | English code | Tests whether code fine-tuning helps at all (replicates Aryabumi et al.)
|
| 260 |
-
| Condition 2 | Keyword-swapped code | Tests whether the _language_ of keywords matters for the reasoning benefit
|
| 261 |
-
|
|
|
|
|
| 262 |
|
| 263 |
## Usage
|
| 264 |
|
|
@@ -273,9 +291,15 @@ ds = load_dataset("legesher/language-decoded-data", "condition-2-ur")
|
|
| 273 |
ds = load_dataset("legesher/language-decoded-data", "condition-2-zh")
|
| 274 |
ds = load_dataset("legesher/language-decoded-data", "condition-2-es")
|
| 275 |
|
|
|
|
|
|
|
|
|
|
| 276 |
# Access splits
|
| 277 |
train = ds["train"]
|
| 278 |
val = ds["validation"]
|
|
|
|
|
|
|
|
|
|
| 279 |
```
|
| 280 |
|
| 281 |
## Technical Details
|
|
|
|
| 231 |
|
| 232 |
## Available Configs
|
| 233 |
|
| 234 |
+
| Config | Condition | Language | Description |
|
| 235 |
+
| --------------------- | --------------------- | -------- | ------------------------------------------------------------------------------------------------ |
|
| 236 |
+
| `condition-1-en` | Condition 1 (control) | English | Unmodified filtered Python from The Stack Dedup |
|
| 237 |
+
| `condition-2-ur` | Condition 2 | Urdu | Keyword-swapped Python -- 37 keywords, 72 builtins, 66 exceptions translated via Legesher v0.7.3 |
|
| 238 |
+
| `condition-2-zh` | Condition 2 | Chinese | Keyword-swapped Python -- same transpilation method |
|
| 239 |
+
| `condition-2-es` | Condition 2 | Spanish | Keyword-swapped Python -- same transpilation method |
|
| 240 |
+
| `condition-3-zh-5k` | Condition 3 | Chinese | Blended: 3,486 native Chinese code + 1,514 transpiled Python (see Condition 3 section below) |
|
| 241 |
|
| 242 |
## Schema
|
| 243 |
|
| 244 |
+
### Conditions 1--2
|
| 245 |
+
|
| 246 |
| Column | Type | Description |
|
| 247 |
| ------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 248 |
| `code` | string | Python source code. For condition-2 configs, this is the transpiled (keyword-swapped) version. For condition-1, this is the original English source. |
|
|
|
|
| 252 |
| `license` | string | SPDX license identifier for the source file. |
|
| 253 |
| `token_count` | int64 | Token count computed using the CohereLabs/tiny-aya-base tokenizer. |
|
| 254 |
|
| 255 |
+
### Condition 3
|
| 256 |
+
|
| 257 |
+
Condition 3 blends native Chinese code with transpiled code and adds a `source_type` column to distinguish them. `code_en` is populated for transpiled rows (keeping them in sync with conditions 1--2) but null for native code rows, which have no English equivalent.
|
| 258 |
+
|
| 259 |
+
| Column | Type | Description |
|
| 260 |
+
| ------------- | ----------- | ---------------------------------------------------------------------------------- |
|
| 261 |
+
| `file_path` | string | File identifier (native filename or transpiled file path) |
|
| 262 |
+
| `code` | string | The code content (native or transpiled) |
|
| 263 |
+
| `code_en` | string/null | English original -- populated for transpiled rows, null for native code rows |
|
| 264 |
+
| `language` | string | ISO 639-1 language code (`zh`) |
|
| 265 |
+
| `license` | string | Source license (SPDX identifier, `UNKNOWN`, or `varies`) |
|
| 266 |
+
| `token_count` | int64 | Token count computed using the CohereLabs/tiny-aya-base tokenizer |
|
| 267 |
+
| `source_type` | string | `"native"` (natively Chinese-authored) or `"transpiled"` (keyword-swapped English) |
|
| 268 |
+
|
| 269 |
## Experimental Conditions
|
| 270 |
|
| 271 |
The Language Decoded experiment uses a ladder of six conditions to isolate the mechanism behind code's reasoning benefit. This dataset currently provides data for conditions 1 and 2:
|
| 272 |
|
| 273 |
+
| Condition | Name | Purpose |
|
| 274 |
+
| --------------- | -------------------- | ----------------------------------------------------------------------------------------- |
|
| 275 |
+
| Baseline | No fine-tuning | Establishes the performance floor |
|
| 276 |
+
| Condition 1 | English code | Tests whether code fine-tuning helps at all (replicates Aryabumi et al.) |
|
| 277 |
+
| Condition 2 | Keyword-swapped code | Tests whether the _language_ of keywords matters for the reasoning benefit |
|
| 278 |
+
| Condition 3 | Mixed native sources | Tests whether diverse native-language code adds value beyond keyword swapping |
|
| 279 |
+
| Conditions 4--6 | (planned) | Additional controls not yet included in this dataset |
|
| 280 |
|
| 281 |
## Usage
|
| 282 |
|
|
|
|
| 291 |
ds = load_dataset("legesher/language-decoded-data", "condition-2-zh")
|
| 292 |
ds = load_dataset("legesher/language-decoded-data", "condition-2-es")
|
| 293 |
|
| 294 |
+
# Load blended native + transpiled (condition 3)
|
| 295 |
+
ds = load_dataset("legesher/language-decoded-data", "condition-3-zh-5k")
|
| 296 |
+
|
| 297 |
# Access splits
|
| 298 |
train = ds["train"]
|
| 299 |
val = ds["validation"]
|
| 300 |
+
|
| 301 |
+
# Filter condition-3 by source type
|
| 302 |
+
native_only = train.filter(lambda x: x["source_type"] == "native")
|
| 303 |
```
|
| 304 |
|
| 305 |
## Technical Details
|