Instructions to use THemidli/applied-ner-stage3-bert-tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use THemidli/applied-ner-stage3-bert-tiny with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="THemidli/applied-ner-stage3-bert-tiny")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("THemidli/applied-ner-stage3-bert-tiny") model = AutoModelForTokenClassification.from_pretrained("THemidli/applied-ner-stage3-bert-tiny", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: google/bert_uncased_L-2_H-128_A-2
|
| 3 |
+
datasets:
|
| 4 |
+
- THemidli/applied-ner-stage2-expanded
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
library_name: transformers
|
| 8 |
+
pipeline_tag: token-classification
|
| 9 |
+
license: apache-2.0
|
| 10 |
+
tags:
|
| 11 |
+
- ner
|
| 12 |
+
- token-classification
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# Applied NER Stage 3 — BERT Tiny
|
| 16 |
+
|
| 17 |
+
An eight-label English token classifier fine-tuned from [google/bert_uncased_L-2_H-128_A-2](https://huggingface.co/google/bert_uncased_L-2_H-128_A-2). Repository: THemidli/applied-ner-stage3-bert-tiny.
|
| 18 |
+
|
| 19 |
+
## Results
|
| 20 |
+
|
| 21 |
+
Exact entity-level seqeval metrics:
|
| 22 |
+
|
| 23 |
+
| Split | Precision | Recall | F1 | Token accuracy |
|
| 24 |
+
|---|---:|---:|---:|---:|
|
| 25 |
+
| Train | 0.9581 | 0.9726 | 0.9653 | 0.9957 |
|
| 26 |
+
| Test | 0.4215 | 0.5273 | 0.4685 | 0.8269 |
|
| 27 |
+
|
| 28 |
+
| Label | Precision | Recall | F1 | Support |
|
| 29 |
+
|---|---:|---:|---:|---:|
|
| 30 |
+
| PERSON | 0.461 | 0.641 | 0.536 | 195 |
|
| 31 |
+
| ORGANIZATION | 0.200 | 0.218 | 0.208 | 147 |
|
| 32 |
+
| LOCATION | 0.432 | 0.552 | 0.485 | 143 |
|
| 33 |
+
| TIMEDATE | 0.792 | 0.844 | 0.817 | 167 |
|
| 34 |
+
| PRODUCT | 0.171 | 0.189 | 0.180 | 127 |
|
| 35 |
+
| WORKOFART | 0.128 | 0.247 | 0.168 | 97 |
|
| 36 |
+
| JOB | 0.699 | 0.798 | 0.745 | 99 |
|
| 37 |
+
| AMOUNT | 0.556 | 0.625 | 0.588 | 104 |
|
| 38 |
+
|
| 39 |
+
On 40 fresh, manually gold-labeled wild probes, exact span F1 was 0.4785 (precision 0.4505, recall 0.5102).
|
| 40 |
+
|
| 41 |
+
## Training
|
| 42 |
+
|
| 43 |
+
- Dataset: [THemidli/applied-ner-stage2-expanded](https://huggingface.co/datasets/THemidli/applied-ner-stage2-expanded)
|
| 44 |
+
- Seed: 20260802
|
| 45 |
+
- Hardware: Apple MPS (macOS-27.0-arm64-arm-64bit)
|
| 46 |
+
- Runtime: 17.780 seconds
|
| 47 |
+
- Records/chunks: 641/665 train; 159/165 test
|
| 48 |
+
- Maximum length: 256; fast-tokenizer overflow chunks, no overlapping stride
|
| 49 |
+
- Hyperparameters: {"epochs": 20, "eval_batch_size": 64, "learning_rate": 0.0005, "scheduler": "linear", "train_batch_size": 32, "warmup_steps": 42, "weight_decay": 0.01}
|
| 50 |
+
- No validation split and no test-driven checkpoint selection
|
| 51 |
+
|
| 52 |
+
## Footprint and CPU benchmark
|
| 53 |
+
|
| 54 |
+
- Parameters: 4,371,601 (17.49 MB tensor storage)
|
| 55 |
+
- Saved artifact: 18.21 MB
|
| 56 |
+
- Model-load RSS delta: 31.85 MB
|
| 57 |
+
- End-to-end inference RSS delta: 41.30 MB
|
| 58 |
+
- CPU throughput: 11459.9 examples/s at batch 32 with 8 threads
|
| 59 |
+
- Mean latency: 0.0873 ms/example at that batch size
|
| 60 |
+
|
| 61 |
+
The benchmark covers tokenizer plus PyTorch CPU forward pass over 40 short probes, repeated 50 times. It is workload- and hardware-specific, not single-request latency.
|
| 62 |
+
|
| 63 |
+
## Labels
|
| 64 |
+
|
| 65 |
+
PERSON, ORGANIZATION, LOCATION, TIMEDATE, PRODUCT, WORKOFART, JOB, AMOUNT using BIO encoding.
|
| 66 |
+
|
| 67 |
+
## Limitations
|
| 68 |
+
|
| 69 |
+
This is a 4.37M-parameter uncased two-layer BERT trained on a small, heterogeneous dataset. It is a compact baseline, not a production privacy system. Rare works/products, company-versus-product context, exact boundaries, and subword-heavy names remain weak. The 40-probe wild set is diagnostic, not a population benchmark.
|