Views
No views yet
| Parameter | Value |
|---|---|
| LoRA Rank | 32 |
| Learning Rate | 1e-4 |
| Batch Size | 4 |
| Epochs | 3 |
| Loss | Cross-entropy (prompt masked, completion weighted) |
Step 1: Classification → {category}
Step 2: Priority → {High|Medium|Low}
Step 3: Suggested actions → {action_items}
Step 4: Drafted response → {draft_response}verify_code → High priority, urgent action requiredspam / promotions → Low priority, delete/mark as spamupdates → Medium priority, read and acknowledgeforum / social_media → Medium priority, read later1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3
4base_model = "Qwen/Qwen3-4B-Instruct-2507"
5adapter_path = "path/to/adapters/email_triage_final"
6
7model = AutoModelForCausalLM.from_pretrained(base_model)
8model = PeftModel.from_pretrained(model, adapter_path)
9tokenizer = AutoTokenizer.from_pretrained(base_model)
10
11prompt = """You are an efficient admin assistant. Analyze this incoming email step-by-step and output in structured format:
12
13Email:
14Subject: Your order has shipped!
15Hi [Customer Name], Your recent order #[ORDER NUMBER] has shipped and is on its way. You can track your package here: [Tracking Link]. Thanks for shopping with us!"""
16
17inputs = tokenizer(prompt, return_tensors="pt")
18outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7, do_sample=True)
19response = tokenizer.decode(outputs[0], skip_special_tokens=True)1curl -X POST http://localhost:8000/inference \
2 -H "Content-Type: application/json" \
3 -d '{
4 "prompt": "You are an efficient admin assistant. Analyze this incoming email step-by-step and output in structured format:\n\nEmail:\nSubject: Your order has shipped!\n...",
5 "max_tokens": 256,
6 "temperature": 0.7
7 }'1@misc{email-triage-slm,
2 title={Email Triage SLM: LoRA Fine-tuned Model for Email Classification},
3 author={Shanvit S Shetty},
4 year={2026},
5 url={https://huggingface.co/your-username/email-triage-slm}
6 howpublished={\url{https://github.com/Shanvit7/email-triage-slm}}
7}