Khaos Form 4 Insider Transactions
A DistilBERT token classifier that finds the owner, role, security, share count, price, transaction code and date in raw Form 4 XML.
sec_form4_insider v1, from Khaos (a local-first library of pre-trained models for domain-specific tasks). This is the first release of the artifact.
Model
- Architecture: FilingNER: distilbert-base-uncased encoder with a BIO token-classification head and a mean-pooled embedding output
- Parameters: 66,374,415
- Format: ONNX (
model.onnx) plus PyTorch weights (model.pt) andmanifest.json - Training data: fletxcher/khaos-sec_form4_insider
Results
Measured on the held-out test split of the training dataset.
| Metric | Value |
|---|---|
| test_entity_f1 | 0.9908 |
| test_entity_precision | 0.9900 |
| test_entity_recall | 0.9917 |
| n_test_examples | 264 |
| test_entity_f1_exact | 0.9908 |
Test results by label quality
Entity-level exact match (type and token boundaries).
| Label quality | Examples | Precision | Recall | F1 |
|---|---|---|---|---|
| exact | 264 | 0.990 | 0.992 | 0.991 |
Test results by entity type
| Entity type | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| DATE | 1.000 | 1.000 | 1.000 | 66 |
| PERSON | 0.979 | 0.989 | 0.984 | 93 |
| PRICE | 1.000 | 1.000 | 1.000 | 115 |
| SECURITY_TYPE | 1.000 | 0.961 | 0.980 | 102 |
| SHARE_COUNT | 1.000 | 1.000 | 1.000 | 128 |
| TRANSACTION_CODE | 0.960 | 1.000 | 0.980 | 96 |
Training
{
"epochs": 5,
"batch": 16,
"lr": 5e-05,
"base_model": "distilbert-base-uncased",
"max_len": 256,
"labels": [
"O",
"B-PERSON",
"I-PERSON",
"B-ROLE",
"I-ROLE",
"B-SECURITY_TYPE",
"I-SECURITY_TYPE",
"B-SHARE_COUNT",
"I-SHARE_COUNT",
"B-PRICE",
"I-PRICE",
"B-TRANSACTION_CODE",
"I-TRANSACTION_CODE",
"B-DATE",
"I-DATE"
]
}
Best epoch 4, trained in 1.7 minutes on a single consumer GPU (RTX 3050 8 GB).
Intended use
Parsing Form 4 filings, including damaged or unusual XML where a strict parser fails.
Limitations
- Trained on raw XML, where tag names make the task easy; free-text descriptions of trades are not covered.
- Only the labelled fields are extracted; a plain XML parser is more reliable on well-formed filings.
Usage
pip install khaos
khaos serve ./sec_form4_insider
License
Trained on public SEC filings and openly licensed data; released under Apache-2.0.