bisalsaha commited on
Commit
aeebf95
·
verified ·
1 Parent(s): 9d51570

Update dataset card to match 100% jihadv4 format & statistics

Browse files
Files changed (1) hide show
  1. README.md +32 -120
README.md CHANGED
@@ -12,122 +12,27 @@ tags:
12
  - bangladesh-bank
13
  size_categories:
14
  - n<1K
15
- configs:
16
- - config_name: default
17
- data_files:
18
- - split: train
19
- path: data/train-*
20
- - split: validation
21
- path: data/validation-*
22
- - config_name: documents
23
- data_files:
24
- - split: train
25
- path: documents/train-*
26
- dataset_info:
27
- - config_name: default
28
- features:
29
- - name: messages
30
- list:
31
- - name: content
32
- list:
33
- - name: text
34
- dtype: string
35
- - name: type
36
- dtype: string
37
- - name: role
38
- dtype: string
39
- - name: image
40
- dtype: image
41
- - name: task_type
42
- dtype: string
43
- - name: doc_type
44
- dtype: string
45
- - name: target_text
46
- dtype: string
47
- - name: source_file
48
- dtype: string
49
- - name: page_number
50
- dtype: int64
51
- - name: was_correct
52
- dtype: bool
53
- - name: batch_id
54
- dtype: string
55
- splits:
56
- - name: train
57
- num_bytes: 100024308
58
- num_examples: 320
59
- - name: validation
60
- num_bytes: 25516410
61
- num_examples: 80
62
- download_size: 125400400
63
- dataset_size: 125540718
64
- - config_name: documents
65
- features:
66
- - name: image
67
- dtype: image
68
- - name: doc_type
69
- dtype: string
70
- - name: was_correct
71
- dtype: bool
72
- - name: action
73
- dtype: string
74
- - name: confidence_score
75
- dtype: float64
76
- - name: latency_sec
77
- dtype: float64
78
- - name: target_json
79
- dtype: string
80
- - name: model_output
81
- dtype: string
82
- - name: corrected_output
83
- dtype: string
84
- - name: extraction_prompt
85
- dtype: string
86
- - name: classification_prompt
87
- dtype: string
88
- - name: timestamp
89
- dtype: string
90
- - name: source_file
91
- dtype: string
92
- - name: page_number
93
- dtype: int64
94
- - name: image_path
95
- dtype: string
96
- - name: has_dpo_pair
97
- dtype: bool
98
- - name: dpo_chosen
99
- dtype: string
100
- - name: dpo_rejected
101
- dtype: string
102
- - name: batch_id
103
- dtype: string
104
- - name: synced_at
105
- dtype: string
106
- splits:
107
- - name: train
108
- num_bytes: 63601796
109
- num_examples: 200
110
- download_size: 62528422
111
- dataset_size: 63601796
112
  ---
113
 
114
- # 🏦 Bangladesh Bank Trade Finance IDP — Multi-Layout Fine-Tuning Dataset
115
 
116
- Self-contained vision-language dataset for end-to-end extraction and classification of the **8 official Bangladesh Bank regulatory trade documents**.
117
- Generated with **100% diverse layouts, distinct company profiles, varying aesthetic themes, and zero repeated structures**.
118
- Strictly conforms to official Bangladesh Bank regulatory XML/JSON standards with zero hallucination guarantee (`MessageIdentifier == ""`).
119
 
120
- ## 📊 Dataset Summary
121
 
122
- | Split / Subset | Rows / Records |
123
- | :--- | :--- |
124
- | `documents` | 200 |
125
- | `train` | 320 |
126
- | `validation` | 80 |
 
 
 
 
127
 
128
- ### Document Types Distribution (200 Total Verified Documents)
129
- | Document Category | Count | Description |
130
- | :--- | :--- | :--- |
131
  | `air_waybill` | 25 |
132
  | `bill_of_entry` | 25 |
133
  | `commercial_lca` | 25 |
@@ -137,22 +42,29 @@ Strictly conforms to official Bangladesh Bank regulatory XML/JSON standards with
137
  | `industrial_lca` | 25 |
138
  | `ocean_bl` | 25 |
139
 
140
- - **Visual Diversity:** 8 Header styles (Full Banner, Split Header, Centered Crest, Minimal Barcode, Letterhead Box, Telex Mono, Sidebar Strip, Double Rule Hero), 5 Table formats (Zebra Stripes, Dense Grid, Minimal Underline, Floating Pills, Monospace Matrix), 4 Procedural Stamp configurations, and 12 distinct color palettes.
141
- - **Realistic Handwriting:** Natural handwriting pen fills and endorsements (Caveat, Kalam, Bradley Hand in varied inks: classic blue ballpoint, dark ink, royal blue, navy, blue-black) paired with 100% strictly validated schema JSON.
142
- - **Enterprise Profiles:** 50 distinct real Bangladeshi corporations & global exporters across pharma, steel, textiles, electronics, agro, FMCG, and heavy industry.
 
