Datasets:
|
Download methodology.md from mkebiclioglu/ottoman-ledger: direct link, hf CLI and curl.
- Browser
- Download file 7.6 kB
-
https://huggingface.co/datasets/mkebiclioglu/ottoman-ledger/resolve/main/methodology.md
- Command line
-
hf download hf://datasets/mkebiclioglu/ottoman-ledger/methodology.md
-
curl -L -o methodology.md https://huggingface.co/datasets/mkebiclioglu/ottoman-ledger/resolve/main/methodology.md
7.6 kB
| # Methodology | |
| ## 1. Source | |
| The İstanbul Kadı Sicilleri series publishes Latin-script transcriptions of 100 registers of | |
| Istanbul's Islamic courts (16th-19th c.) in two series: 40 volumes by İSAM (2008-2012) and 60 by | |
| Kültür AŞ / İstanbul Medipol Üniversitesi (2019). The originals are in the İstanbul Müftülüğü | |
| Şer‘iyye Sicilleri Arşivi. Every volume has the same structure: front matter (Takdim, | |
| introduction on the court and register, İmla Esasları), a subject index (KONU BAŞLIKLARI: | |
| `N [folio-ref] heading / page`) and the text (METİN) where each record is preceded by a bold | |
| heading `N [folio-ref] heading`. Folio refs are `<folio><a|b>-<n>` (recto/verso, record on the | |
| page); `, Arapça` marks records written in Arabic, given in the editors' Turkish rendering. | |
| Editorial marks: `(…)` torn/illegible, `?` doubtful reading, `…?` unreadable, `( )` left blank by | |
| the scribe, `<< >>` crossed out. The first-series volumes also contain facsimiles that are not in | |
| the PDFs. | |
| The PDFs carry text layers; no OCR is used. | |
| ## 2. Deterministic text extraction (`pdftext.py`) | |
| * Glyph-level rebuild of each line (PyMuPDF rawdict). A space glyph whose neighbours touch | |
| (gap < 0.6 pt) is a ligature artefact ("deft er" -> "defter") and is dropped. | |
| * Old-style figures in the Private Use Area (U+F730-F739) and Symbol-font ASCII (U+F020-F07E) | |
| are mapped back to ASCII; Unicode NFC throughout; all transcription diacritics (â î û ā ū ‘ ’) | |
| are preserved. | |
| * Rotated pages (two Ghostscript-produced volumes) are normalised before extraction. | |
| * Line roles: page numbers (digit-only lines at the volume's modal folio positions), running | |
| headers (top band, repeated across pages, or letter-spaced / broken-font headers), InDesign | |
| slugs, editorial footnotes (small-font cluster below the last body line starting with `*` or a | |
| footnote number), body. Small-font inventory and price tables stay in the body. | |
| ## 3. Record segmentation and reconciliation (`records.py`) | |
| Headings are bold lines matching `N [ref] title` with tolerance for `322- [..]`, `<<67 [..]` | |
| (crossed out) and a missing closing bracket. The subject index is parsed from the KONU | |
| BAŞLIKLARI title page up to the first text heading; entries are aligned to text records by | |
| number and folio ref. Every disagreement is reported in `work/corpus/reconciliation.json`: | |
| index entries without text, text records without index entry, duplicate numbers, gaps. | |
| Hyphenation: soft hyphens are joined; a line-final hyphen is kept when it belongs to the | |
| transcription (izafet `meclis-|i`, Arabic article `el-|Hâc`) and removed otherwise. | |
| Text before the first record (cover notes) is kept as a volume preamble. | |
| ## 4. Dates (`dates.py`) | |
| Parsing recognises Arabic number words (units, teens, tens, hundreds additive or | |
| multiplicative, `elf`), Turkish number words, Arabic ordinal days ("el-yevmü's-sâmin ve'l-ışrîn"), | |
| Turkish ordinals ("yirmi beşinci günü"), month names in Ottoman/Arabic forms and the | |
| abbreviations M S Ra R Ca C B Ş N L Za Z, `gurre` (1st), `selh` (last day), `evâil` (1-10), | |
| `evâsıt` (11-20), `evâhir` (21-end) and editor brackets (`sene [1]178`). | |
| Conversion uses the tabular Islamic calendar (civil epoch, 30-year cycle with leap years 2, 5, 7, | |
| 10, 13, 16, 18, 21, 24, 26, 29), the scheme behind F. R. Unat's conversion tables used by the | |
| editors. Tests confirm agreement with the `convertdate` library and with 150 Hijri/Western pairs | |
| the editors themselves give in the volume introductions: 138 of 150 agree to the day (Julian before | |
| 1582, Gregorian after); the other 12 are off by a year, a month or more and are slips in the books. Each date carries: | |
| * precision: day / decade / month / year / unresolved; ranges for anything coarser than a day; | |
| * `uncertainty_days` = 2 for day precision (month starts depended on moon sighting); | |
| * proleptic Gregorian, Julian and "western civil" (Julian < 1582-10-15 <= Gregorian) ranges. | |
| The registration date (the "Tahrîren fî ... / Fî ... sene ..." formula) is separated from dates of | |
| narrated events. The model quotes each date expression verbatim and classifies its type; the | |
| components are recomputed by the parser and any disagreement is flagged. A year is never taken | |
| from the volume range, except that an abbreviated year ("sene 78") is completed with the century | |
| inside the volume range and flagged `year_inferred_from_volume`. | |
| ## 5. LLM translation and extraction (`extract.py`, `prompts/extract_v1.md`, `schema.py`) | |
| One request per record; the system prompt (instructions, the terminology dictionary and the JSON | |
| schema) is cached. The model returns a JSON object validated by Pydantic: complete modern | |
| Turkish and English translations, persons, places, dates, events with participants, amounts, | |
| assets and attributes. Records longer than 8,000 characters get the extraction in one call and | |
| the translations in sentence-aligned chunks. Invalid JSON gets one deterministic clean-up (unknown | |
| keys dropped and logged) and, if still invalid, one LLM repair round. All results and every API | |
| attempt (tokens, time, request id) are cached on disk: reruns skip completed records. | |
| Model: the released data uses Tencent Hy4 Flash (`tencent/hy4-flash` through OpenRouter, pinned to | |
| Tencent's endpoint, reasoning off, JSON mode). Before choosing it, the same 102-record pilot was run | |
| with Claude Opus 5.5, Sonnet 5.5 and Haiku 5.5; on those records Hy4 Flash agreed with Opus 5.5 on | |
| document type for 87% of records and on persons, amount values and registration dates for 81-84% | |
| (agreement F1). Agreement is not accuracy. | |
| Key rules in the prompt: verbatim evidence for everything; no inferred gender / religion / | |
| occupation / relationship / identification; a strict epistemic status vocabulary (allegation, | |
| testimony, judicial finding, court order, imperial order, ...); one event per act and each amount | |
| in exactly one event; witness lists kept separately. | |
| ## 6. Validation (`validate.py`, `dedupe.py`, `crossmodel.py`) | |
| Deterministic checks per record: every quote, name, place, date expression and amount text must | |
| occur in the source (diacritic-folded, elisions allowed); gender / status claims need evidence | |
| containing the marker; amounts are re-derived from Turkish number words (incl. distributive and | |
| fused forms); currency normalisation is checked against the written currency; akçe/kuruş | |
| equivalences must be plausible; probate inventories are reconciled (sum of items vs stated total); | |
| referential integrity of all ids; same amount in several events (double counting); translation | |
| length ratio, numbers and names carried into both translations. Corpus-level near-duplicates are | |
| found with MinHash/LSH and exact Jaccard. Cross-model agreement (same prompt, other models) | |
| locates likely problems. None of these is accuracy. | |
| ## 7. Human evaluation | |
| A stratified gold set of 520 records (`sample.py`), an offline annotation tool and scoring | |
| (`annotate.py`) measure precision, recall (completeness) and F1 for persons, places, events and | |
| amounts, plus exact-match accuracy for dates, amounts and currencies. Model self-reported | |
| confidence is stored separately and can be calibrated against the gold set. The dataset is not | |
| described as historically verified until this evaluation is done. | |
| ## 8. Geocoding (`geocode.py`) | |
| Wikidata (CC0) lookup by exact folded label/alias; settlement-like items with coordinates only; | |
| local place types must resolve uniquely inside the Istanbul region; larger units must be unique or | |
| clearly dominant. Coordinates are modern centroids; matches are automatic and marked unreviewed. | |