Qwen2.5-1.5B-Instruct — MaintNorm (Merged LoRA)
A LoRA fine-tuned and merged version of Qwen/Qwen2.5-1.5B-Instruct for normalising and masking noisy industrial maintenance work-order (MWO) short texts into clean, lowercase standard English.
- GitHub Repository (code, notebook & error analysis): boghdadii/qwen2.5-maintnorm-lora
- Dataset: MaintNorm (MIT License) — trained on Companies A & B (6,289 records), evaluated on unseen Company C (400 records).
Results (Unseen Company C Test Set)
| System | Exact Match ↑ | WER ↓ | ERR ↑ | Speed (rec/s) |
|---|---|---|---|---|
| Copy Baseline | 0.1450 | 0.5344 | 0.0000 | — |
| Zero-Shot | 0.1600 | 0.4429 | 0.1712 | 16.25 |
| 20-Shot | 0.1025 | 0.3795 | 0.2898 | 5.25 |
| LoRA (this model) | 0.5700 | 0.1363 | 0.7449 | 13.18 |
Usage with Transformers (Python)
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "Moh-Elboghdadi/qwen2.5-1.5b-maintnorm"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
system_prompt = (
"Normalise the industrial maintenance work-order note into clean, lowercase standard English. "
"Expand abbreviations, fix spelling, and mask asset IDs as <id>, numbers as <num>, and sensitive terms as <sensitive>. "
"Output ONLY the normalised line with no explanation."
)
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": "XH531 M/SITE GLASS CUT & SUPPLY WINDOW"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True).split("\n")[0])
# Output: <id> minesite glass cut and supply window