Model details
Table | |
|---|
| Base model | unsloth/Qwen2.5-7B-Instruct-bnb-4bit (4-bit quantised Qwen/Qwen2.5-7B-Instruct) |
| Method | QLoRA (4-bit), supervised fine-tuning with TRL + Unsloth |
| LoRA rank / alpha / dropout | 16 / 16 / 0 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Language | Turkish |
| License | MIT (the base model is Apache-2.0) |
Output schema
The model emits a single JSON object:
Table with columns: Field, Description| Field | Description |
|---|
document_type | One of 5: TALEP_DILEKCE_BASVURUSU, BILGI_TALEBI, SIKAYET_IHBAR_BASVURUSU, ITIRAZ_IDARI_BASVURU, KURUMLAR_ARASI_RESMI_YAZI |
sender_type | One of 4: VATANDAS, KAMU_KURUMU, OZEL_KURULUS, YARGI_MERCII |
primary_topic | One of 58 municipal topics (each maps to one of 11 directorates through a fixed lookup table in the project repo) |
requested_action | What the sender is asking for, in one sentence |
key_information | List of {type, value} entities (16 types, e.g. PERSON, DATE, DOCUMENT_NO, CASE_NO, AMOUNT, EVENT_DETAIL) |
missing_information | Information the file lacks (e.g. a missing parcel number in a zoning petition) |
summary | Short summary of the document |
Intended use
Decision support for municipal staff: the adapter prepares a structured reading of an incoming document, and a human officer reviews it, selects legislation and decides the process status. The target directorate is not predicted by the model; it comes from the deterministic topic-to-directorate table (app/maps/belediye_konu.json in the repo).
Not intended for fully automated administrative decisions, or for text types and institutions far from Turkish municipal correspondence.
How to use
import torchfrom transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModel base_id = "unsloth/Qwen2.5-7B-Instruct-bnb-4bit" # needs bitsandbytes and a CUDA GPUadapter_id = "furkancmc/kadim-analiz-lora" tokenizer = AutoTokenizer.from_pretrained(adapter_id)model = AutoModelForCausalLM.from_pretrained(base_id, device_map="auto")model = PeftModel.from_pretrained(model, adapter_id) messages = [ {"role": "system", "content": "<analysis system prompt from the project repo>"}, {"role": "user", "content": "Sayın Belediye Başkanlığı, ... (petition text)"},]inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, return_tensors="pt").to(model.device)out = model.generate(inputs, max_new_tokens=768, do_sample=False)print(tokenizer.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))
Use the same system prompt as in training (see analiz_qwen1/ and app/ in the GitHub repo); the adapter expects it. In the full system the adapter is served with vLLM multi-LoRA next to kadim-yazi-lora on a single shared Qwen2.5-7B-Instruct base.
Training data
Dataset: furkancmc/kadim-analiz-data (train, validation and test splits).
2,444 synthetic Turkish petitions and official letters covering 58 topics and 11 municipal directorates, generated with the DeepSeek API through per-directorate scripts (analiz_qwen1/generate_dataset_*.py).
Table with columns: Split, Records| Split | Records |
|---|
| Train | 1,957 |
| Validation | 246 |
| Test | 241 |
All records are synthetic. No real citizen data (national ID numbers, names, addresses, phone numbers) is included. The dataset is also in the GitHub repo under analiz_qwen1/veri/.
Evaluation
Held-out test set of 241 records; base model and adapter were evaluated on the same set under the same conditions.
Table with columns: Metric, Base model, This adapter, Gain| Metric | Base model | This adapter | Gain |
|---|
document_type accuracy | 70.1% | 85.5% | +15.4 pts |
sender_type accuracy | 78.0% | 95.4% | +17.4 pts |
missing_information accuracy | 74.3% | 97.9% | +23.6 pts |
primary_topic accuracy (58 classes) | n/a | 72.2% | n/a |
missing_information accuracy is the rate at which the model correctly decides whether the document lacks required information. The evaluation notebook is analiz_qwen1/Qwen1_FineTune_Colab.ipynb.
Limitations
- Trained on synthetic documents; performance on real scanned or noisy public documents may be lower.
- Scope is Turkish municipal correspondence. Topic classification (72.2% over 58 classes) is the weakest field.
- Output is JSON generated by a language model: validate it against the schema before using it downstream.
- Outputs are suggestions for a human officer, not administrative decisions.
Citation
@misc{kadim2026, title = {KADİM: Kamu Dilekçe ve İnceleme Mekanizması}, author = {Camcıoğlu, Furkan}, year = {2026}, url = {https://github.com/furkancmc/teknofest-kadim-kamu-evrak-ajani}}