Skip to content

wigtn/wigtnOCR-v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WigtnOCR — VLM-based Document Parsing Framework

Python 3.11+ License: Apache 2.0 Version HuggingFace

English Korean

WigtnOCR

Pseudo-Label Distillation for Structure-Preserving Document Parsing

Distill a 30B VLM's document parsing ability into a 2B model — then prove the structured output improves RAG chunking and retrieval on Korean government documents.

WigtnOCR distills document parsing capabilities from Qwen3-VL-30B (teacher) into Qwen3-VL-2B (student) via quality-filtered pseudo-labeling and LoRA fine-tuning. The resulting WigtnOCR-2B matches or exceeds its 30B teacher on OmniDocBench, and achieves the highest retrieval performance among 6 parsers on KoGovDoc — proving: better parsing → better chunks → better retrieval.


Key Results

OmniDocBench — Distillation Effectiveness

OmniDocBench Results
Model Text NED ↓ Table TEDS ↑ CDM F1 ↑ Read Order ↓ Skip % ↓
Qwen3-VL-2B (Base) 0.364 0.561 0.865 0.300 18.8%
WigtnOCR-2B (Ours) 0.288 0.649 0.884 0.211 5.8%
Qwen3-VL-30B (Teacher) 0.289 0.523 0.939 0.227 5.5%
Marker 0.218 0.586 0.863 0.165 0.4%

WigtnOCR-2B matches or exceeds its 30B teacher in 4 out of 5 categories. Table TEDS surpasses teacher by +12.6pp. Skip rate drops from 18.8% → 5.8%, showing dramatically improved reliability.

KoGovDoc — Retrieval Performance

KoGovDoc Retrieval Results
Model Hit@1 ↑ Hit@5 ↑ MRR@10 ↑ nDCG@10 ↑
WigtnOCR-2B 0.739 0.855 0.788 0.437
Qwen3-VL-30B 0.716 0.839 0.771 0.411
Marker 0.711 0.853 0.771 0.412
Qwen3-VL-2B 0.709 0.814 0.756 0.444
MinerU 0.608 0.789 0.682 0.384
PaddleOCR 0.512 0.693 0.592 0.293

WigtnOCR-2B ranks #1 in Hit@1, Hit@5, and MRR@10 across all 6 parsers. Compared to PaddleOCR (pure OCR), Hit@1 improves by +22.7pp, demonstrating that structured parsing directly translates to better retrieval.

BC/CS — Chunk Quality Does Not Equal Search Quality

BC vs Retrieval
Model BC ↑ CS ↓
MinerU 0.735 2.711
WigtnOCR-2B 0.706 2.859
Qwen3-VL-30B 0.714 3.164
Marker 0.683 3.206
Qwen3-VL-2B 0.678 3.446
PaddleOCR 0.654 3.420

MinerU leads BC/CS but ranks 5th in retrieval — chunk boundary quality alone does not predict search performance. Text richness and structural fidelity matter more for end-to-end RAG.


How It Works

Distillation Pipeline

Stage 1: Pseudo GT Generation
    PDF pages → Qwen3-VL-30B (teacher) → Structured Markdown
    4,501 pages across 49 documents (Korean + English)

Stage 2: Quality Validation
    GT Markdown → Qwen3.5-122B (judge, text-only) → Score 1–5
    74–75% pass rate, 5-dimension quality scoring

Stage 3: Training Data Preparation
    Quality filtering (score ≥ 3) + bias correction + train/val split

Stage 4: LoRA Fine-tuning
    Qwen3-VL-2B + LoRA (rank=8, alpha=32) → WigtnOCR-2B
    ms-swift, DeepSpeed ZeRO-2, 3 epochs

Two-Step Causal Evaluation (KoGovDoc)

Step 1: Does structured parsing produce better chunks?
    6 parsers × semantic chunking → BC/CS (perplexity-based, MoC ACL 2025)

Step 2: Do better chunks produce better retrieval?
    Chunks → BGE-M3 embedding → FAISS → Hit@K, MRR, nDCG

Result: Better parsing → Better chunks → Better retrieval (verified across 6 parsers)


Training Dataset

Dataset Documents Pages Language Source
KoGovDoc 10 3,637 Korean Government publications
ArXivPapers 39 864 English arXiv (cs.CL, cs.CV, cs.LG)
Total 49 4,501 Bilingual

GT generated by Qwen3-VL-30B, validated by Qwen3.5-122B (text-only judge, 5-dimension scoring).


Model

Model weights are available on HuggingFace:

  • WigtnOCR-2B — Production model (Qwen3-VL-2B + LoRA fine-tuned)

Example Output

Comparison on a complex Korean government document page (kogov_001 p.9 — survey tables + statistical charts + mixed layout).

30B Teacher WigtnOCR-2B (Ours)
Charts [Figure: ...] placeholder Extracts data into tables
Content 1,582 chars 1,912 chars (+21%)
Tables 3 tables 4 tables (chart → table)
PDF Original PDF Original — kogov_001 page 9
30B Teacher Output (Qwen3-VL-30B) — 1,582 chars
- 지역 주민 의견 및 수요

