--- configs: - config_name: default data_files: - split: train path: data/train-* - split: validation path: data/validation-* - split: test path: data/test-* - config_name: text-only data_files: - split: train path: text-only/train-* - split: validation path: text-only/validation-* - split: test path: text-only/test-* dataset_info: - config_name: default features: - name: id dtype: string - name: url dtype: string - name: title dtype: string - name: text dtype: string splits: - name: train num_bytes: 15368746858.779654 num_examples: 5673373 - name: validation num_bytes: 404439922.64724064 num_examples: 149299 - name: test num_bytes: 404442631.57310516 num_examples: 149300 download_size: 9703633440 dataset_size: 16177629413 - config_name: text-only features: - name: text dtype: string splits: - name: train num_bytes: 14834731398.280304 num_examples: 5673373 - name: validation num_bytes: 390386911.46022856 num_examples: 149299 - name: test num_bytes: 390389526.2594667 num_examples: 149300 download_size: 9374463601 dataset_size: 15615507835.999998 license: cc-by-sa-3.0 task_categories: - text-generation - fill-mask - feature-extraction language: - en tags: - wiki - wikipedia - pretrain size_categories: - 1M purpose: train with less data while maintaining (most) of the quality This is really more of a "high quality diverse sample" rather than _"we are trying to remove literal duplicate documents"_. Source dataset: [graelo/wikipedia](https://huggingface.co/datasets/graelo/wikipedia). ## configs ### `default` command: ```sh python -m text_dedup.minhash \ --path $ds_name \ --name $dataset_config \ --split $data_split \ --cache_dir "./cache" \ --output $out_dir \ --column $text_column \ --ngram 4 --threshold 0.6 \ --hash_func xxh3 --hash_bits 16 --num_perm 64 \ --batch_size 10000 ``` dedup: ```sh Fingerprinting... (num_proc=40): 100% 6705754/6705754 [06:57<00:00, 16063.27 examples/s] Iterating MinHashes...: 100% 671/671 [04:13<00:00, 2.65it/s] Clustering...: 100% 10/10 [00:21<00:00, 2.18s/it] Finding clusters... (num_proc=40): 100% 6705754/6705754 [06:38<00:00, 16839.42 examples/s] Filtering clusters... (num_proc=40): 100% 6705754/6705754 [02:25<00:00, 46058.39 examples/s] Saving the dataset (39/39 shards): 100% 5971972/5971972 [03:47<00:00, 26266.10 examples/s] [10/23/23 02:29:41] INFO Loading : 78.82s ``` result: ```python DatasetDict({ train: Dataset({ features: ['id', 'url', 'title', 'text'], num_rows: 5673373 }) validation: Dataset({ features: ['id', 'url', 'title', 'text'], num_rows: 149299 }) test: Dataset({ features: ['id', 'url', 'title', 'text'], num_rows: 149300 }) }) ``` ### text-only This is the same thing but with all columns except for 'text' removed. ```python from datasets import load_dataset # If the dataset is gated/private, make sure you have run huggingface-cli login config_name = "text-only" dataset = load_dataset("BEE-spoke-data/wikipedia-deduped", config_name) ``` ## token counts ### train Using `tiktoken` GPT-4 tokenizer, `train` split, and `text` column: | | num_tokens | |:------|----------------:| | count | 5.67337e+06 | | mean | 612.413 | | std | 739.331 | | min | 3 | | 25% | 163 | | 50% | 359 | | 75% | 761 | | max | 34298 | total: 3,474,446,396 ---