Qwen3-1.7B SCL Extractor

Fine-tuned Qwen/Qwen3-1.7B (QLoRA, 4-bit NF4, merged to bf16) that extracts structured safety facts from industrial incident narratives as strict JSON.

Trained on ~30k OSHA severe-injury reports (2015–2025).

Output format

The model outputs only a single JSON object:

{
  "energy": {
    "energy_type": "gravity",
    "magnitude": 8.0,
    "unit": "feet",
    "evidence": "fell approximately 8 feet"
  },
  "injury": {
    "injury_degree": "serious",
    "evidence": "fracturing his elbow"
  }
}
  • energy_type ∈ {gravity, motion_vehicle, electrical, pressure, thermal, chemical, other, not_stated}
  • injury_degree ∈ {fatal, serious, minor, none, not_stated}
  • evidence fields are verbatim substrings of the input narrative.
  • The model never outputs a safety classification — high_energy is decided in code by comparing magnitude/unit against thresholds.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

tok = AutoTokenizer.from_pretrained("Nishant1600/qwen3-1_7b-scl-extractor")
model = AutoModelForCausalLM.from_pretrained(
    "Nishant1600/qwen3-1_7b-scl-extractor",
    torch_dtype="auto", device_map="auto",
)

prompt = (
    "<|im_start|>system\n"
    "You are a workplace safety fact extractor... output ONLY a single JSON object.\n"
    "<|im_end|>\n"
    "<|im_start|>user\nNarrative:\n<your narrative here><|im_end|>\n"
    "<|im_start|>assistant\n<think>\n\n</think>\n\n"   # no-think switch
)
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256, do_sample=False,
                     pad_token_id=tok.eos_token_id)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

Notes:

  • Use greedy decoding (do_sample=False, temperature=0) for deterministic extractions.
  • The empty <think> block after <|im_start|>assistant\n disables Qwen3 reasoning mode.

Limitations

  • Injury labels skew toward serious because the OSHA severe-injury dataset contains severe cases only.
  • English narratives only; trained on US oil/gas/industrial report style.

Intended use

Backend extractor for the SIH26165 safety-compliance pipeline. Not a substitute for professional safety judgment.

Downloads last month
360
Safetensors
Model size
2B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Nishant1600/qwen3-1_7b-scl-extractor

Finetuned
Qwen/Qwen3-1.7B
Adapter
(648)
this model