## [군민 설문조사] 군민 478명 대상 설문조사로 도시문제 도출
- 군민 대상 설문조사 사항

| No. | 설문 항목 |
|-----|-----------|
| Q1 | 성별 / 연령 / 지역 / 불편사항 |
| Q2 | 안전 / 환경 / 에너지 / 교통 / 산업 / 행정 / 복지 / 문화 / 관광 / 농업 / 교육 |
| Q3 | 스마트도시 요소 / 지역 / 서비스 / 리빙랩 |

### - 군민 설문결과

[Figure: 보다 안전한 부여를 위해 개선해야 할 문제]
[Figure: 스마트도시 우선도입 서비스]

자료 : 부여군 스마트도시계획(2023)

## [농어업인 복지실태조사] 생활안전 개선을 위해 필요한 사항 설문결과

| 특성 | 도로안전시설 | 보행자길 정비 | 가로등 확충 | CCTV 설치 | 주민 방범 순찰 | 노후시설 | 안심 귀가 서비스 | 기타 |
|------|-------------|-------------|------------|----------|--------------|---------|----------------|------|
| 농어촌 | 10.1 | 21.0 | 23.1 | 25.7 | 8.1 | 8.2 | 3.4 | 0.3 |
|| 10.7 | 20.8 | 20.5 | 28.1 | 8.4 | 7.2 | 4.2 | 0.1 |
|| 9.5 | 21.2 | 25.8 | 23.3 | 7.8 | 9.3 | 2.7 | 0.4 |
| 농어가 | 8.7 | 22.3 | 23.2 | 23.1 | 7.9 | 12.1 | 2.5 | 0.2 |
| 비농어가 | 10.6 | 20.5 | 23.1 | 26.6 | 8.2 | 6.9 | 3.7 | 0.3 |
| 30대 이하 | 14.6 | 16.5 | 27.6 | 25.2 | 6.4 | 5.8 | 3.6 | 0.2 |
| 40대 | 6.3 | 20.1 | 19.6 | 33.1 | 10.9 | 4.6 | 5.1 | 0.2 |
| 50대 | 10.8 | 19.4 | 23.0 | 27.2 | 6.8 | 8.4 | 4.1 | 0.3 |
| 60대 | 10.5 | 22.9 | 22.8 | 23.4 | 7.2 | 10.2 | 2.6 | 0.4 |
| 70대 이상 | 9.9 | 23.5 | 24.0 | 21.1 | 8.7 | 10.4 | 2.2 | 0.2 |

자료 : 농촌진흥청 2023 농어업인등에 대한 복지실태조사

| 구분 | 도시문제 | 주민 수요 | 수요 주민 |
|------|----------|-----------|-----------|
| 복지 | 독거노인 돌봄 | - 부여군 보건복지 분야 개선사항으로 지적 | 70대 남성 |
| 복지 | 독거노인 돌봄 | - 인공지능 돌봄서비스 시범 사용 희망 | 60대 여성 |
| 복지 | 시설노후화 | - 부여군 읍면 경로당 내 시설 노후화 | 80대 남성 |
| 복지 | 여가 콘텐츠 부족 | - 경로당 내 여가 콘텐츠 부족 | 60대 여성 |
| 안전 | 안전 인프라 부족 | - 부여시장 근교 노인 보행자 교통사고 위험 높음 | 60대 남성 |
| 관광 | 관광 콘텐츠 부족 | - 수년 동안 업데이트되지 않은 박물관 내 콘텐츠 | 50대 남성 |
WigtnOCR-2B Output (Ours) — 1,912 chars
- 지역 주민 의견 및 수요

[균민 설문조사] 균민 478명 대상 설문조사로 도시문제 도출
- 균민 대상 설문조사 사항

| No. | 설문 항목 |
| --- | --- |
| Q1 | 성별 / 연령 / 지역 / 불편사항 |
| Q2 | 안전 / 환경 / 에너지 / 교통 / 산업 / 행정 / 보건 / 복지 / 문화 / 관광 / 농업 / 교육 |
| Q3 | 스마트도시 요소 / 지역 / 서비스 / 리빙랩 |

- 균민 설문결과

| 보다 안전한 부여를 위해 개선해야 할 문제 | 스마트도시 우선도입 서비스 |
| --- | --- |
| 시설 노후화 | 34.1% |
| 교통사고 다발구간 | 13.7% |
| 자연재해감시 | 12.8% |
| 심야시간 범죄 | 10.0% |
| 통학 안전 | 9.3% |
| 인재 | 8.2% |
| 재난 예경보 | 8.7% |
| 기타 | 3.4% |
| 스마트 보건/의료/복지 | 17.4% |
| 스마트 교통 | 15.7% |
| 스마트 환경/에너지/수자원 | 10.5% |
| 스마트 문화/관광/스포츠 | 10.1% |
| 스마트 근로/고용 | 9.9% |
| 스마트 행정 | 8.9% |
| 스마트 교육 | 7.6% |
| 스마트 방법/방재 | 6.4% |
| 스마트 시설물관리 | 4.5% |
| 스마트 주거 | 3.2% |
| 스마트 물류 | 2.8% |
| 기타 | 2.9% |

