feat(data): real Tashkeela++ fetcher via HuggingFace Hub - #1
Open
ronaldtse wants to merge 2 commits into
Open
Conversation
added 2 commits
August 1, 2026 16:34
Replaces the env-var placeholder in scripts/fetch_data.sh with a proper Python fetcher that knows the canonical dataset locations. Primary source: Misraj/Sadeed_Tashkeela — gated, requires HF_TOKEN. Fallback: community-datasets/tashkeela — GPLv2 open access. The fetcher streams parquet → one-line-per-chunk text, skips blank and overlong lines, writes atomically via .tmp rename, and exits with a clear error message on gated-repo failures (including the URL the user must visit to grant access). Also adds pythonpath = ["src", "."] to pytest config so tests run without pip install -e ., and pyarrow>=15.0 to [publish] extras. Smoke-tested end-to-end: fetch 100 lines → RababaArabicData consumes them → (bare, diacritized) pairs ready for StudentTrainer.
Drops Misraj/Sadeed_Tashkeela (gated, requires manual approval) as the primary source. Replacement: arbml/tashkeelav2 — open-access, pre-split into train/test, and pre-paired (each row has both `text` and `diacratized` columns). No HF_TOKEN, no acceptance click-through. Output format is now TSV with two columns: `bare<TAB>diacritized`. The data module reads both directly — no in-pipeline stripping needed, and the dataset's canonical letter forms are preserved. Falls back to the legacy single-text path (.txt + strip_diacritics) when only raw community-datasets/tashkeela is available. Layout: primary = arbml/tashkeelav2 (TSV, open) fallback = community-datasets/tashkeela (TXT, GPLv2 raw) New tests: - fetcher primary is open + uses TSV - fetcher fallback still uses raw text path - data module reads TSV pairs (bare+diacritized) - data module falls back to legacy .txt when no TSV - data module prefers TSV when both exist 46 tests pass; smoke-tested against arbml/tashkeelav2 end-to-end.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Misraj/Sadeed_Tashkeela(gated, ~1M chunks of cleaned Tashkeela). Fallback:community-datasets/tashkeela(GPLv2, raw book text that the data module cleans).Wiring
scripts/fetch_data.py --task rababa_arabic [--fallback] [--max-samples N] [--out-dir DIR]<out_dir>/tashkeela_plus_plus.txt(defaultdata/raw/), which the existingRababaArabicDatamodule already reads.pyarrow>=15.0to[publish]extras.pythonpath = ["src", "."]to pytest config so tests run withoutpip install -e ..Test plan
python3 -m pytest tests/— 43 tests pass (39 existing + 4 new for fetcher)python3 -m ruff check scripts/fetch_data.py tests/test_fetch_data.py— cleanpython3 scripts/fetch_data.py --task rababa_arabic --fallback --max-samples 100 --out-dir /tmp/x/rawthenRababaArabicData.prepare_data()consumes the file → (bare, diacritized) pairs with correct harakat preservationHF_TOKEN+ acceptance at https://huggingface.co/datasets/Misraj/Sadeed_Tashkeela (user action)Follow-ups