Dataset Viewer

The dataset viewer should be available soon. Please retry later.

neBrahma Nepali Pretrain Corpus P2b

Dataset Summary

The neBrahma Nepali Pretrain Corpus P2b is a large-scale, production-grade Nepali text corpus assembled and certified for language model pretraining. It contains 20,321,968 documents and 1.845 billion tokens of clean, verified Devanagari Nepali text, drawn from four diverse sources and processed through an eight-stage cleaning and quality pipeline.

This corpus serves as the training data for neBrahma-llm - a Nepali multimodal LLM (text + ASR + TTS) built from scratch in C++/CUDA. The corpus is certified FIT TO TRAIN with zero warnings and a 300-document human spot-check confirming linguistic quality.

Source Raw Docs Kept Docs Keep Rate License
IndicCorp v2 21,836,879 17,147,383 78.52% CC0
FineWeb-2 2,381,855 1,583,002 66.46% ODC-By
IRIIS Nepali 1,878,927 1,563,850 83.23% Research use
Sagarmatha ASR text 50,790 27,733 54.60% Author's own
Total 26,148,451 20,321,968 77.72% -

EDA Visualizations

Pipeline Overview

The corpus was constructed through an eight-stage pipeline:

  1. Fetch - stream raw documents from source APIs (HuggingFace datasets, IRIIS, ASR text)
  2. Clean - Unicode NFC normalization, Devanagari font conversion (Preeti/Kantipur → Unicode), script-ratio pre-filter
  3. Exact dedup - SHA-1 hash deduplication within each source
  4. Language ID - GlotLID filtering: keep npi_Deva (Nepali Devanagari) with score >= 0.6; line-level filtering for mixed-language documents
  5. Cross-source exact dedup - SHA-1 deduplication across all sources (merged)
  6. Near-dedup - MinHash LSH at Jaccard >= 0.8; removes near-duplicate paragraphs
  7. Quality annotation + filter - 25+ signal gates: word count, Devanagari ratio, digit ratio, Latin ratio, KenLM perplexity, n-gram repetition, stopword ratio, and more
  8. Split + pack - deterministic hash-keyed train/val/test split, then SentencePiece BPE tokenization into packed uint16 shards for training

Pipeline Funnel

Source Composition and Keep Rates

Source Keep Rates

Quality Filter Gate Analysis

The chart below shows the top rejection gates (gates overlap - a document may fail multiple).

Quality Gates

Document Length Distribution

Distribution of document lengths (in characters) across the quality-filtered corpus (sampled from 200K documents).

Document Length Distribution

Devanagari Ratio Distribution

All retained documents have Devanagari ratio = 1.0 (pure script, no Latin contamination).

Devanagari Ratio

Character Category Breakdown

Character Categories

Top-100 Nepali Words by Frequency

Top 100 Nepali Words

Token Zipf Distribution

Vocabulary frequency distribution follows the expected Zipfian curve. 32,000-token BPE vocabulary with 97.16% coverage (31,091 of 32,000 tokens seen in corpus).

Token Zipf Distribution


Dataset Structure

Data Fields

Field Type Description
id string Unique document identifier (format: {source}:{original_id})
text string Cleaned, NFC-normalized Nepali text in Devanagari script
source string Data source: indiccorp, fineweb2, iriis, or sagarmatha

Example Record

{
  "id": "indiccorp:npi_Deva_2847193",
  "text": "नेपाल सरकारले नयाँ शिक्षा नीति लागू गर्ने घोषणा गरेको छ। यो नीतिले प्राथमिक विद्यालयदेखि विश्वविद्यालय तहसम्मका विद्यार्थीहरूलाई प्रभाव पार्नेछ।",
  "source": "indiccorp"
}

Statistics

Corpus-Level

Metric Value
Total documents 20,321,968
Raw input documents 26,148,451
Overall keep rate 77.72%
Total tokens (BPE 32k) 1,845,781,044
Training tokens 1,827,236,028
Validation tokens 9,320,924
Test tokens 9,224,092
Total shards 21 (19 train / 1 val / 1 test)
Vocab size 32,000 (SentencePiece BPE)
Unique token types seen 31,091 / 32,000 (97.16%)
Mean Devanagari ratio 1.00 (pure script)
Halant density 7.87% of Devanagari chars
Chandrabindu per 1K Devanagari 4.92
Anusvara per 1K Devanagari 4.78
Font conversion applied 0% (all native Unicode)

Per-Source Document Counts

Source Kept Docs % of Total Est. Tokens
IndicCorp v2 17,147,383 84.4% ~1.556B
FineWeb-2 1,583,002 7.8% ~144M
IRIIS 1,563,850 7.7% ~142M
Sagarmatha ASR 27,733 0.1% ~2.5M

Quality Certification

Verdict   : FIT TO TRAIN
hard_ok   : true
warnings  : [] (zero)
spot_check: 300 documents - all pass
binary_checks: PASS (SHA-256 integrity, shard contract)
reversible: true (kept ∪ rejected == raw input)

Usage

from datasets import load_dataset

# Load the full corpus (~8GB parquet download)
ds = load_dataset("tonibirat/neBrahma-Nepali-Pretrain-Corpus")
print(ds)
# DatasetDict({'train': Dataset({features: ['id', 'text', 'source'], num_rows: 20321968})})

# Filter by source
indiccorp_only = ds["train"].filter(lambda x: x["source"] == "indiccorp")

# Iterate (streaming for large-scale use)
ds_stream = load_dataset("tonibirat/neBrahma-Nepali-Pretrain-Corpus", streaming=True)
for example in ds_stream["train"]:
    text = example["text"]   # Nepali Devanagari text
    src  = example["source"] # "indiccorp" | "fineweb2" | "iriis" | "sagarmatha"
    break

Limitations

  • IRIIS crowd-source noise: The IRIIS subset relies on crowd-sourced transcriptions which may contain latent inaccuracies despite passing the quality filter.
  • No demographic metadata: No speaker, regional dialect, or domain metadata is included. Source provenance is available via the source field.
  • Sagarmatha ASR fraction is small: The Sagarmatha ASR text subset (27,733 docs, 0.1%) consists of short utterance-level transcriptions and has a lower keep rate (54.6%) due to the minimal-sentence nature of ASR transcripts.
  • EDA sample: Document-level EDA visualizations (length distribution, character breakdown, word frequency) were computed on a 200K-document sample, not the full 20.3M. Shard-level token statistics are exact (computed from all 21 shards).
  • Per-source license: IndicCorp v2 is CC0; FineWeb-2 is ODC-By (attribution required); IRIIS is distributed for research use. Verify compliance with your use case.

Citation

If you use this dataset, please cite:

@misc{neBrahma2026,
  title        = {neBrahma-llm: A Nepali Multimodal Language Model Trained from Scratch},
  author       = {Gautam, Toni Birat},
  year         = {2026},
  institution  = {Final Year Project},
  howpublished = {\url{https://github.com/ToniBirat7/neBrahma-llm}},
  note         = {Corpus: neBrahma Nepali Pretrain Corpus P2b --
                  20.3M docs / 1.845B tokens / 4 sources / FIT TO TRAIN}
}
Downloads last month
237

Models trained or fine-tuned on tonibirat/neBrahma-Nepali-Pretrain-Corpus