Update README.md
Browse files
README.md
CHANGED
@@ -1,199 +1,107 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
# Model Card for Model ID
|
7 |
|
8 |
-
|
9 |
|
|
|
10 |
|
|
|
11 |
|
12 |
-
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
|
18 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
19 |
|
20 |
-
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
|
28 |
-
|
29 |
|
30 |
-
|
31 |
|
32 |
-
|
33 |
-
- **Paper [optional]:** [More Information Needed]
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
|
36 |
## Uses
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
43 |
-
|
44 |
-
[More Information Needed]
|
45 |
-
|
46 |
-
### Downstream Use [optional]
|
47 |
-
|
48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
49 |
|
50 |
-
|
51 |
|
52 |
-
|
|
|
|
|
53 |
|
54 |
-
|
55 |
|
56 |
-
|
57 |
|
58 |
-
|
59 |
|
60 |
-
|
61 |
|
62 |
-
|
63 |
|
64 |
-
|
65 |
|
66 |
-
|
67 |
|
68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
-
|
70 |
-
## How to Get Started with the Model
|
71 |
-
|
72 |
-
Use the code below to get started with the model.
|
73 |
-
|
74 |
-
[More Information Needed]
|
75 |
|
76 |
## Training Details
|
77 |
|
78 |
### Training Data
|
79 |
|
80 |
-
|
81 |
|
82 |
-
|
83 |
|
84 |
-
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
|
|
|
92 |
|
93 |
-
|
94 |
|
95 |
-
|
96 |
|
97 |
-
|
98 |
|
99 |
-
|
100 |
|
101 |
-
|
102 |
|
103 |
## Evaluation
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
172 |
-
|
173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
|
193 |
-
|
|
|
|
|
194 |
|
195 |
-
|
|
|
|
|
196 |
|
197 |
-
## Model Card
|
198 |
|
199 |
-
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- peft
|
5 |
+
- lora
|
6 |
+
- qlora
|
7 |
+
- address-normalization
|
8 |
+
- address-correction
|
9 |
+
- malaysia
|
10 |
+
license: apache-2.0
|
11 |
+
base_model:
|
12 |
+
- openlm-research/open_llama_3b_v2
|
13 |
+
pipeline_tag: text-classification
|
14 |
+
language:
|
15 |
+
- en
|
16 |
+
- ms
|
17 |
---
|
18 |
|
19 |
# Model Card for Model ID
|
20 |
|
21 |
+
This model is a LoRA-fine-tuned adapter built on top of OpenLLaMA 3B v2, specialized for Malaysian address correction. It:
|
22 |
|
23 |
+
Expands common local abbreviations (e.g., JLN → JALAN, TMN → TAMAN, WPKL → KUALA LUMPUR)
|
24 |
|
25 |
+
Normalizes spacing and adds commas, outputting addresses in a consistent, one-line, uppercase format
|
26 |
|
27 |
+
Formats addresses as [Address/Unit], [Street], [Locality/Area], [City], [Postcode], [State]
|
28 |
|
29 |
+
Runs efficiently on modest GPUs thanks to 4-bit quantization + LoRA, and supports easy batch or interactive usage
|
30 |
|
31 |
+
Ideal for developers needing clean, standardized Malaysian postal addresses for shipping labels, geocoding, or databases.
|
32 |
|
|
|
33 |
|
34 |
+
## Model Details
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
+
Base model: openlm-research/open_llama_3b_v2 (Apache-2.0).
|
37 |
|
38 |
+
Technique: QLoRA-style PEFT (LoRA on 4-bit base)
|
39 |
|
40 |
+
Intended users: Developers standardizing Malaysian postal addresses
|
|
|
|
|
41 |
|
42 |
## Uses
|
43 |
|
44 |
+
Correct and standardize Malaysian addresses in free-form text
|
45 |
+
Expand common abbreviations (e.g., JLN, TMN, LRG, WPKL)
|
46 |
+
Produce a single uppercase line suitable for label printing or geocoding prep
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
+
## Out-of-Scope Use
|
49 |
|
50 |
+
Non-Malaysian address formats
|
51 |
+
Entity verification/validation against authoritative sources
|
52 |
+
Geocoding / latitude-longitude lookup
|
53 |
|
54 |
+
## Bias, Risks & Limitations
|
55 |
|
56 |
+
Formatting assumptions: The model favors Malaysian conventions and may incorrectly reorder non-MY addresses.
|
57 |
|
58 |
+
Ambiguity: Abbreviations like HSN may map to multiple names; defaults are rule-based and may not match all cases.
|
59 |
|
60 |
+
Hallucination: The model can invent locality/state if the input is severely incomplete; keep a human in the loop for critical mailings.
|
61 |
|
62 |
+
## Recommendations
|
63 |
|
64 |
+
Keep a deterministic rule layer (abbrev expansion + uppercasing + simple postcode/state checks).
|
65 |
|
66 |
+
If you have authoritative reference lists (states, cities, postcodes), validate the final line before use.
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
## Training Details
|
70 |
|
71 |
### Training Data
|
72 |
|
73 |
+
Source: Private/local dataset created from real-world Malaysian address fragments (tab/CSV), plus pseudo-labels generated by deterministic expansion rules and tidy/uppercase standardization.
|
74 |
|
75 |
+
Augmentation: Synthetic “messy” inputs created by replacing full forms with common abbreviations (e.g., JALAN → JLN) so the model learns to normalize them.
|
76 |
|
77 |
+
Schema: JSON/JSONL with fields instruction, input, output.
|
78 |
|
79 |
+
### Training Procedure
|
|
|
|
|
|
|
|
|
80 |
|
81 |
+
PEFT: r=8, lora_alpha=16, lora_dropout=0.1, target modules q_proj,k_proj,v_proj,o_proj
|
82 |
|
83 |
+
Optimizer/Schedule: AdamW, lr=2e-4, cosine decay, warmup 5%
|
84 |
|
85 |
+
Batching: per_device_train_batch_size=2, gradient_accumulation_steps=8 (effective ~16)
|
86 |
|
87 |
+
Epochs: 2–4 (depending on dataset size)
|
88 |
|
89 |
+
Precision: 4-bit NF4 base compute (fp16)
|
90 |
|
91 |
+
Framework: transformers==4.55.x, peft, datasets, accelerate, bitsandbytes
|
92 |
|
93 |
## Evaluation
|
94 |
|
95 |
+
Qualitative validation on held-out messy inputs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
+
Input (shortened)
|
98 |
+
11A, JALAN BU 11/14, BANDAR UTAMA PETALING JAYA 47800 Selangor
|
99 |
+
LEVEL 30 THE GARDENS NORTH TOWER MID VALLEY CITY 59200 WP Kuala Lumpur
|
100 |
|
101 |
+
Expected → Model Output
|
102 |
+
11A, JALAN BU 11/14, BANDAR UTAMA, PETALING JAYA, 47800, SELANGOR
|
103 |
+
LEVEL 30, THE GARDENS NORTH TOWER, MID VALLEY CITY, 59200, KUALA LUMPUR
|
104 |
|
105 |
+
## Model Card Authors
|
106 |
|
107 |
+
Author: Ramsha Firdous
|