Token Classification
Transformers
ONNX
Safetensors
modernbert
ner
on-device
privacy
flowx
openner
insurance
de-identification
Instructions to use flowxai/codemap with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flowxai/codemap with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="flowxai/codemap")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("flowxai/codemap") model = AutoModelForTokenClassification.from_pretrained("flowxai/codemap", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add OpenNER model, card, NOTICE (Apache-2.0, FlowX.AI)
Browse files- .gitattributes +1 -0
- NOTICE +8 -0
- README.md +43 -0
- config.json +104 -0
- metrics.json +11 -0
- model.safetensors +3 -0
- onnx/model.int8.onnx +3 -0
- onnx/model.onnx +3 -0
- onnx/model.onnx.data +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +17 -0
- training_args.bin +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
onnx/model.onnx.data filter=lfs diff=lfs merge=lfs -text
|
NOTICE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FlowX OpenNER
|
| 2 |
+
Copyright 2026 FlowX.AI
|
| 3 |
+
|
| 4 |
+
This product includes software and models developed at FlowX.AI (https://flowx.ai).
|
| 5 |
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use these
|
| 6 |
+
files except in compliance with the License. You may obtain a copy of the License at
|
| 7 |
+
|
| 8 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: transformers
|
| 4 |
+
pipeline_tag: token-classification
|
| 5 |
+
base_model: answerdotai/ModernBERT-base
|
| 6 |
+
tags:
|
| 7 |
+
- ner
|
| 8 |
+
- on-device
|
| 9 |
+
- privacy
|
| 10 |
+
- flowx
|
| 11 |
+
- openner
|
| 12 |
+
- insurance
|
| 13 |
+
- de-identification
|
| 14 |
+
- token-classification
|
| 15 |
+
metrics:
|
| 16 |
+
- f1
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# CodeMap
|
| 20 |
+
|
| 21 |
+
**CodeMap** is a small, on-device insurance NER model from the FlowX **OpenNER** family. Developed by **FlowX.AI**. Runs 100% on-premise / air-gapped, so no data leaves your boundary.
|
| 22 |
+
|
| 23 |
+
## What it does
|
| 24 |
+
- **Task:** token-classification
|
| 25 |
+
- **Base model:** `answerdotai/ModernBERT-base`
|
| 26 |
+
- **Entity types (5):** CAT, CPT, ICD, NAIC, NCCI
|
| 27 |
+
- **Held-out F1:** 1.0000
|
| 28 |
+
- **Runtime:** CPU, Apple Silicon, one GPU, or browser/edge via ONNX (INT8). ~100-160 ms/doc on CPU.
|
| 29 |
+
|
| 30 |
+
## Why a small model
|
| 31 |
+
Fine-tuned encoders match or beat frontier LLMs on structured, convention-bound extraction, at a fraction of the latency and cost, with **zero data egress**. Identifiers are validated by checksum (IBAN mod-97, card Luhn, ISIN/LEI, container ISO-6346, VIN, national IDs), a correctness guarantee general LLMs lack. See the FlowX OpenNER benchmark for measured results.
|
| 32 |
+
|
| 33 |
+
## Usage
|
| 34 |
+
```python
|
| 35 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
| 36 |
+
tok = AutoTokenizer.from_pretrained("flowxai/codemap")
|
| 37 |
+
model = AutoModelForTokenClassification.from_pretrained("flowxai/codemap")
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
## License & attribution
|
| 41 |
+
Licensed under the **Apache License 2.0**. Copyright 2026 **FlowX.AI** (https://flowx.ai). See the `NOTICE` file. Trained on synthetic, checksum-validated data.
|
| 42 |
+
|
| 43 |
+
_Part of the FlowX OpenNER model family. Synthetic-data F1 reflects an in-distribution synthetic distribution; validate on real documents before production use._
|
config.json
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"ModernBertForTokenClassification"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 50281,
|
| 8 |
+
"classifier_activation": "gelu",
|
| 9 |
+
"classifier_bias": false,
|
| 10 |
+
"classifier_dropout": 0.0,
|
| 11 |
+
"classifier_pooling": "mean",
|
| 12 |
+
"cls_token_id": 50281,
|
| 13 |
+
"decoder_bias": true,
|
| 14 |
+
"deterministic_flash_attn": false,
|
| 15 |
+
"dtype": "float32",
|
| 16 |
+
"embedding_dropout": 0.0,
|
| 17 |
+
"eos_token_id": 50282,
|
| 18 |
+
"global_attn_every_n_layers": 3,
|
| 19 |
+
"gradient_checkpointing": false,
|
| 20 |
+
"hidden_activation": "gelu",
|
| 21 |
+
"hidden_size": 768,
|
| 22 |
+
"id2label": {
|
| 23 |
+
"0": "O",
|
| 24 |
+
"1": "B-NAIC",
|
| 25 |
+
"2": "I-NAIC",
|
| 26 |
+
"3": "B-ICD",
|
| 27 |
+
"4": "I-ICD",
|
| 28 |
+
"5": "B-CPT",
|
| 29 |
+
"6": "I-CPT",
|
| 30 |
+
"7": "B-NCCI",
|
| 31 |
+
"8": "I-NCCI",
|
| 32 |
+
"9": "B-CAT",
|
| 33 |
+
"10": "I-CAT"
|
| 34 |
+
},
|
| 35 |
+
"initializer_cutoff_factor": 2.0,
|
| 36 |
+
"initializer_range": 0.02,
|
| 37 |
+
"intermediate_size": 1152,
|
| 38 |
+
"label2id": {
|
| 39 |
+
"B-CAT": 9,
|
| 40 |
+
"B-CPT": 5,
|
| 41 |
+
"B-ICD": 3,
|
| 42 |
+
"B-NAIC": 1,
|
| 43 |
+
"B-NCCI": 7,
|
| 44 |
+
"I-CAT": 10,
|
| 45 |
+
"I-CPT": 6,
|
| 46 |
+
"I-ICD": 4,
|
| 47 |
+
"I-NAIC": 2,
|
| 48 |
+
"I-NCCI": 8,
|
| 49 |
+
"O": 0
|
| 50 |
+
},
|
| 51 |
+
"layer_norm_eps": 1e-05,
|
| 52 |
+
"layer_types": [
|
| 53 |
+
"full_attention",
|
| 54 |
+
"sliding_attention",
|
| 55 |
+
"sliding_attention",
|
| 56 |
+
"full_attention",
|
| 57 |
+
"sliding_attention",
|
| 58 |
+
"sliding_attention",
|
| 59 |
+
"full_attention",
|
| 60 |
+
"sliding_attention",
|
| 61 |
+
"sliding_attention",
|
| 62 |
+
"full_attention",
|
| 63 |
+
"sliding_attention",
|
| 64 |
+
"sliding_attention",
|
| 65 |
+
"full_attention",
|
| 66 |
+
"sliding_attention",
|
| 67 |
+
"sliding_attention",
|
| 68 |
+
"full_attention",
|
| 69 |
+
"sliding_attention",
|
| 70 |
+
"sliding_attention",
|
| 71 |
+
"full_attention",
|
| 72 |
+
"sliding_attention",
|
| 73 |
+
"sliding_attention",
|
| 74 |
+
"full_attention"
|
| 75 |
+
],
|
| 76 |
+
"local_attention": 128,
|
| 77 |
+
"max_position_embeddings": 8192,
|
| 78 |
+
"mlp_bias": false,
|
| 79 |
+
"mlp_dropout": 0.0,
|
| 80 |
+
"model_type": "modernbert",
|
| 81 |
+
"norm_bias": false,
|
| 82 |
+
"norm_eps": 1e-05,
|
| 83 |
+
"num_attention_heads": 12,
|
| 84 |
+
"num_hidden_layers": 22,
|
| 85 |
+
"pad_token_id": 50283,
|
| 86 |
+
"position_embedding_type": "absolute",
|
| 87 |
+
"rope_parameters": {
|
| 88 |
+
"full_attention": {
|
| 89 |
+
"rope_theta": 160000.0,
|
| 90 |
+
"rope_type": "default"
|
| 91 |
+
},
|
| 92 |
+
"sliding_attention": {
|
| 93 |
+
"rope_theta": 10000.0,
|
| 94 |
+
"rope_type": "default"
|
| 95 |
+
}
|
| 96 |
+
},
|
| 97 |
+
"sep_token_id": 50282,
|
| 98 |
+
"sparse_pred_ignore_index": -100,
|
| 99 |
+
"sparse_prediction": false,
|
| 100 |
+
"tie_word_embeddings": true,
|
| 101 |
+
"transformers_version": "5.14.1",
|
| 102 |
+
"use_cache": false,
|
| 103 |
+
"vocab_size": 50368
|
| 104 |
+
}
|
metrics.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"test_loss": 2.8653639105868933e-07,
|
| 3 |
+
"test_precision": 1.0,
|
| 4 |
+
"test_recall": 1.0,
|
| 5 |
+
"test_f1": 1.0,
|
| 6 |
+
"test_accuracy": 1.0,
|
| 7 |
+
"test_runtime": 4.622,
|
| 8 |
+
"test_samples_per_second": 865.43,
|
| 9 |
+
"test_steps_per_second": 27.045,
|
| 10 |
+
"epoch": 3.0
|
| 11 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:46fb509a83d8ee07b7222f1ff51062f1bb95af25a2ab0be80d0ca3266a252d21
|
| 3 |
+
size 598467476
|
onnx/model.int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:792386b0beb8a2f10f222041c6ed9342140c3e365efb460672076785c279aea3
|
| 3 |
+
size 152203520
|
onnx/model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:104f808057c94cbf84c15e91fee0d88117630321beb09bcd3ed24e5070b29ff1
|
| 3 |
+
size 2616345
|
onnx/model.onnx.data
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:06e80a219b04535ce6ac2d80a13f5606c26b6ad3f0ba85842f9352411df74e7b
|
| 3 |
+
size 598474752
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"clean_up_tokenization_spaces": true,
|
| 4 |
+
"cls_token": "[CLS]",
|
| 5 |
+
"is_local": false,
|
| 6 |
+
"local_files_only": false,
|
| 7 |
+
"mask_token": "[MASK]",
|
| 8 |
+
"model_input_names": [
|
| 9 |
+
"input_ids",
|
| 10 |
+
"attention_mask"
|
| 11 |
+
],
|
| 12 |
+
"model_max_length": 8192,
|
| 13 |
+
"pad_token": "[PAD]",
|
| 14 |
+
"sep_token": "[SEP]",
|
| 15 |
+
"tokenizer_class": "TokenizersBackend",
|
| 16 |
+
"unk_token": "[UNK]"
|
| 17 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b70da71902ad58cb7b1f843e9f1ce144bf6d4598df319c3ed85213299f6b38fb
|
| 3 |
+
size 5201
|