quran-md-data / scripts

Commit History

5 days ago

  1. dpo-resplit: held-out DPO eval split added, aligned BY SURAH with the SFT eval set — train training/dpo.jsonl 153 rows (surah 2: 55, 19: 98), eval training/eval/dpo_eval.jsonl 32 rows (surah 6: 17, 9: 1, 14: 1, 60: 13); rows moved verbatim (verse_key multiset asserted), split_key preserved; scripts/resplit_dpo_by_surah.py + flatten_training.py extended (dpo_eval_flat 32); README: +dpo_eval +dpo_eval_flat configs (9 total), file table updated, stale judge-pending wording fixed (sweep complete, coverage full 185/185); verify G1-G6 PASS, validate_manifest PASS

    Z User
    0ea247b
  2. qummi-gap-audit: the 62-verse Qummi gap VERIFIED genuine via cache-only negative audit (scripts/qummi_gap_audit.py + raw/sources/tafsir_al_qummi/gap_audit.json) — 0 pericope pages missing from cache; 22/62 have no pericope in the edition TOC; 40/62 pericopes contain no >=3-word/>=12-char folded verse-text run (ceiling 3 words / 10 chars = noise); a looser matcher would fabricate anchors and is forbidden by the no-recall rule; README gap section updated with audit reference; verify G1-G6 PASS, validate_manifest PASS

    Z User
    73c78c3

6 days ago

  1. dpo-infra: llm_call now retries when the CLI writes no response file (hard 429s previously fast-failed through FileNotFoundError, bypassing backoff and burning checkpoint rounds); no data changes

    Z User
    a26d9cf
  2. dpo-infra: judge worker count configurable via DPO_JUDGE_WORKERS (default 2, unchanged) — lets the resume sweep scale concurrency when the endpoint quota allows; no data changes

    Z User
    5dfa656