자료 : 부여군 스마트도시계획(2023)

[농어업인 복지실례조사] 생활안전 개선을 위해 필요한 사항 설문결과

| 특성 | 도로안전시설 | 보행자길 정비 | 가로등 확충 | CCTV 설치 | 주민 방법순찰 | 노후시설 | 안심 귀가 서비스 | 기타 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 농어촌 | 10.1 | 21.0 | 23.1 | 25.7 | 8.1 | 8.2 | 3.4 | 0.3 |
|| 10.7 | 20.8 | 20.5 | 28.1 | 8.4 | 7.2 | 4.2 | 0.1 |
|| 9.5 | 21.2 | 25.8 | 23.3 | 7.8 | 9.3 | 2.7 | 0.4 |
| 농어가 | 8.7 | 22.3 | 23.2 | 23.1 | 7.9 | 12.1 | 2.5 | 0.2 |
| 비농어가 | 10.6 | 20.5 | 23.1 | 26.6 | 8.2 | 6.9 | 3.7 | 0.3 |
| 30대 이하 | 14.6 | 16.5 | 27.6 | 25.2 | 6.4 | 5.8 | 3.6 | 0.2 |
| 40대 | 6.3 | 20.1 | 19.6 | 33.1 | 10.9 | 4.6 | 5.1 | 0.2 |
| 50대 | 10.8 | 19.4 | 23.0 | 27.2 | 6.8 | 8.4 | 4.1 | 0.3 |
| 60대 | 10.5 | 22.9 | 22.8 | 23.4 | 7.2 | 10.2 | 2.6 | 0.4 |
| 70대 이상 | 9.9 | 23.5 | 24.0 | 21.1 | 8.7 | 10.4 | 2.2 | 0.2 |

자료 : 농촌진흥청 2023 농어업인등에 대한 복지실례조사

| 구분 | 도시문제 | 주민 수요 | 수요 주민 |
| --- | --- | --- | --- |
| 복지 | 독거노인 돌봄 | - 부여군 보건복지 분야 개선사항으로 지적 | 70대 남성 |
| 복지 | 독거노인 돌봄 | - 인공지능 돌봄서비스 시범 사용 호평 | 60대 여성 |
| 복지 | 시설노후화 | - 부여군 읍면 경로당 내 시설 노후화 | 80대 남성 |
| 복지 | 여가 콘텐츠 부족 | - 경로당 내 여가 콘텐츠 부족 | 60대 여성 |
| 안전 | 안전 인프라 부족 | - 부여시장 근교 노인 보행자 교통사고 위험 높음 | 60대 남성 |
| 관광 | 관광 콘텐츠 부족 | - 수년 동안 업데이트되지 않은 박물관 내 콘텐츠 | 50대 남성 |

Key difference: The 30B teacher replaces charts with [Figure: ...] placeholders, while WigtnOCR-2B extracts the actual data from charts into structured markdown tables — producing 21% more content from the same page.


References

  • Qwen3-VL — Base VLM family
  • ms-swift — Official Qwen fine-tuning framework
  • MoC — BC/CS chunk quality metrics (ACL 2025)
  • OmniDocBench — Document parsing benchmark (CVPR 2025)
  • vLLM — VLM serving engine
  • BGE-M3 — Multilingual embedding model
  • PaddleOCR — OCR baseline (via RapidOCR)
  • Marker — PDF-to-markdown converter
  • MinerU — PDF parsing tool

License

Apache License 2.0

Citation

@software{wigtnocr2026,
  title   = {WigtnOCR: Pseudo-Label Distillation for Structure-Preserving Document Parsing},
  author  = {Kim, Hyeongseob},
  year    = {2026},
  url     = {https://github.com/WIGTN/wigtnOCR-v1}
}

🏢 About WIGTN Crew

This project is built and maintained by WIGTN Crew
an AI-native open-source research crew based in Korea.
We build practical, domain-specialized AI tools. Fast prototyping, strong engineering, shipping real things.

🌐 Website wigtn.com
🐙 GitHub github.com/wigtn
🤗 HuggingFace huggingface.co/Wigtn
📦 NPM npmjs.com/org/wigtn

🔬 Our Projects

Project Description Status
WigtnOCR VLM-based Korean government document parser Research
WIGVO Real-time PSTN voice translation (Korean↔English) Research
Claude Code Plugin Multi-agent parallel execution ecosystem Open Source

Results speak louder than résumés.

About

A research framework tA research framework to evaluate how document parsing quality determines downstream RAG performance.o evaluate how document parsing quality de

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors