Datasets:
Update dataset card with sampling details
Browse files
README.md
CHANGED
|
@@ -1,43 +1,94 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
dataset_info:
|
| 3 |
features:
|
| 4 |
- name: text
|
| 5 |
dtype: string
|
| 6 |
-
- name: id
|
| 7 |
-
dtype: string
|
| 8 |
-
- name: wikiname
|
| 9 |
-
dtype: string
|
| 10 |
-
- name: page_id
|
| 11 |
-
dtype: int64
|
| 12 |
-
- name: title
|
| 13 |
-
dtype: string
|
| 14 |
- name: url
|
| 15 |
dtype: string
|
| 16 |
-
- name: date_modified
|
| 17 |
-
dtype: string
|
| 18 |
-
- name: in_language
|
| 19 |
-
dtype: string
|
| 20 |
-
- name: wikidata_id
|
| 21 |
-
dtype: string
|
| 22 |
-
- name: bytes_html
|
| 23 |
-
dtype: int64
|
| 24 |
-
- name: wikitext
|
| 25 |
-
dtype: string
|
| 26 |
-
- name: version
|
| 27 |
-
dtype: int64
|
| 28 |
-
- name: infoboxes
|
| 29 |
-
dtype: string
|
| 30 |
-
- name: has_math
|
| 31 |
-
dtype: bool
|
| 32 |
splits:
|
| 33 |
- name: train
|
| 34 |
-
num_bytes: 4011051116
|
| 35 |
num_examples: 52721
|
| 36 |
-
download_size: 1590895337
|
| 37 |
-
dataset_size: 4011051116
|
| 38 |
-
configs:
|
| 39 |
-
- config_name: default
|
| 40 |
-
data_files:
|
| 41 |
-
- split: train
|
| 42 |
-
path: data/train-*
|
| 43 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
tags:
|
| 6 |
+
- wikipedia
|
| 7 |
+
- finewiki
|
| 8 |
+
- sampled
|
| 9 |
dataset_info:
|
| 10 |
features:
|
| 11 |
- name: text
|
| 12 |
dtype: string
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
- name: url
|
| 14 |
dtype: string
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
splits:
|
| 16 |
- name: train
|
|
|
|
| 17 |
num_examples: 52721
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
---
|
| 19 |
+
|
| 20 |
+
# FineWiki Sampled Dataset (1B tokens)
|
| 21 |
+
|
| 22 |
+
This is a sampled subset of [HuggingFaceFW/finewiki](https://huggingface.co/datasets/HuggingFaceFW/finewiki) containing approximately **1,000,000,332 tokens**.
|
| 23 |
+
|
| 24 |
+
## Dataset Details
|
| 25 |
+
|
| 26 |
+
### Source
|
| 27 |
+
- **Original Dataset**: HuggingFaceFW/finewiki (English subset, train split)
|
| 28 |
+
- **Sampling Method**: Reservoir sampling (unbiased random sampling)
|
| 29 |
+
- **Target Token Count**: 1,000,000,000 tokens
|
| 30 |
+
- **Actual Token Count**: 1,000,000,332 tokens
|
| 31 |
+
- **Tokenizer**: GPT-2 (50,257 vocabulary)
|
| 32 |
+
|
| 33 |
+
### Sampling Statistics
|
| 34 |
+
- **Documents Sampled**: 52,721
|
| 35 |
+
- **Average Tokens/Doc**: 18967.8
|
| 36 |
+
- **Random Seed**: 42
|
| 37 |
+
- **Reservoir Size**: 500,000 documents (max)
|
| 38 |
+
|
| 39 |
+
### Sampling Method
|
| 40 |
+
|
| 41 |
+
This dataset was created using **reservoir sampling**, which ensures:
|
| 42 |
+
- ✅ Unbiased random sample from the full dataset
|
| 43 |
+
- ✅ Every document has equal probability of being selected
|
| 44 |
+
- ✅ No distribution bias (early/late documents equally represented)
|
| 45 |
+
- ✅ Streaming-based (no need to download full dataset)
|
| 46 |
+
|
| 47 |
+
The sampling algorithm:
|
| 48 |
+
1. Streams through HuggingFaceFW/finewiki without downloading
|
| 49 |
+
2. Uses GPT-2 tokenizer to count tokens per document
|
| 50 |
+
3. Maintains a reservoir of documents using standard reservoir sampling
|
| 51 |
+
4. Truncates to target token count when complete
|
| 52 |
+
|
| 53 |
+
## Usage
|
| 54 |
+
|
| 55 |
+
```python
|
| 56 |
+
from datasets import load_dataset
|
| 57 |
+
|
| 58 |
+
# Load the dataset
|
| 59 |
+
dataset = load_dataset("codelion/finewiki-1B")
|
| 60 |
+
|
| 61 |
+
# Access the training data
|
| 62 |
+
for example in dataset['train']:
|
| 63 |
+
print(example['text'])
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Dataset Structure
|
| 67 |
+
|
| 68 |
+
Each example contains:
|
| 69 |
+
- `text`: The Wikipedia article text
|
| 70 |
+
- `url`: Source Wikipedia URL
|
| 71 |
+
|
| 72 |
+
## Use Cases
|
| 73 |
+
|
| 74 |
+
This sampled dataset is ideal for:
|
| 75 |
+
- 🔬 Small-scale language model pretraining experiments
|
| 76 |
+
- 📊 Dataset composition studies
|
| 77 |
+
- ⚡ Quick prototyping and testing
|
| 78 |
+
- 💰 Low-cost training runs
|
| 79 |
+
|
| 80 |
+
## Citation
|
| 81 |
+
|
| 82 |
+
If you use this dataset, please cite both the original FineWiki dataset and mention the sampling methodology.
|
| 83 |
+
|
| 84 |
+
## License
|
| 85 |
+
|
| 86 |
+
Apache 2.0 (same as original FineWiki dataset)
|
| 87 |
+
|
| 88 |
+
## Dataset Card Authors
|
| 89 |
+
|
| 90 |
+
CodeLion
|
| 91 |
+
|
| 92 |
+
## Dataset Card Contact
|
| 93 |
+
|
| 94 |
+
For questions or issues, please open an issue on the dataset repository.
|