You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

JSL-Granite-CP

A fine-tune of ibm-granite/granite-4.0-h-tiny (Mamba-2 hybrid MoE, ~7B total / ~1B active) that authors Spark NLP ContextualParser (CP) rules for PHI de-identification.

Given a clinical text and a target entity type, it emits a CP rule as JSON — a regex plus context gates (prefix/suffix words, contextLength, contextException), or a dictionary, or null (abstain) when no rule applies.

Results — clean held-out test (700 rows, zero training leakage)

model F1 hallucinations
base granite-4.0-h-tiny 88.33 288
JSL-Granite-CP (this model) 93.97 39

Scored with the project's shipped reward logic (grpo_reward / offline simulate_cp — the rule is executed against the text and matched spans are compared to gold). Test rows share 0 examples with the training data.

Training

QLoRA (bitsandbytes 4-bit nf4, LoRA r=16 / α=32, target_modules="all-linear") on 5,029 reward-verified CP-rule examples (balanced across entities, weak entities oversampled), 2 epochs, then merged back to bf16.

Usage

Use the project system prompt (from to_chat.py). Serve with vLLM:

vllm serve Zaynoid/JSL-Granite-CP --max-model-len 8192 --trust-remote-code

User message format:

Text: <clinical text>

Target entity: <ENTITY>

Return the ContextualParser rule as JSON.

Output: {"cp_rule": { ... }} or {"cp_rule": null}.

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

Model tree for Zaynoid/JSL-Granite-CP

Finetuned
(10)
this model