7 days ago

  1. flatten+readme: flat string variants derived (training/flat/: sft_flat 160, sft_eval_flat 32, dpo_flat 185 — prompt/response|chosen|rejected as JSON strings for trainers expecting flat text; scripts/flatten_training.py, deterministic). README.md rewritten as the full dataset card with explicit HF configs (sft/sft_eval/dpo/hallucination_probe + flat variants) — pins each file to its own config so the viewer never lumps differently-shaped files into one split (the CastError cause); configs presence disables auto-detection for the plumbing shards. DATASET_CARD.md removed (README now carries the card; no drift risk). verify.py G1-G6 PASS, validate_manifest.py PASS

    Z User
    3513fe7
  2. dpo-negatives: rejected side FILLED for all 185 rows with REAL on-policy base-model outputs (glm-4-plus via z-ai, no stored context supplied — model answers from its own knowledge, failures are natural, never hand-written). Primary verified failure_mode: wrong_root 147 / fabricated_hadith 31 / fake_quote 7; all-mode counts: fake_quote 185 (verse-text orthography + non-verbatim excerpts), wrong_root 178, fabricated_hadith 31, biblical_backmapping 6. Every label verified: deterministic checks (verse text vs Tanzil store; excerpt verbatim-or-fail vs all stored substrates; morphology vs corpus words incl. fabricated word_refs) + LLM judge with evidence-substring enforcement (79/185 rows judged so far — judge_coverage field per row; stance-mode sweep continues when API quota recovers). structure_match 178/185; length median ratio 0.6. Zero rows dropped (every draft had >=1 verified failure). Audit trail: training/dpo_generation_report.json + scripts/generate_dpo_negatives.py (checkpointed/resumable). verify.py G1-G6 PASS

    Z User
    e916cce
  3. probe-expand: hallucination_probe.jsonl 5 -> 45 items (22 real / 23 fake) — real items are verbatim substrings of stored substrates (tafsir tabari/ibn-kathir/qurtubi/majma/qummi + hadith), asserted at build; fake items are deterministic mutations of stored quotes (invented-tail templates covering all 8 failure modes incl. sectarian_collapse/ghayb_adjudication/secular_reductionist/false_balance, isnad cross-splices from two stored hadiths, wrong-root claims vs corpus), asserted absent from every substrate. Legacy probe_real_1 work label corrected to tafsir_majma_albayan (matches its stored substrate); legacy duplicate probe_fake_2 id disambiguated. scripts/expand_hallucination_probe.py added. verify.py G1-G6 PASS

    Z User
    bdbbc04
  4. training-resplit: SFT split fixed by surah (never random) — train sft.jsonl 160 rows (surah 1:7, 2:55, 19:98; was 7 rows surah-1-only), held-out eval sft_eval.jsonl 32 rows (6:17, 9:1, 14:1, 60:13 — the 6:74 'ab' hadith-grounded anti-hallucination cases stay held out). Rows moved verbatim, split_key=own-surah asserted for every row, deterministic (surah,ayah) sort. scripts/resplit_sft_by_surah.py added. verify.py G1-G6 PASS

    Z User
    0c42289
  5. phase5-takhrij: hadith-specific classical takhrij STORED for both 6:74-linked hadiths — composites concluded with recorded qualifications. Fath al-Bari (Ibn Hajar d.852AH, shamela 1673, windows j6 386-391 + j8 499-503, 9 page captures, ajax-search located) + Mir'at al-'Uqul (al-Majlisi d.1110AH, eshia 71429 j26 548-551) + Bukhari #4768/#4769 individual pages, all sha-pinned with anchor-verified slices; every quoted passage anchor-checked against substrates before grounding. h_006-074_sunni sunni_classical -> 'passes' (compiler-condition admission x3: #3350/#4769/#4768 + Ibn Hajar defense vs al-Isma'ili/al-Kirmani with closing 'قلت' + Ibn Ma'in leg ranking Kamal 5408; ikhlat-timing NOT hadith-specifically addressed — qualification recorded, conclusion rests on compiler admission). h_006-074_imami imami_classical -> 'passes' (Majlisi's hadith-specific grading 'الحديث الثامن والخمسون والخمسمائة: حسن' + grounded 5/6-leg biographical layer; identity candidates stay unmerged). Legacy 'hyena' element RESOLVED: Ibn Hajar's variant apparatus 'فيمسخ الله أباه ضبعًا' (رواية أيوب) / 'صورة ضبعان' (حديث أبي سعيد) + lexical note 'ذيخ ذكر الضباع'; 'أبو سعيد' variant identity left as candidate (never merged); Ghaffari footnote[8] remark traced to Majlisi's own words (Bihar j12 pp48-50 pointer stored). internal_quranic_consistency (sunni) -> 'pass' per Ibn Hajar's stored harmonization (9:114 موعدة + مسخ reply); ghayb rule unchanged everywhere. Sources registered: hadith_fath_al_bari + hadith_mirat_al_uqul (classical PD base text, use_with_notice hosts, editorial apparatus flagged per quote; al-Khoei Mu'jam Rijal al-Hadith block untouched); LICENSE_AUDIT addendum + NOTICE 3d appended; DATASET_CARD counts and gaps updated; verify.py gates G1-G6 green; validate_manifest.py PASS

    Z User
    6bed8c7
  6. phase5-rijal-p2: Sunni-rijal ABSENCE findings grounded for the six Al-Kafi 558 chain narrators (h_006-074_imami sunni_classical gap) — no entry in served Taqrib/Tahdhib al-Kamal/Tahdhib al-Tahdhib for any of the six: Taqrib's only 'علي ابن إبراهيم' entry is الواسطي 4686 (different person), kunya zones carry only أبو بصير العبدي الأعمى + no أبو أيوب الخزاز, Tahdhib kunya index resolves 'الخزاز' to 'أبو عامر = صالح بن رستم' only, single-token 'بختاري' zero hits across all three books; 7 page-level evidence slices (8 pages) + 26 live search-evidence queries stored sha-pinned (extraction_report_phase2.json); over-claim guard recorded (Lalaqa'i 'كان بقم' belongs to the Wasiti identity, not al-Qummi); Abu Basir 'صوابه يحيى ابن عثمان' entry kept an unresolved candidate pointer, never merged; audit sunni_classical why rewritten with grounded findings + stated limitations, result stays unresolved; legacy ' rijal_sources' key normalized to schema-correct 'rijal_sources' in all audit records

    Z User
    802763d
  7. phase5-rijal: isnad evaluation grounded — 11 narrator records from stored rijal text (Najashi 14028 + Tusi 86760 via eshia; Taqrib 8609 + Tahdhib al-Kamal 3722 + Tahdhib al-Tahdhib 1293 via shamela; 22 targeted entries, 31 pages, use_with_notice, sha256 sidecars) — father leg corrected to Ibrahim b. Hashim per Najashi [18]; identities never auto-merged (Ibn Abi Umayr / Hisham Salim-Salem / Abu Basir / Abu Ayyub kept unresolved candidates); audits carry grounded per-narrator verdicts with composite unresolved; matn_claims type enum fixed so all audits validate

    Z User
    c5a2501

