meet5568 commited on
Commit
f51165d
·
verified ·
1 Parent(s): 81ff92e

Correct the Nepali figures: post-downsample, 22% manual

Browse files
Files changed (1) hide show
  1. README.md +46 -18
README.md CHANGED
@@ -12,18 +12,31 @@ tags:
12
  - pretraining-corpus
13
  ---
14
 
15
- # LMA Phase 1 Hindi and Nepali pretraining corpora
16
 
17
  Two monolingual corpora built for a pair of ~25M-parameter decoder-only
18
  Transformers. Hindi is the higher-resource language, Nepali the lower-resource
19
- one. Both are written in Devanagari (U+0900U+097F), so **script cannot be used
20
- to tell them apart** separating them is the central technical problem this
21
  dataset solves rather than assumes.
22
 
23
- | language | documents | characters | manual share | train | val | test | unseen domain |
24
- |---|---|---|---|---|---|---|---|
25
- | Hindi | 5,094,185 | 2.588B | 23.1% | 3,564,832 | 762,609 | 763,607 | 3,137 (bbc_hindi) |
26
- | Nepali | 6,755,888 | 2.513B | 17.0% | 4,726,832 | 1,014,710 | 1,011,740 | 2,606 (nagarik_news) |
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  ## Layout
29
 
@@ -34,14 +47,20 @@ hindi/tokenized/ one line per document, with the actual token pieces
34
  nepali/... the same three
35
  ```
36
 
37
- All files are gzipped JSONL, one JSON object per line.
 
 
 
 
 
 
 
38
 
39
  ## Provenance
40
 
41
  Two buckets. **download** is IndicCorp v2, a public corpus. **manual** is text
42
- whose fetching and cleaning code was written for this project news sitemaps
43
- and link crawls, MediaWiki API harvests, and literature sites. The manual share
44
- is reported above and is the graded part of the assignment.
45
 
46
  Every document carries a `doc_id` of the form `<lang>:<bucket>:<source>:<hash>`,
47
  so any line can be traced to the source and the collection run that produced it.
@@ -57,7 +76,7 @@ near-duplicate removal at Jaccard 0.8.
57
 
58
  Verification is part of the pipeline, not an afterthought: **0 foreign letters
59
  across all 14,333,273 documents**, and five independent layers checking that the
60
- two corpora share nothing including a character n-gram classifier that
61
  separates them at 100% accuracy.
62
 
63
  ## Splits
@@ -74,24 +93,33 @@ after splitting: **zero** in both languages.
74
  ## Tokenized files
75
 
76
  Produced by the tokenizers at
77
- [meet5568/lma_models](https://huggingface.co/meet5568/lma_models). Each line
78
- stores the token **pieces** rather than numeric ids:
 
79
 
80
  ```json
81
  {"doc_id": "hi:manual:bbc_hindi:f79a...", "bucket": "manual",
82
  "source": "bbc_hindi", "n_tokens": 256,
83
- "text": "एशियाई ��ेलः पाकिस्तान ने भारत को हराया ",
84
- "tokens": ["▁एशियाई", "▁खेल", "ः", "▁पाकिस्तान", "▁ने", …]}
85
  ```
86
 
87
  Ids are one `piece_to_id` lookup away and storing both would add ~2 GB per
88
  language for no new information.
89
 
 
 
 
 
 
 
 
 
90
  ## Limitations
91
 
92
  Web-scraped text carries the biases of what is published online: news
93
  dominates, and formal registers are over-represented relative to conversational
94
  Nepali and Hindi. PII is anonymised with placeholders rather than removed.
95
- Contamination between the two languages was one-directional before cleaning
96
  Nepali documents misidentified as Hindi outnumbered the reverse by roughly
97
- 120×, which is why the language-ID stage runs before the cheap filters.
 
12
  - pretraining-corpus
13
  ---
14
 
15
+ # LMA Phase 1 --- Hindi and Nepali pretraining corpora
16
 
17
  Two monolingual corpora built for a pair of ~25M-parameter decoder-only
18
  Transformers. Hindi is the higher-resource language, Nepali the lower-resource
19
+ one. Both are written in Devanagari (U+0900-U+097F), so **script cannot be used
20
+ to tell them apart** --- separating them is the central technical problem this
21
  dataset solves rather than assumes.
22
 
23
+ | language | documents | characters | manual (chars) | tokens | manual (tokens) | train | val | test | unseen domain |
24
+ |---|---|---|---|---|---|---|---|---|---|
25
+ | Hindi | 5,094,185 | 2.588B | 23.1% | 655.2M | 24.5% | 3,564,832 | 762,609 | 763,607 | 3,137 (bbc_hindi) |
26
+ | Nepali | 6,755,888 | 2.513B | 22.0% | 558.9M | 22.0% | 4,726,832 | 1,014,710 | 1,011,740 | 2,606 (nagarik_news) |
27
+
28
+ Both corpora clear the project's requirement that at least 20% of final tokens
29
+ come from manually collected text.
30
+
31
+ ## Nepali was downsampled, Hindi was not
32
+
33
+ Nepali's cleaned corpus held 9,031,132 download documents against 207,956 manual ones, a manual share of 17.0% by characters -- below the 20% the project requires. Manual text is the scarce side and cannot be conjured, so the download bucket was thinned instead: 6,547,932 documents kept out of 9,031,132 (72.5%), lifting the manual share to 22.0%.
34
+
35
+ The selection is a seeded shuffle accumulating to a character budget, so it is uniform over documents and leaves the length distribution unchanged; keeping the longest documents instead would have biased the tokenizer's training data. Only the download bucket was touched, because it is a single source (IndicCorp v2) and thinning it costs no register diversity, unlike the manual bucket which carries all the literature, encyclopedic and long-form text.
36
+
37
+ **Nothing was deleted.** `stage2.jsonl` is intact and the selection lives in a committed list of document ids, so a choice that turns out wrong is fixed by regenerating one text file rather than by re-downloading and re-cleaning. The files published here are the downsampled corpus.
38
+
39
+ Hindi needed none of this: at 23.1% manual it already cleared the floor, and trimming it would have shrunk the corpus for no benefit.
40
 
41
  ## Layout
42
 
 
47
  nepali/... the same three
48
  ```
49
 
50
+ All files are gzipped JSONL, one JSON object per line. For a browsable copy of
51
+ the tokenized data, see the Kaggle mirrors linked at the end.
52
+
53
+ **A note on the `clean/` files for Nepali.** `stage2.jsonl` there holds all
54
+ 9,239,088 cleaned documents, which is the corpus *before* downsampling. The
55
+ 6,755,888-document selection published as the Nepali corpus is defined by the
56
+ committed id list, not by a separate file. Use the split id lists if you want
57
+ exactly the corpus described in the table above.
58
 
59
  ## Provenance
60
 
61
  Two buckets. **download** is IndicCorp v2, a public corpus. **manual** is text
62
+ whose fetching and cleaning code was written for this project --- news sitemaps
63
+ and link crawls, MediaWiki API harvests, and literature sites.
 
64
 
65
  Every document carries a `doc_id` of the form `<lang>:<bucket>:<source>:<hash>`,
66
  so any line can be traced to the source and the collection run that produced it.
 
76
 
77
  Verification is part of the pipeline, not an afterthought: **0 foreign letters
78
  across all 14,333,273 documents**, and five independent layers checking that the
79
+ two corpora share nothing --- including a character n-gram classifier that
80
  separates them at 100% accuracy.
81
 
82
  ## Splits
 
93
  ## Tokenized files
94
 
95
  Produced by the tokenizers at
96
+ [meet5568/lma_models](https://huggingface.co/meet5568/lma_models) --- unigram
97
+ 10,000 for both languages. Each line stores the token **pieces** rather than
98
+ numeric ids:
99
 
100
  ```json
101
  {"doc_id": "hi:manual:bbc_hindi:f79a...", "bucket": "manual",
102
  "source": "bbc_hindi", "n_tokens": 256,
103
+ "text": "एशियाई ेलः पाकिस्तान ने भारत को हराया ...",
104
+ "tokens": ["▁एशियाई", "▁खेल", "ः", "▁पाकिस्तान", "▁ने"]}
105
  ```
106
 
107
  Ids are one `piece_to_id` lookup away and storing both would add ~2 GB per
108
  language for no new information.
109
 
110
+ ## Browsable mirrors
111
+
112
+ The gzipped files here cannot be previewed in a browser. The tokenized data is
113
+ also on Kaggle, where it can be read directly:
114
+
115
+ - https://kaggle.com/datasets/meet6868/lma-hindi-corpus
116
+ - https://kaggle.com/datasets/meet6868/lma-nepali-corpus
117
+
118
  ## Limitations
119
 
120
  Web-scraped text carries the biases of what is published online: news
121
  dominates, and formal registers are over-represented relative to conversational
122
  Nepali and Hindi. PII is anonymised with placeholders rather than removed.
123
+ Contamination between the two languages was one-directional before cleaning ---
124
  Nepali documents misidentified as Hindi outnumbered the reverse by roughly
125
+ 120x, which is why the language-ID stage runs before the cheap filters.