Downloads · 30 days
7
5% of all-time downloads
alhparsa/qwen35-extract-tsv-v2
qwen35-extract-tsv-v2 is a image-text-to-text model from alhparsa. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. The card lists the license as other.
Selective full-FT of Qwen3.5-9B for medical admission-fact extraction from document page images. Output is compact TSV (CTX line + 6 TAB-separated columns/fact), not JSON.
Downloads · 30 days
7
5% of all-time downloads
All-time downloads
139
Public
Parameters
9.7B
19.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors19.3 GB · 100%
From the Hugging Face model README
Selective full-FT of Qwen3.5-9B for medical admission-fact extraction from document page images. Output is compact TSV (CTX line + 6 TAB-separated columns/fact), not JSON.
Quality: ~98–100% recall / ~100% precision post-dedup (image-grounded judges). Speed: 4.4–4.9 s/page with the DFlash drafter on 2×H100 (see below).
Architecture: hybrid GatedDeltaNet (24 GDN + 8 full-attn) + vision tower + MTP head. The arch drives the gotchas below — read them before serving.
vllm serve alhparsa/qwen35-extract-tsv-v1 \
--speculative-config '{"method":"dflash","model":"alhparsa/qwen35-9b-dflash","num_speculative_tokens":15}' \
--max-model-len 32768 \
--attention-backend flash_attn \
--max-num-batched-tokens 32768 \
--mm-processor-kwargs '{"max_pixels": 1003520}' \
--default-chat-template-kwargs '{"enable_thinking": false}'
The --speculative-config is lossless speedup only (the drafter proposes tokens, this model verifies them — identical output). Drop it to serve ~2× slower with no other change. Run one replica per GPU and round-robin requests for best throughput.
temperature 0.7 top_p 0.8 top_k 20 repetition_penalty 1.08 seed 0
Greedy / low-temp measurably hurts recall. Do not change these.
short_sys.txt) with {today_date} filled to today (ISO).[Available tags list] + "Previous context before this window:\n\n", then per page "Page N\n\n" + the page image, then "Extract all facts from these consecutive pages."Real held-out example (an Occupational Therapy evaluation page, mid-document window). Page image elided.
Input messages:
[
{"role": "system", "content": "% You are an AI specialized in extracting ... Today's date is: 2026-06-18\n% ... (short_sys.txt, full text — the 6-column TSV contract)"},
{"role": "user", "content": [
{"type": "text", "text": "Available tags:\nMDS Tags:\n- mds_a_id_info ... - mds_q_participation\nDocument Type Tags:\n- med_diag, allergy, vital, lab_result, evaluation, therapy, progress_note, care_plan, medication, physical_exam ...\n\nPrevious context before this window:\nActive Service Date: 2026-05-17; source_label: \"Today's Date\". This page continues the Occupational Therapy Evaluation. It includes AM-PAC Daily Activity scores, Transfers (deferred due to pain), Balance, Coordination, Functional Cognition (Intact/Alert), ROM, Strength ...\n\n"},
{"type": "text", "text": "Page 40\n\n"},
{"type": "image_url", "image_url": {"url": "data:image/png;base64,<...page...>"}},
{"type": "text", "text": "Extract all facts from these consecutive pages."}
]}
]
Output (TSV — CTX line, then page⇥fact⇥tags⇥temporal_date⇥temporal_text⇥confidence):
CTX: Active Service Date: 2026-05-17; source_label: "Today's Date". This page concludes the Occupational Therapy Evaluation with short-term goals for transfers, dressing, and bed mobility, classifies the evaluation as high complexity, and includes ADL flowsheet data and a Last Skin Assessment dated 05/18/2026.
40 Favorable for Outcome: PLOF;Motivated;Intact Cognition evaluation,therapy 2026-05-17 5/17/2026 -
40 Barriers to Outcome: Comorbidities;Lives Alone;Decreased Activity Tolerance;Decreased UE Fxnl Use;Pain evaluation,therapy 2026-05-17 5/17/2026 -
40 Problem List: Decreased ADL status;Decreased UE strength;Decreased UE ROM;Decreased LE ROM;Decreased LE strength;Decreased activity tolerance;Decreased transfer ability;Decreased coordination;Impaired functional mobility;Impaired balance;Impaired gait;Pain;Decreased high-level ADLs evaluation,therapy 2026-05-17 5/17/2026 -
40 Rehab Potential: Good evaluation,therapy 2026-05-17 5/17/2026 -
40 OT Priority: 3 SAT 5/16; FBR evaluation,therapy 2026-05-17 5/17/2026 -
40 OT Frequency: 1-2x/wk evaluation,therapy 2026-05-17 5/17/2026 -
Notes: the Previous context block carries the prior window's CTX so facts spanning a page break aren't lost; page is the real source page (40); temporal_date (ISO) and temporal_text (as written) are populated from the active service date; tags come only from the Available tags list. Patient identity (when present) lands on the CTX line, not as fact rows.
See hf_infer_sample.py in the training repo — loads via AutoModelForImageTextToText, max_pixels=1003520, the decode params above. No drafter (vLLM-only), no PDF render/windowing/dedup.
--mm-processor-kwargs '{"max_pixels": 1003520}' — without it images are processed at native res (off-distribution + slow). preprocessor_config.json is included here.mtp.* tensors are required for speculative decode; they are present in this checkpoint. If you re-merge/requant, re-graft them or spec decode breaks.LD_LIBRARY_PATH.alhparsa/qwen35-9b-dflash is a mirror of public z-lab/Qwen3.5-9B-DFlash. It was trained on stock Qwen3.5-9B, not recalibrated to this fine-tune, so acceptance is a bit below z-lab's headline — still a clear win.
Render PDF pages at 2.0 zoom → 3-page windows, stride 2 (1-page overlap) → concurrent requests round-robin across replicas → parse TSV → extract identity from CTX line → reseed-retry any window returning <5 facts → union → semantic dedup. Single-window inference under-recalls on multi-page docs.