143
  - **Header Integrity:** `MessageIdentifier` is strictly excluded from document image layouts and is normalized as empty `""` in ground truth.
144
 
145
- ## 🚀 Quickstart: Train in 10 Lines with Unsloth
 
 
 
 
146
 
147
  ```python
148
- from unsloth import FastVisionModel
149
  from datasets import load_dataset
 
150
  from trl import SFTTrainer, SFTConfig
151
 
152
  # 1. Load dataset directly from Hugging Face
153
- dataset = load_dataset("bisalsaha/bb-trade-idp-feedback")
 
 
154
 
155
- # 2. Load model with Vision LoRA
156
  model, tokenizer = FastVisionModel.from_pretrained(
157
  "unsloth/Qwen3-VL-8B-Instruct-unsloth-bnb-4bit",
158
  load_in_4bit=True
@@ -164,11 +76,11 @@ model = FastVisionModel.get_peft_model(
164
  target_modules=["q_proj", "v_proj"]
165
  )
166
 
167
- # 3. Train
168
  trainer = SFTTrainer(
169
  model=model,
170
- train_dataset=dataset["train"],
171
- eval_dataset=dataset["validation"],
172
  dataset_text_field="messages",
173
  max_seq_length=2048,
174
  args=SFTConfig(
 
12
  - bangladesh-bank
13
  size_categories:
14
  - n<1K
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  ---
16
 
17
+ # 🏦 Bangladesh Bank Trade Finance IDP — Multi-User Collaborative Fine-Tuning Dataset
18
 
19
+ This dataset contains human-reviewed, verified, and corrected document extractions for the **8 official Bangladesh Bank regulatory trade-finance document types**.
 
 
20
 
21
+ It is **completely self-contained** and structured for immediate Vision-Language Model (VLM) fine-tuning anytime from any environment (Colab, Kaggle, GPU cluster, or local), with built-in multi-annotator merge support and incremental delta uploads.
22
 
23
+ ---
24
+
25
+ ## 📊 Dataset Structure & Splits
26
+
27
+ | Split / Subset | Description | Examples |
28
+ |---|---|---|
29
+ | **`train`** | Ready-to-train multi-task VLM conversations (`messages` format) | 320 |
30
+ | **`validation`** | Stratified held-out evaluation conversations for monitoring eval loss | 80 |
31
+ | **`documents`** | Full document-level feedback records with model outputs, human corrections, confidence scores & DPO pairs (subset: `documents`) | 200 |
32
 
33
+ ### 📑 Document Types Represented
34
+ | Document Type | Document Count |
35
+ |---|---|
36
  | `air_waybill` | 25 |
37
  | `bill_of_entry` | 25 |
38
  | `commercial_lca` | 25 |
 
42
  | `industrial_lca` | 25 |
43
  | `ocean_bl` | 25 |
44
 
45
+ **Total DPO Preference Pairs Available:** 10 (for Direct Preference Optimization)
46
+
47
+ - **Visual Diversity:** 8 Header styles, 5 Table formats, 4 Procedural Stamp configurations, and 12 distinct color palettes.
48
+ - **Realistic Handwriting:** Natural handwriting pen fills and endorsements in varied inks (blue ballpoint, dark ink, navy, royal blue) paired with 100% strictly validated schema JSON.
49
  - **Header Integrity:** `MessageIdentifier` is strictly excluded from document image layouts and is normalized as empty `""` in ground truth.
50
 
51
+ ---
52
+
53
+ ## 🚀 Quickstart: Train in 10 Lines with Unsloth / TRL
54
+
55
+ You can fine-tune Qwen3-VL / Qwen2.5-VL directly on this dataset without ANY manual data wrangling:
56
 
57
  ```python
 
58
  from datasets import load_dataset
59
+ from unsloth import FastVisionModel
60
  from trl import SFTTrainer, SFTConfig
61
 
62
  # 1. Load dataset directly from Hugging Face
63
+ ds = load_dataset("bisalsaha/bb-trade-idp-feedback")
64
+ train_data = ds["train"]
65
+ eval_data = ds.get("validation")
66
 
67
+ # 2. Load model & attach vision LoRA adapters
68
  model, tokenizer = FastVisionModel.from_pretrained(
69
  "unsloth/Qwen3-VL-8B-Instruct-unsloth-bnb-4bit",
70
  load_in_4bit=True
 
76
  target_modules=["q_proj", "v_proj"]
77
  )
78
 
79
+ # 3. SFT Trainer
80
  trainer = SFTTrainer(
81
  model=model,
82
+ train_dataset=train_data,
83
+ eval_dataset=eval_data,
84
  dataset_text_field="messages",
85
  max_seq_length=2048,
86
  args=SFTConfig(