Update README: unigram model, 369M tokens
Browse files
README.md
CHANGED
|
@@ -15,29 +15,30 @@ Cleaned and tokenized Turkish text corpus for language model training.
|
|
| 15 |
|
| 16 |
## Dataset Summary
|
| 17 |
|
| 18 |
-
|
| 19 |
-
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
## Cleaning
|
| 26 |
|
| 27 |
-
- Fixed broken Latin-1→UTF8 encoding
|
| 28 |
- Removed Myanmar/Burmese contamination (58 lines)
|
| 29 |
-
- Removed HTML tags, junk lines, empty lines
|
| 30 |
-
- Removed adjacent duplicate lines
|
| 31 |
- Normalized whitespace, removed soft hyphens & non-breaking spaces
|
| 32 |
|
| 33 |
## Files
|
| 34 |
|
| 35 |
| File | Description | Size |
|
| 36 |
|---|---|---|
|
| 37 |
-
| `tr_unigram_8192_corpus_ids.npy` | Tokenized corpus (flat int32
|
| 38 |
-
| `tr_unigram_8192.model` | SentencePiece Unigram model | ~
|
| 39 |
-
| `tr_unigram_8192.vocab` | Vocabulary text file | ~
|
| 40 |
-
| `spm_vocab.json` | Vocabulary
|
| 41 |
| `spm_meta.json` | Training metadata | ~586 B |
|
| 42 |
|
| 43 |
## Usage
|
|
@@ -47,23 +48,17 @@ import numpy as np
|
|
| 47 |
from huggingface_hub import hf_hub_download
|
| 48 |
import sentencepiece as spm
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
model_path = hf_hub_download(repo_id="dcx514ai/my_turkish_corpus_1", filename="tr_unigram_8192.model")
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
print(f"Tokens: {len(ids):,}") # ~369M
|
| 57 |
-
|
| 58 |
-
# Decode tokens back to text
|
| 59 |
-
sp = spm.SentencePieceProcessor(model_file=model_path)
|
| 60 |
text = sp.decode(ids[:100].tolist())
|
| 61 |
print(text)
|
| 62 |
```
|
| 63 |
|
| 64 |
## Stats
|
| 65 |
|
| 66 |
-
-
|
| 67 |
-
-
|
| 68 |
-
-
|
| 69 |
-
- **Total tokens:** ~369M
|
|
|
|
| 15 |
|
| 16 |
## Dataset Summary
|
| 17 |
|
| 18 |
+
| Property | Value |
|
| 19 |
+
|---|---|
|
| 20 |
+
| Language | Turkish |
|
| 21 |
+
| Token count | ~369M |
|
| 22 |
+
| Vocab size | 8192 (SentencePiece Unigram) |
|
| 23 |
+
| UNK rate | 0% |
|
| 24 |
+
| Chars/token | 3.62 |
|
| 25 |
+
| Token dtype | int32 |
|
| 26 |
|
| 27 |
+
## Cleaning
|
| 28 |
|
| 29 |
+
- Fixed 38K+ broken Latin-1→UTF8 encoding errors
|
| 30 |
- Removed Myanmar/Burmese contamination (58 lines)
|
| 31 |
+
- Removed HTML tags, junk lines, empty lines, adjacent duplicates
|
|
|
|
| 32 |
- Normalized whitespace, removed soft hyphens & non-breaking spaces
|
| 33 |
|
| 34 |
## Files
|
| 35 |
|
| 36 |
| File | Description | Size |
|
| 37 |
|---|---|---|
|
| 38 |
+
| `tr_unigram_8192_corpus_ids.npy` | Tokenized corpus (flat int32) | ~1.48 GB |
|
| 39 |
+
| `tr_unigram_8192.model` | SentencePiece Unigram model | ~374 KB |
|
| 40 |
+
| `tr_unigram_8192.vocab` | Vocabulary text file | ~144 KB |
|
| 41 |
+
| `spm_vocab.json` | Vocabulary JSON (piece→id) | ~155 KB |
|
| 42 |
| `spm_meta.json` | Training metadata | ~586 B |
|
| 43 |
|
| 44 |
## Usage
|
|
|
|
| 48 |
from huggingface_hub import hf_hub_download
|
| 49 |
import sentencepiece as spm
|
| 50 |
|
| 51 |
+
npy = hf_hub_download("dcx514ai/my_turkish_corpus_1", "tr_unigram_8192_corpus_ids.npy")
|
| 52 |
+
mdl = hf_hub_download("dcx514ai/my_turkish_corpus_1", "tr_unigram_8192.model")
|
|
|
|
| 53 |
|
| 54 |
+
ids = np.load(npy) # ~369M tokens
|
| 55 |
+
sp = spm.SentencePieceProcessor(model_file=mdl)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
text = sp.decode(ids[:100].tolist())
|
| 57 |
print(text)
|
| 58 |
```
|
| 59 |
|
| 60 |
## Stats
|
| 61 |
|
| 62 |
+
- `tr_corpus_clean.txt`: 2,029,958 lines / 696 MB
|
| 63 |
+
- `tr_corpus2_clean.txt`: 419,629 lines / 640 MB
|
| 64 |
+
- Total: 2,449,587 clean lines / ~1.34 GB raw text → 369M tokens
|
|
|