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:

  • people
  • places
  • dates

Entity mapping from OntoNotes:

  • PERSON โ†’ people
  • GPE, LOC, FAC โ†’ places
  • DATE โ†’ dates

Training data

  • Dataset: tner/ontonotes5 raw JSON shards
  • Train examples: 12000
  • Eval examples: 512
  • Fixed scored eval slice: first 64 validation examples after deterministic filtering/shuffle with seed 42
  • 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.5105
  • json_exact_match_pct: 81.2500
  • parseable_pct: 100.0000

Republished checkpoint pushed to this repo from the same recipe/commit with Hub push enabled:

  • entity_f1_pct: 94.4444
  • json_exact_match_pct: 92.1875
  • parseable_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
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Mike0021/qwen35-0.8b-ner-json-lora

Adapter
(98)
this model