zieglerd commited on
Commit
da0bb95
·
verified ·
1 Parent(s): ac5c94b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +79 -40
README.md CHANGED
@@ -41,6 +41,7 @@ Unlike generic information extraction models, this adapter focuses on complex re
41
  ### Direct Use
42
 
43
  The adapter is intended for automated extraction of structured information from Russian contracts.
 
44
 
45
  Input:
46
 
@@ -99,60 +100,98 @@ Users should validate extracted information before using it in legal or financia
99
 
100
  ---
101
 
102
- ## How to Get Started
103
 
104
- ```python
105
- from transformers import AutoModelForCausalLM, AutoTokenizer
106
- from peft import PeftModel
107
 
108
- base = AutoModelForCausalLM.from_pretrained(
109
- "Qwen/Qwen2.5-14B-Instruct"
110
- )
111
 
112
- tokenizer = AutoTokenizer.from_pretrained(
113
- "Qwen/Qwen2.5-14B-Instruct"
114
- )
115
 
116
- model = PeftModel.from_pretrained(
117
- base,
118
- "YOUR_USERNAME/RussianContractExtraction-LoRA"
119
- )
120
- ```
121
 
122
  ---
123
 
124
- ## Training Details
125
-
126
- ### Training Data
127
-
128
- The adapter was fine-tuned using a dataset of Russian corporate procurement contracts.
129
-
130
- The dataset contains numerous difficult enterprise scenarios, including:
131
-
132
- - framework agreements;
133
- - contracts without fixed total amounts;
134
- - contracts without explicitly defined subject;
135
- - advance payment contracts;
136
- - multiple payment stages;
137
- - contracts with multiple VAT rates;
138
- - contracts containing specifications;
139
- - contracts with complex financial conditions.
140
-
141
- The objective of training was accurate structured JSON generation rather than plain text summarization.
 
 
 
 
 
 
 
 
 
 
 
 
142
 
143
  ---
144
 
145
- ## Training Procedure
146
-
147
- The adapter was trained using supervised instruction tuning.
148
 
149
- Input consists of free-form Russian contract text.
150
 
151
- Output consists of structured JSON following a fixed extraction schema.
152
 
153
- The model learns to preserve missing values by returning `null` instead of hallucinating unsupported information.
154
 
155
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
 
157
  ## Evaluation
158
 
 
41
  ### Direct Use
42
 
43
  The adapter is intended for automated extraction of structured information from Russian contracts.
44
+ **The current version is optimized for contracts with a single supplier. Support for multi-supplier and multi-party agreements has not been evaluated and may require additional fine-tuning.**
45
 
46
  Input:
47
 
 
100
 
101
  ---
102
 
103
+ ## Training Procedure
104
 
105
+ The adapter was trained using supervised instruction tuning (SFT).
 
 
106
 
107
+ Input consists of free-form Russian procurement contract text.
 
 
108
 
109
+ Output consists of structured JSON following a fixed extraction schema.
 
 
110
 
111
+ The model was optimized to preserve factual correctness and return `null` whenever required information is absent instead of hallucinating unsupported values.
 
 
 
 
112
 
113
  ---
114
 
115
+ ## Training Configuration
116
+
117
+ | Parameter | Value |
118
+ |-----------|-------|
119
+ | Base model | Qwen/Qwen2.5-14B-Instruct |
120
+ | Training method | Supervised Fine-Tuning (SFT) |
121
+ | Adapter type | LoRA |
122
+ | LoRA rank | 32 |
123
+ | LoRA alpha | 64 |
124
+ | LoRA dropout | 0.03 |
125
+ | Trainable modules | `q_proj`, `k_proj`, `v_proj`, `o_proj`, `up_proj`, `down_proj`, `gate_proj` |
126
+ | Training file | `merged_train.jsonl` |
127
+ | Validation file | `merged_val.jsonl` |
128
+ | Model suffix | `SWAGA_LLM` |
129
+ | Epochs | 3 |
130
+ | Batch size | 8 |
131
+ | Gradient accumulation | 1 |
132
+ | Effective batch size | 8 |
133
+ | Sequence packing | Enabled |
134
+ | Maximum sequence length | 32768 |
135
+ | Learning rate | 2e-5 |
136
+ | Warmup ratio | 0.03 |
137
+ | Weight decay | 0 |
138
+ | Max gradient norm | 1.0 |
139
+ | LR scheduler | Cosine |
140
+ | Minimum LR ratio | 0 |
141
+ | Scheduler cycles | 0.5 |
142
+ | Checkpoints saved | 5 |
143
+ | Evaluation runs | 6 |
144
+ | Train on inputs | False |
145
 
146
  ---
147
 
148
+ ## Benchmark
 
 
149
 
150
+ The model was evaluated on an internal validation set containing Russian enterprise procurement contracts that were not used during training.
151
 
152
+ Evaluation focused on structured information extraction rather than natural language generation.
153
 
154
+ The benchmark includes contracts with:
155
 
156
+ - framework agreements;
157
+ - contracts without fixed total amounts;
158
+ - contracts with multiple payment stages;
159
+ - contracts containing specifications;
160
+ - contracts with multiple VAT rates;
161
+ - advance payment contracts;
162
+ - contracts with complex financial conditions;
163
+ - contracts containing incomplete or ambiguous information.
164
+
165
+ | Field Accuracy | 96.2% |
166
+ | Field | Accuracy |
167
+ |-------|----------:|
168
+ | Contract number | 99.8% |
169
+ | Contract date | 99.3% |
170
+ | Supplier | 98.7% |
171
+ | Customer | 98.5% |
172
+ | Subject | 96.1% |
173
+ | Contract amount | 95.6% |
174
+ | VAT | 98.9% |
175
+ | Payment terms | 91.8% |
176
+ | Validity period | 94.2% |
177
+
178
+
179
+ ### Evaluation criteria
180
+
181
+ The following aspects were manually verified:
182
+
183
+ - correct extraction of contract metadata;
184
+ - supplier and customer identification;
185
+ - subject extraction;
186
+ - total contract amount extraction;
187
+ - VAT identification;
188
+ - payment schedule extraction;
189
+ - contract validity dates;
190
+ - preservation of missing values using `null`;
191
+ - JSON schema validity;
192
+ - absence of hallucinated values.
193
+
194
+ The model was optimized for high factual precision and schema consistency on long Russian legal documents (up to 32k tokens).
195
 
196
  ## Evaluation
197