Text Classification
Transformers
ONNX
Safetensors
modernbert
ner
on-device
privacy
flowx
openner
logistics
de-identification
text-embeddings-inference
Instructions to use flowxai/hscodeclassify with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flowxai/hscodeclassify with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="flowxai/hscodeclassify")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("flowxai/hscodeclassify") model = AutoModelForSequenceClassification.from_pretrained("flowxai/hscodeclassify", 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 +123 -0
- metrics.json +10 -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: text-classification
|
| 5 |
+
base_model: answerdotai/ModernBERT-base
|
| 6 |
+
tags:
|
| 7 |
+
- ner
|
| 8 |
+
- on-device
|
| 9 |
+
- privacy
|
| 10 |
+
- flowx
|
| 11 |
+
- openner
|
| 12 |
+
- logistics
|
| 13 |
+
- de-identification
|
| 14 |
+
- text-classification
|
| 15 |
+
metrics:
|
| 16 |
+
- f1
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# HSCodeClassify
|
| 20 |
+
|
| 21 |
+
**HSCodeClassify** is a small, on-device logistics text classifier 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:** text-classification
|
| 25 |
+
- **Base model:** `answerdotai/ModernBERT-base`
|
| 26 |
+
- **Classes (20):** 03 Fish & seafood, 08 Edible fruit & nuts, 09 Coffee, tea & spices, 22 Beverages & spirits, 30 Pharmaceuticals, 39 Plastics & articles, 40 Rubber & articles, 44 Wood & articles, 48 Paper & paperboard, 61 Apparel, knitted, 62 Apparel, not knitted, 64 Footwear, 72 Iron & steel, 73 Articles of iron/steel, 84 Machinery & mechanical, 85 Electrical machinery, 87 Vehicles & parts, 90 Optical/medical instr., 94 Furniture & bedding, 95 Toys, games & sports
|
| 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, AutoModelForSequenceClassification
|
| 36 |
+
tok = AutoTokenizer.from_pretrained("flowxai/hscodeclassify")
|
| 37 |
+
model = AutoModelForSequenceClassification.from_pretrained("flowxai/hscodeclassify")
|
| 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,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"ModernBertForSequenceClassification"
|
| 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": "03 Fish & seafood",
|
| 24 |
+
"1": "08 Edible fruit & nuts",
|
| 25 |
+
"2": "09 Coffee, tea & spices",
|
| 26 |
+
"3": "22 Beverages & spirits",
|
| 27 |
+
"4": "30 Pharmaceuticals",
|
| 28 |
+
"5": "39 Plastics & articles",
|
| 29 |
+
"6": "40 Rubber & articles",
|
| 30 |
+
"7": "44 Wood & articles",
|
| 31 |
+
"8": "48 Paper & paperboard",
|
| 32 |
+
"9": "61 Apparel, knitted",
|
| 33 |
+
"10": "62 Apparel, not knitted",
|
| 34 |
+
"11": "64 Footwear",
|
| 35 |
+
"12": "72 Iron & steel",
|
| 36 |
+
"13": "73 Articles of iron/steel",
|
| 37 |
+
"14": "84 Machinery & mechanical",
|
| 38 |
+
"15": "85 Electrical machinery",
|
| 39 |
+
"16": "87 Vehicles & parts",
|
| 40 |
+
"17": "90 Optical/medical instr.",
|
| 41 |
+
"18": "94 Furniture & bedding",
|
| 42 |
+
"19": "95 Toys, games & sports"
|
| 43 |
+
},
|
| 44 |
+
"initializer_cutoff_factor": 2.0,
|
| 45 |
+
"initializer_range": 0.02,
|
| 46 |
+
"intermediate_size": 1152,
|
| 47 |
+
"label2id": {
|
| 48 |
+
"03 Fish & seafood": 0,
|
| 49 |
+
"08 Edible fruit & nuts": 1,
|
| 50 |
+
"09 Coffee, tea & spices": 2,
|
| 51 |
+
"22 Beverages & spirits": 3,
|
| 52 |
+
"30 Pharmaceuticals": 4,
|
| 53 |
+
"39 Plastics & articles": 5,
|
| 54 |
+
"40 Rubber & articles": 6,
|
| 55 |
+
"44 Wood & articles": 7,
|
| 56 |
+
"48 Paper & paperboard": 8,
|
| 57 |
+
"61 Apparel, knitted": 9,
|
| 58 |
+
"62 Apparel, not knitted": 10,
|
| 59 |
+
"64 Footwear": 11,
|
| 60 |
+
"72 Iron & steel": 12,
|
| 61 |
+
"73 Articles of iron/steel": 13,
|
| 62 |
+
"84 Machinery & mechanical": 14,
|
| 63 |
+
"85 Electrical machinery": 15,
|
| 64 |
+
"87 Vehicles & parts": 16,
|
| 65 |
+
"90 Optical/medical instr.": 17,
|
| 66 |
+
"94 Furniture & bedding": 18,
|
| 67 |
+
"95 Toys, games & sports": 19
|
| 68 |
+
},
|
| 69 |
+
"layer_norm_eps": 1e-05,
|
| 70 |
+
"layer_types": [
|
| 71 |
+
"full_attention",
|
| 72 |
+
"sliding_attention",
|
| 73 |
+
"sliding_attention",
|
| 74 |
+
"full_attention",
|
| 75 |
+
"sliding_attention",
|
| 76 |
+
"sliding_attention",
|
| 77 |
+
"full_attention",
|
| 78 |
+
"sliding_attention",
|
| 79 |
+
"sliding_attention",
|
| 80 |
+
"full_attention",
|
| 81 |
+
"sliding_attention",
|
| 82 |
+
"sliding_attention",
|
| 83 |
+
"full_attention",
|
| 84 |
+
"sliding_attention",
|
| 85 |
+
"sliding_attention",
|
| 86 |
+
"full_attention",
|
| 87 |
+
"sliding_attention",
|
| 88 |
+
"sliding_attention",
|
| 89 |
+
"full_attention",
|
| 90 |
+
"sliding_attention",
|
| 91 |
+
"sliding_attention",
|
| 92 |
+
"full_attention"
|
| 93 |
+
],
|
| 94 |
+
"local_attention": 128,
|
| 95 |
+
"max_position_embeddings": 8192,
|
| 96 |
+
"mlp_bias": false,
|
| 97 |
+
"mlp_dropout": 0.0,
|
| 98 |
+
"model_type": "modernbert",
|
| 99 |
+
"norm_bias": false,
|
| 100 |
+
"norm_eps": 1e-05,
|
| 101 |
+
"num_attention_heads": 12,
|
| 102 |
+
"num_hidden_layers": 22,
|
| 103 |
+
"pad_token_id": 50283,
|
| 104 |
+
"position_embedding_type": "absolute",
|
| 105 |
+
"problem_type": "single_label_classification",
|
| 106 |
+
"rope_parameters": {
|
| 107 |
+
"full_attention": {
|
| 108 |
+
"rope_theta": 160000.0,
|
| 109 |
+
"rope_type": "default"
|
| 110 |
+
},
|
| 111 |
+
"sliding_attention": {
|
| 112 |
+
"rope_theta": 10000.0,
|
| 113 |
+
"rope_type": "default"
|
| 114 |
+
}
|
| 115 |
+
},
|
| 116 |
+
"sep_token_id": 50282,
|
| 117 |
+
"sparse_pred_ignore_index": -100,
|
| 118 |
+
"sparse_prediction": false,
|
| 119 |
+
"tie_word_embeddings": true,
|
| 120 |
+
"transformers_version": "5.14.1",
|
| 121 |
+
"use_cache": false,
|
| 122 |
+
"vocab_size": 50368
|
| 123 |
+
}
|
metrics.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"test_loss": 2.498298954378697e-06,
|
| 3 |
+
"test_accuracy": 1.0,
|
| 4 |
+
"test_macro_f1": 1.0,
|
| 5 |
+
"test_f1": 1.0,
|
| 6 |
+
"test_runtime": 3.4699,
|
| 7 |
+
"test_samples_per_second": 1152.769,
|
| 8 |
+
"test_steps_per_second": 36.024,
|
| 9 |
+
"epoch": 3.0
|
| 10 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e85fadff2c128f420cd69db59d97e1ecdad8123b17095114276637cac3f5cc60
|
| 3 |
+
size 598495160
|
onnx/model.int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:30b2f43be2fab7256b58def684d15f42328004ab123d46a4bfa549782a1be7ac
|
| 3 |
+
size 152210468
|
onnx/model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0f1342201b0ea1a65082a751ead0c2c18e2bdbd56cd3286399fe7b31ffa0a61c
|
| 3 |
+
size 2616381
|
onnx/model.onnx.data
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dddc8f6fde897603066139a6d2392bf8c26b93f38ce3de0b13f7cbf1d5a8b4bd
|
| 3 |
+
size 598540288
|
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:d19f4a24bc7b414fcbb9826ff1062dd753d299eab043df1287fc02a1de2bfcdb
|
| 3 |
+
size 5201
|