8 days ago

  1. phase5-grounding: Imami hadith records grounded — Al-Kafi 558 (eshia 11005) + Qummi carried hadith; merged legacy record split per-work⁠

    Z User
    db59dd0
  2. phase5-grounding: Sunni hadith h_006-074_sunni verbatim-grounded from sunnah.com individual page (Bukhari 3350)⁠

    Z User
    8683ec7
  3. phase4b: Tafsir al-Qummi ingested - Imami layer now two works deep (898 units)⁠

    Z User
    e046739
  4. phase4 v2: Majma substrate cleanup + Imami position grounded⁠

    Z User
    85b6476

9 days ago

  1. phase4: Imami commentary live - Majma al-Bayan ingested (192 units, 0 empty segments)⁠

    cd53a71
  2. fix(G5): idf_weight present on all lexical edges⁠

    4b5c805
  3. phase3-6 continued: NOTICE.md + DATASET_CARD.md (attribution compliance); mutashabihat detector (71 pairs) wired into graph (23,521 edges); KB expanded to 192 verses (Surah 19+60 complete, Ibrahim blocks 2:124-141, 6:74-90) with 576 commentary units + 1,662 citations; surah names + page numbers backfilled from API with provenance; probe expanded (2 real / 3 labeled fake); PERMISSION_REQUESTS.md drafts

    Z User
    cbbb668
  4. phase6: words data re-sharded to plain-text parts under HF 10MiB limit (data/words_[0-9]*.jsonl + words_manifest.json with sha256); all consumers updated; pipeline order build->classify; gates + acceptance PASS

    Z User
    e1b60ee
  5. phase6: words.jsonl -> words.jsonl.gz (1.1MB, HF 10MiB push limit); all consumers updated; pipeline order build->classify enforced; gates + acceptance test PASS

    Z User
    21b1447
  6. phase4-6: tafsir pipeline complete (171 units; Imami sources pending per manifest); rijal/audit MVP (hadith/narrators/audits with unresolved states, ghayb rule, 'ard test); compile_v2 (grounded SFT train/eval split by surah, hallucination probe 1 real + 2 labeled fake, DPO chosen staged with negatives gated on real base model); labeled md regenerated

    Z User
    5945aa9
  7. phase3: xref graph — 3,633 edges (lexical IDF-weighted incl. all ingested-pairs; exegetical from 878 detected ayah citations in 171 commentary units); LLM classifier applied 17 closed-set decisions to review queue; 6:74 acceptance test PASS (lexical link + usage split + sourced positions)

    Z User
    1e02da8
  8. phase2: verify.py v2 gates G1-G6 (verbatim quote check, corpus root/lemma match, xref constraints, md root claims) + unverified_recall flags on curated 006-074 claims; PASS

    Z User
    0de6fd1
  9. phase2: deterministic morphology ingest — verbatim QAC v0.4 (cltk mirror, sha256) + Tanzil simple/uthmani XML -> data/words.jsonl (77,429 words, 1,642 roots, 4,828 lemmas); corpus-verified roots attached additively to 45 raw verse files; curated 006-074 roots preserved & flagged unverified_recall

    Z User
    91107ad
  10. phase0: add source/license manifest (24 sources), LICENSE_AUDIT.md (U1 repo access resolved; U8 Ibn Kathir = abridged English confirmed), manifest validator

    Z User
    73afd92

10 days ago

  1. Enrich pages 1-6 with Tafsir Ibn Kathir, add verify.py and 6-page macro context

    842ec34
  2. Add 6-page ingestion pipeline and ingest pages 1-6

    8515547
  3. Initial quran.md schema, compiler, and 6:74 canonical test case

    082342a