--- language: - ne - en license: cc-by-nc-4.0 task_categories: - automatic-speech-recognition tags: - nepali - code-switching - code-mixed - cs-asr - nepaglish pretty_name: Nepali-English Code-Switched ASR size_categories: - 10K **v2 (2026-07)**, the current revision. Splits are **channel-disjoint** (see [Evaluation protocol](#evaluation-protocol-v2)) and the license is CC BY-NC 4.0. The previous revision (v1, speaker-overlapped by 3 videos, CC BY 4.0) remains loadable via `revision="0572d9cc7f4454984c87d6cac9685c78430c8582"`; results computed on v1 are not comparable to v2 results. ## Dataset summary | | | |---|---| | Total clips | 20,805 | | Total duration | 58.42 hours | | Audio format | WAV, 16 kHz, mono, 16-bit (loudness-normalised to −20 dBFS) | | Video format | MP4 (source clips) | | Label source | Transcriptions, corpus-audited + label-quality gated (ADR-0026/0027) | | Splits | train / validation / test, **channel-disjoint** | | Languages | Nepali (`ne`), English (`en`), code-switched (`cs`) | | Source channels | 20 YouTube channels (`speaker_id`), 161 videos | ## Code-switching statistics Computed in a single pass over the published release of revision `dd00ca41` (token language via script: Latin → `en`, Devanagari → `ne`; see [Statistics provenance](#statistics-provenance) below): | statistic | value | |---|---| | Tokens | 532,205 (English 34.0% · Nepali 66.0%) | | Clips containing both languages (intra-sentential CS) | **94.5%** | | Language-switch rate | 37.0% of adjacent token pairs | | Switches per 100 tokens (median, clips ≥ 10 tokens) | 35.7 | | Code-Mixing Index (`cmi` column) | mean 28.57 · median 29.63 · IQR 20.7-38.5 | | Clip duration | 3-14 s, mean 10.1 s | | Per-channel English-token share | 12.5%-52.2% | ### Statistics provenance `cmi` and `speech_type` are derived from `transcription`, and for part of the corpus's history the annotation save path wrote a corrected transcript without recomputing them, so a stored value is only as fresh as the last derivation pass over that row. A statistics run over the release shards themselves found that **4,885 of the 20,805 released rows carry a stored `cmi`, and 93 a stored `speech_type`, that disagree with a recomputation from their own text** (4,727 of the `cmi` disagreements are in `train`, where the numeral-convention corrections landed). The statistics on this card are therefore recomputed from each clip's own transcript in one pass; a mean and a median quoted side by side describe the same clips. Re-publishing corrected column values would be a new release and is tracked as a separate decision; `transcription_romanized` has a known pending decision of the same shape and must not be swept along with it. Reproduce with `asr/scripts/corpus/release_corpus_stats.py`. ## Splits (v2, channel-disjoint) No YouTube channel (`speaker_id`) appears in more than one split, in **either** config: | split | clips | channels | |---|---|---| | train | 16,702 | 15 | | validation | 2,338 | 3 | | test | 1,765 | 2 | ## Evaluation protocol (v2) The v2 splits are **channel-disjoint**: every clip of a given YouTube channel, the closest available proxy for speaker identity, lives in exactly one split, so test performance measures generalisation to **unseen speakers/channels**, not memorisation of seen voices. v1 leaked 85 train clips (3 whole videos) from the two evaluation channels; v2 moved them to their channels' home splits and dropped their 312 offline-augmented derivatives from the `augmented` config. Report results on v2 only. **v2.1 label-quality pass (ADR-0026/0027).** One wrong-language channel (81 Hindi clips) was dropped from `train`; `transcription_devanagari` was rebuilt from an Aksharantar-backed, structurally-validated phonetic lexicon (was 5.84% structurally-invalid substitutions, now 0%); `transcription` was symbol/whitespace-normalised; and per-clip provenance (`video_id`/`start_ms`/`end_ms`) was added. A reproducible audit gate (language, script validity, romanized reproducibility) now guards every re-publish. ## Configs This repo publishes two `datasets` configs so that offline-augmented shards never get inferred as an implicit split (a hyphenated split name breaks the whole repo's loadability; see below): | config | `train` split | `validation` / `test` | extra columns | |---|---|---|---| | `default` | 16,702 clean clips (`data/train-*.parquet`) | 2,338 / 1,765 clips | — | | `augmented` | offline-augmented clips (`data/augmented-train-*.parquet`), channel-disjoint from `default`'s validation/test | — (train only) | `augmentation` | ```python from datasets import load_dataset # Default config: clean train/validation/test, used for headline training/eval ds = load_dataset("saileshbro/nepali-cs-asr") # Augmented config: offline-augmented train shards only, for ablation runs aug = load_dataset("saileshbro/nepali-cs-asr", "augmented") ``` The `data/augmented-train-*.parquet` shards are **not** part of the `default` config's `train` split: the glob `data/train-*.parquet` matches paths starting with the literal text `data/train-`, which excludes `data/augmented-train-*`. Without this explicit `configs:` declaration, `datasets` would infer an `augmented-train` split from the filenames, which is not a legal split name (`^\w+(\.\w+)*$`; hyphens aren't allowed) and would make the *entire* repo fail to load. ## Speech type distribution Classified in the same single pass by the languages each clip's own transcript actually contains (see [Statistics provenance](#statistics-provenance)): | speech_type | clips | description | |---|---|---| | `cs` | 19,666 | Code-switched Nepali-English | | `en` | 654 | Predominantly English | | `ne` | 481 | Predominantly Nepali | | *(empty)* | 4 | Transcript carries no language-bearing token | The stored `speech_type` column is derived from `transcription` and lags the measured classification for 93 rows (see above). ## Schema | column | type | description | |---|---|---| | `audio` | `Audio(16000)` | Loudness-normalised WAV clip | | `video` | `Video` | Source MP4 clip | | `transcription` | `string` | Mixed-script canonical label (Devanagari + Latin) | | `transcription_devanagari` | `string` | Full Devanagari rendering of `transcription` | | `transcription_romanized` | `string` | Full Latin transliteration of `transcription` (ASR target) | | `speech_type` | `string` | `cs` / `ne` / `en` — derived from `transcription`; see [Statistics provenance](#statistics-provenance) for stored-vs-measured freshness | | `cmi` | `float32` | Code-Mixing Index, the fraction of non-matrix-language tokens — derived from `transcription`; see [Statistics provenance](#statistics-provenance) | | `speaker_id` | `string` | YouTube channel ID (`UC…`) | | `duration_s` | `float32` | Clip duration in seconds | | `video_id` | `string` | Source YouTube video ID (per-clip provenance) | | `start_ms` | `int64` | Clip start offset within the source video (ms) | | `end_ms` | `int64` | Clip end offset within the source video (ms) | ## Usage ```python from datasets import load_dataset ds = load_dataset("saileshbro/nepali-cs-asr") # Train split train = ds["train"] # Filter to code-switched clips only cs_only = train.filter(lambda x: x["speech_type"] == "cs") # Filter by mixing level (highly mixed: CMI > 30) high_mix = train.filter(lambda x: x["cmi"] is not None and x["cmi"] > 30) ``` ## Transcription convention `transcription` follows the **Romanised Nepaglish** convention: English tokens stay in Latin script, Nepali tokens are written in Devanagari. This is the natural mixed-script form used by the teachers in the source videos. `transcription_romanized` is a rule-based transliteration of the full transcript into Latin script, useful as a phonemic ASR target that avoids Devanagari script handling. ## Label quality A corpus-level script-error audit was run to detect and correct Devanagarized-English tokens (e.g. `सो` written for the spoken English filler "so"); confirmed errors were replaced before publishing. Most transcripts are **silver labels**: machine-generated and audited, not listened to. A growing subset has been **verified by a human listening to the clip in full** and edited where needed. As of 2026-08-03: | split | rows | human-verified `transcription` | |---|---|---| | train | 16,702 | 586 | | validation | 2,338 | 23 | | test | 1,765 | 168 | Two caveats a user of this dataset should know: - **`test` is not fully synchronised.** A further 319 test rows have been human-verified in the source database but still carry machine text here. They are being held back until an identity problem in that split is resolved (3 rows carry no clip provenance and one provenance key is shared by 3 rows), because correcting text by key while keys are ambiguous risks attaching one clip's words to another clip's audio. - **`transcription_devanagari` and `transcription_romanized` are stale for the human-verified rows.** Both are derived from `transcription`, and they were last derived on 2026-07-17, before these corrections. They will be re-derived for the whole corpus in one pass rather than per row, so that a re-derivation is never mistaken for an edit. Use `transcription` if you need the corrections. The verified labels also ship in the source repository as a plain JSONL snapshot, so they are recoverable independently of this dataset. An annotation style guide and inter-annotator agreement on a double-annotated subset are in preparation. ## Data collection Source videos are public STEM and CS lectures from Nepali YouTube channels covering topics including algorithms, data structures, electronics, physics, and mathematics. Clips were segmented using voice-activity detection, intro music zones (first 90 seconds per video) were excluded, and audio was loudness-normalised. ## Excluded clips The project's clip database holds 22,175 segments; **20,803** are published here. The 1,373 that are not break down as (recounted against the live shards on 2026-08-04): - **1,297** start within the first 90 seconds of their source video, the intro-music zone. They have transcripts in the database but no clean audio was generated for them. - **76** are withheld for other reasons, chiefly gold-set material held back from the published corpus. The 90-second rule is applied at clip-generation time rather than as a filter over the published set, so it is not absolute: 186 clips that start inside that window did get clean audio and are included. ## Clips excluded from training `excluded_from_training.json` (at the root of this dataset repository) lists **1,615** published clips whose silver label carries a defect that no text edit can repair. They stay in the dataset, so it still describes what the transcription teacher produced, but a trainer should skip them. Each clip id (`{video_id}_{start_ms}_{end_ms}`) carries its reason: | reason | clips | what it is | |---|---|---| | `notation-paraphrase` | 1,587 | a spoken Nepali phrase came back as a bare operator symbol (`A बाट B घटाउनु` → `A - B`); the word order cannot be recovered from the symbol | | `hyphen-operator` | 23 | the same defect welded to its operands (`N-1`) | | `speed-artifact` | 5 | the source video plays at about 2x, so the label pairs fast speech with normal text | By split: 1,288 train, 224 validation, 103 test. Only the train exclusions affect training; the list covers every split so the defect is visible wherever the clip is used. No clip a person verified by listening is ever excluded. The list is rebuilt by `asr/scripts/labeling/build_training_exclusions.py` in the source repository. ```python import json from huggingface_hub import hf_hub_download from datasets import load_dataset path = hf_hub_download("saileshbro/nepali-cs-asr", "excluded_from_training.json", repo_type="dataset") skip = set(json.load(open(path))["clips"]) train = load_dataset("saileshbro/nepali-cs-asr", split="train") key = lambda r: f"{r['video_id']}_{r['start_ms']}_{r['end_ms']}" train = train.filter(lambda r: key(r) not in skip) ``` ## Revision history Every state below is still retrievable; pass the commit SHA as `revision=` to `load_dataset`, or browse the repo's commit history. The dates are from the repo's own commits, and the earliest recorded one is 2026-06-29. | date | what changed | why it matters to a user | |---|---|---| | 2026-06-29 | `v1.1`: corrected romanization (`tapailai`, not `tapaaeenlaaee`) | earliest recorded revision; `transcription_romanized` before this is not usable | | 2026-07-02 | added `transcription_deva`, fixed the parquet page index | the Devanagari column and dataset-viewer random access appear here | | 2026-07-03 | published the `augmented` config (offline-augmented train shards) | the ablation config; not part of the default corpus | | 2026-07-10 | **v2: channel-disjoint splits** | splits were re-cut so no channel appears in more than one split. Any result computed on a pre-v2 split has train/test speaker overlap | | 2026-07-17 | **label-column regeneration**: dropped an 81-clip wrong-language (Hindi) channel, normalized `transcription`, re-derived both derived columns from the v2 lexicon, and attached `video_id`/`start_ms`/`end_ms` | train went 16,783 → **16,702**. The per-clip provenance columns first exist here; before this, rows cannot be traced to a source video offset | | 2026-08-03 | applied human-verified transcriptions to 338 train/validation rows | the first time hand-made corrections reached this dataset at all; see **Label quality** | The 2026-08-03 revision is worth one extra note. Before it, corrections made by a human listening to clips existed only in the project's own database: the 2026-07-17 job derived its columns from *the shards' own text* rather than from that database, so no manual edit had ever propagated here. If you pulled this dataset before 2026-08-03, 338 rows of it carry machine text that has since been corrected. ## Citation If you use this dataset, please cite: ```bibtex @dataset{dahal2026nepali, author = {Dahal, Sailesh}, title = {Nepali--English Code-Switched ASR}, year = {2026}, publisher = {HuggingFace}, url = {https://huggingface.co/datasets/saileshbro/nepali-cs-asr}, note = {v2, channel-disjoint splits} } ``` A paper describing the corpus, the channel-disjoint + romanization-normalized evaluation protocol, and benchmark results is in preparation; this citation will be updated when it is available. ## License and provenance Released under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/) (v1 was CC BY 4.0; v2 tightens to non-commercial). The clips are short excerpts of publicly available educational YouTube videos, redistributed for **non-commercial speech-recognition research** in a low-resource language variety, in the spirit of research fair use established by corpora built from public web video. The `video` column preserves source-clip provenance. If you are a channel owner and want your material removed, open a discussion on this repo and it will be taken down promptly. Users are responsible for verifying compliance with the terms of service of the original channels for any further redistribution.