--- dataset_info: features: - name: text dtype: string - name: title dtype: string - name: date dtype: 'null' - name: url dtype: string - name: source dtype: string - name: language dtype: string - name: domain dtype: string - name: id dtype: string splits: - name: train num_bytes: 2140231858 num_examples: 512948 - name: validation num_bytes: 265884337 num_examples: 64116 - name: test num_bytes: 268635760 num_examples: 64122 download_size: 1365286406 dataset_size: 2674751955 configs: - config_name: default data_files: - split: train path: data/train-* - split: validation path: data/validation-* - split: test path: data/test-* license: cc-by-4.0 language: - sr - bs - hr pretty_name: SR/BS/HR Clean Text Corpus size_categories: - 100K ![Languages](https://img.shields.io/badge/languages-sr%20|%20bs%20|%20hr-blue) ![License](https://img.shields.io/badge/license-CC--BY--SA--4.0-green) ![Size](https://img.shields.io/badge/examples-641K-orange) **High-quality, deduplicated text corpus for Serbian, Bosnian, and Croatian** [RSA Team](https://huggingface.co/rsateam) • [GitHub](https://github.com/rsadevteam) • [Website](https://rsateam.com) ## Overview This dataset provides a carefully curated and cleaned text corpus for South Slavic languages, specifically designed to address quality issues found in existing corpora like OSCAR and CC100. It serves as a foundation for training language models, tokenizers, and conducting linguistic research on Balkan languages. ### Why This Dataset? Existing sr/bs/hr corpora often suffer from: | Problem | Our Solution | |---------|--------------| | HTML fragments & noise | Aggressive cleaning pipeline | | Poor deduplication | SHA256 + MinHash (>95% dedup rate) | | Mixed languages | Source-based labeling + FastText validation | | Unclear sources | Full provenance tracking | ## Dataset Statistics | Metric | Value | |--------|-------| | Total examples | **641,186** | | Dataset size | 2.67 GB | | Download size | 1.37 GB | | Source | Wikipedia | ### Splits | Split | Examples | Size | |-------|----------|------| | `train` | 512,948 | 2.14 GB | | `validation` | 64,116 | 266 MB | | `test` | 64,122 | 269 MB | ### Languages | Language | ISO Code | Source | |----------|----------|--------| | Serbian | `sr` | sr.wikipedia.org | | Bosnian | `bs` | bs.wikipedia.org | | Croatian | `hr` | hr.wikipedia.org | ## Dataset Structure ### Data Format ```json { "id": "550e8400-e29b-41d4-a716-446655440000", "title": "Article Title", "text": "Full cleaned article text...", "language": "sr", "source": "sr.wikipedia.org", "domain": "wiki", "date": null, "url": "https://sr.wikipedia.org/wiki/..." } ``` ### Fields | Field | Type | Description | |-------|------|-------------| | `id` | string | Unique identifier | | `title` | string | Article title | | `text` | string | Cleaned textual content | | `language` | string | Language code (sr/bs/hr) | | `source` | string | Source domain | | `domain` | string | Content type (wiki) | | `date` | null | Publication date (not available for wiki) | | `url` | string | Original Wikipedia URL | ## Data Processing Pipeline ``` ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ Collection │ -> │ Cleaning │ -> │ Dedup │ -> │ Lang ID │ -> │ Filtering │ │ Wikipedia │ │ normalize │ │ MinHash │ │ FastText │ │ quality │ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ ``` ### Processing Steps 1. **Collection**: Wikipedia dumps from bs/hr/sr Wikipedia 2. **Cleaning**: Markup removal, Unicode normalization (NFC), whitespace normalization 3. **Deduplication**: SHA256 exact matching + MinHash near-duplicate detection (90% threshold) 4. **Language ID**: Source-based labeling with FastText validation 5. **Quality Filtering**: Length constraints, language confidence >0.90 ## Usage ### Loading the Dataset ```python from datasets import load_dataset # Load full dataset dataset = load_dataset("rsateam/sr-bs-hr-clean-text") # Load specific split train = load_dataset("rsateam/sr-bs-hr-clean-text", split="train") # Filter by language serbian = dataset["train"].filter(lambda x: x["language"] == "sr") ``` ### Streaming ```python from datasets import load_dataset dataset = load_dataset( "rsateam/sr-bs-hr-clean-text", split="train", streaming=True ) for example in dataset: print(example["title"], "-", example["text"][:100]) ``` ### Training a Tokenizer ```python from tokenizers import Tokenizer from tokenizers.models import BPE from tokenizers.trainers import BpeTrainer from datasets import load_dataset dataset = load_dataset("rsateam/sr-bs-hr-clean-text", split="train") def batch_iterator(batch_size=1000): for i in range(0, len(dataset), batch_size): yield dataset[i:i+batch_size]["text"] tokenizer = Tokenizer(BPE(unk_token="[UNK]")) trainer = BpeTrainer( vocab_size=32000, special_tokens=["[UNK]", "[CLS]", "[SEP]", "[PAD]", "[MASK]"] ) tokenizer.train_from_iterator(batch_iterator(), trainer=trainer) ``` ## Supported Tasks - **Language Model Pretraining**: Foundation for training or continued pretraining of LLMs - **Tokenizer Training**: Clean text for BPE/WordPiece/Unigram tokenizer training - **Word Embeddings**: Training Word2Vec, FastText, or similar embeddings - **Linguistic Research**: Analysis of Serbian, Bosnian, and Croatian texts ## Considerations ### Ethical Considerations - Data sourced from Wikipedia under CC-BY-SA license - No personally identifiable information (PII) - Encyclopedic content with neutral point of view ### Limitations - Single source (Wikipedia) — encyclopedic style only - Some topics may be underrepresented - Article length varies significantly ### License This dataset is released under [CC-BY-SA-4.0](https://creativecommons.org/licenses/by-sa/4.0/), consistent with Wikipedia's licensing. ## Citation ```bibtex @dataset{rsateam_clean_text_2026, title={SR/BS/HR Clean Text Corpus}, author={RSA Team}, year={2026}, publisher={Hugging Face}, url={https://huggingface.co/datasets/rsateam/sr-bs-hr-clean-text}, note={High-quality deduplicated corpus for Serbian, Bosnian, and Croatian} } ``` ## Future Plans We plan to expand this dataset with additional sources: - News portals (klix.ba, index.hr, blic.rs, etc.) - Government and public institution documents - Other curated text sources ## Contributing We welcome contributions! For suggestions, bug reports, or improvements: - Open an issue on [GitHub](https://github.com/rsadevteam/balkan-nlp) - Email: office@rsateam.com ---
**[RSA Team](https://huggingface.co/rsateam)** — *Building bridges between languages and AI, one dataset at a time.*