Should this episode be enriched? — a binary gate for the OpenZync memory pipeline.
Binary classifier (BertForSequenceClassification, MiniLM-L6-v2 shape: 6 layers, hidden 384) fine-tuned on 100k synthetic episodes to predict should_enrich — whether an ingested episode carries enough signal to justify graph-enrichment spend.
from transformers import pipeline
clf = pipeline("text-classification", model="OpenZync/enrichment-gating-minilm-l6-v2")
print(clf("My husband Zara and I met at Fable Coffee in Kyoto."))
# [{"label": "LABEL_1", "score": ...}] # LABEL_1 = should_enrich
ONNX (bundled model.onnx + model.onnx.data, opset via optimum export):
from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForSequenceClassification
tok = AutoTokenizer.from_pretrained("OpenZync/enrichment-gating-minilm-l6-v2")
model = ORTModelForSequenceClassification.from_pretrained(
"OpenZync/enrichment-gating-minilm-l6-v2", file_name="model.onnx"
)
inputs = tok("Dinner was fine.", return_tensors="pt")
print(model(**inputs).logits.softmax(-1))
Held-out val (n=525) at t=0.05: AUC=0.554, acc=0.773 (majority=0.830), ECE=0.258, tn/fp/fn/tp=13/76/43/393. Full details in eval_report.md. Threshold sweep (val): skip_rate rises 0.196 → 0.370 from t=0.05 → 0.95 while precision_skip stays ~0.26–0.29 and value stays negative throughout — no threshold beats the always-enrich baseline on this split.
fp32↔ONNX parity: max|Δ|=1.45e-01, AUC delta 2.58e-04.
ai/notebooks/enrichment_gating/ — build_master.ipynb, data_prep.ipynb, train_classifier.ipynb, eval.ipynbsentence-transformers/all-MiniLM-L6-v2, fine-tuned 2-class head (vocab 30522, max length 128)AUC 0.554 sits below the 0.830 majority baseline — the gate as-is is not production-ready as a cost saver; every swept threshold has negative value vs always-enrich. Treat this release as a synthetic-data baseline for further work (real labels, calibration, harder negatives). Synthetic training names/venues do not reflect real users.
model.safetensors 91 MBmodel.onnx 58.4 kBsentence-transformers/all-MiniLM-L6-v2