gnumanth/nullspan-dataset
Preview • Updated
How to use gnumanth/nullspan with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "question-answering" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# pip install "transformers<5.0.0"
from transformers import pipeline
pipe = pipeline("question-answering", model="gnumanth/nullspan", trust_remote_code=True) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("gnumanth/nullspan", trust_remote_code=True, device_map="auto")nullspan is a 67M-parameter System One extraction, calibrated abstention, invariant verification, and quantile distribution model. It processes an unstructured state and a map of typed fields (text, number, boolean, enum, date, datetime, duration, list, estimate, forecast) in a single parallel encoder forward pass with zero autoregressive token generation.
NullspanForExtraction)
Built on distilbert/distilbert-base-uncased (67M parameters) with 5 parallel System One heads and 10 routed operations:
null_head: Calibrated p_null probability (ECE: 0.00206, Brier: 0.0022) for absent field abstention (value: null + nearest guess decoy + abstention_reason).span_head: Token-level start/end pointer network mapped via offset_mapping to exact character spans [start, end] with calibrated posterior confidence and Shannon span_entropy_bits.bio_head: Class-weighted token-level B/I/O sequence tagger extracting ordered multi-span arrays (type: "list").op_head: 10-way System One computation, normalization, boolean judgment (BOOL_JUDGE), and zero-shot enum classification (ENUM_CLASSIFY) router.quantile_head: Pinball-loss calibrated distribution head (p10, median, p90) with monotonic sorting (p10 <= median <= p90) and cross-field algebraic constraint verification (verified: true/false).gnumanth/nullspan-dataset)
165.8s (Apple Silicon MPS)p_null): 99.75% (ECE: 0.00206, Brier: 0.0022)[start, end]): 99.24%100.0%100.0%0.0007 / 0.0001100.0%100.0%100.0%from transformers import AutoModel, AutoTokenizer
repo_id = "gnumanth/nullspan"
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModel.from_pretrained(repo_id, trust_remote_code=True)
incident = (
"Incident INC-40928 opened on Apr 12, 2026 with a 502 Bad Gateway errors and a TLS handshake timeouts. "
"Issued $1240.50 plus $310.25 SLA credit. Severity is sev-1 and customer data loss was false. "
"Root cause CVE not yet assigned. Cluster stabilized on Apr 19, 2026. Reported by Mira"
)
result = model.extract(
state=incident,
fields={
"incident_id": {"type": "text", "instructions": "Incident ticket identifier"},
"opened_on": {"type": "date", "instructions": "Date the incident opened"},
"total_credit": {"type": "number", "decimals": 2, "unit": "USD", "instructions": "Total credit including SLA penalty"},
"outage_days": {"type": "duration", "unit": "days", "integer": True, "instructions": "Days from incident open to cluster stabilization"},
"failure_modes": {"type": "list", "items": "text", "instructions": "Each failure mode triggered"},
"severity": {"type": "enum", "options": ["sev-1", "sev-2", "sev-3"], "instructions": "Incident severity tier"},
"data_loss": {"type": "boolean", "instructions": "Whether customer data loss occurred"},
"cve_id": {"type": "text", "instructions": "Assigned CVE identifier if present"},
"remediation_cost": {"type": "estimate", "unit": "USD", "min": 100, "max": 25000, "scale": "log", "step": 10, "instructions": "Estimated engineering remediation cost"},
},
tokenizer=tokenizer,
)
print(result["answers"])
{
"reporter": {
"type": "text",
"p_null": 1.2e-06,
"span": [
276,
280
],
"guess": "Mira",
"confidence": 0.999992,
"span_entropy_bits": 0.0001,
"value": "Mira"
},
"incident_id": {
"type": "text",
"p_null": 1.3e-06,
"span": [
9,
18
],
"guess": "INC-40928",
"confidence": 0.999994,
"span_entropy_bits": 0.0001,
"value": "INC-40928"
},
"opened_on": {
"type": "date",
"p_null": 4e-08,
"span": [
29,
41
],
"guess": "2026-04-12",
"confidence": 0.999999,
"span_entropy_bits": 0.0,
"value": "2026-04-12"
},
"total_credit": {
"type": "number",
"p_null": 7.51e-06,
"span": [
109,
130
],
"guess": 1550.75,
"confidence": 0.99998,
"span_entropy_bits": 0.0003,
"value": 1550.75
},
"outage_days": {
"type": "duration",
"p_null": 3.18e-06,
"unit": "days",
"span": [
29,
41
],
"guess": 7,
"confidence": 0.999995,
"span_entropy_bits": 0.0001,
"value": 7
},
"failure_modes": {
"type": "list",
"value": [
"502 Bad Gateway errors",
"TLS handshake timeouts"
],
"spans": [
[
49,
71
],
[
78,
100
]
],
"confidence": 0.999932,
"span_entropy_bits": 0.0011
},
"severity": {
"type": "enum",
"p_null": 4.779e-05,
"span": [
155,
160
],
"options": [
"sev-1",
"sev-2",
"sev-3"
],
"probs": {
"sev-1": 0.99994,
"sev-2": 3e-05,
"sev-3": 3e-05
},
"guess": "sev-1",
"confidence": 0.99994,
"span_entropy_bits": 0.0003,
"value": "sev-1"
},
"data_loss": {
"type": "boolean",
"p_null": 3.117e-05,
"p_true": 3.7e-05,
"span": [
188,
193
],
"guess": false,
"confidence": 0.999963,
"span_entropy_bits": 0.0002,
"value": false
},
"cve_id": {
"type": "text",
"p_null": 0.99994409,
"span": [
123,
130
],
"guess": "$310.25",
"confidence": 0.05,
"span_entropy_bits": 0.0008,
"value": null,
"abstention_reason": "unassigned_placeholder"
},
"remediation_cost": {
"type": "estimate",
"value": 1890,
"median": 1870,
"p10": 1270,
"p90": 2660,
"p_below": 0.0,
"p_above": 0.0,
"confidence": 0.999963
}
}
MIT © Hemanth.HM