qwen35-0.8b-ner-json-lora
LoRA adapters for Qwen/Qwen3.5-0.8B fine-tuned to extract named entities from a sentence and return JSON only:
{"people": [], "places": [], "dates": []}
Task
Input: a sentence.
Output: strict JSON with:
peopleplacesdates
Entity mapping from OntoNotes:
PERSONโpeopleGPE,LOC,FACโplacesDATEโdates
Training data
- Dataset:
tner/ontonotes5raw JSON shards - Train examples:
12000 - Eval examples:
512 - Fixed scored eval slice: first
64validation examples after deterministic filtering/shuffle with seed42 - Negative ratio:
0.15
Training recipe
- Base model:
Qwen/Qwen3.5-0.8B - 4-bit base + LoRA SFT
- LoRA target modules: auto-discovered
- LoRA rank/alpha/dropout:
16 / 32 / 0.05 - Batch size:
2 - Grad accumulation:
8 - Max steps:
300 - Learning rate:
2e-4 - Max length:
384 - Max new tokens:
96 - Seed:
42
Metrics
Original logged winning run (Run 4):
entity_f1_pct:89.5105json_exact_match_pct:81.2500parseable_pct:100.0000
Republished checkpoint pushed to this repo from the same recipe/commit with Hub push enabled:
entity_f1_pct:94.4444json_exact_match_pct:92.1875parseable_pct:100.0000
Usage
from transformers import AutoTokenizer, AutoModelForImageTextToText
from peft import PeftModel
base_model = "Qwen/Qwen3.5-0.8B"
adapter_id = "Mike0021/qwen35-0.8b-ner-json-lora"
tokenizer = AutoTokenizer.from_pretrained(adapter_id, trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(base_model, trust_remote_code=True)
model = PeftModel.from_pretrained(model, adapter_id)
Prompt format used during training:
- system:
Extract named entities from the sentence. Return strict JSON only with keys people, places, dates. Each value must be an array of strings. Use [] when empty. - user:
Sentence: <sentence>
The model should answer with JSON only.
- Downloads last month
- -