Upload bert-base-NER ONNX model
Browse files- README.md +54 -0
- config.json +48 -0
- model.onnx +3 -0
- vocab.txt +0 -0
README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: onnx
|
| 3 |
+
tags:
|
| 4 |
+
- bert
|
| 5 |
+
- ner
|
| 6 |
+
- named-entity-recognition
|
| 7 |
+
- token-classification
|
| 8 |
+
- conll2003
|
| 9 |
+
- onnx
|
| 10 |
+
- inference4j
|
| 11 |
+
license: mit
|
| 12 |
+
pipeline_tag: token-classification
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# BERT Base NER — ONNX
|
| 16 |
+
|
| 17 |
+
ONNX export of [dslim/bert-base-NER](https://huggingface.co/dslim/bert-base-NER), a BERT model fine-tuned on CoNLL-2003 for Named Entity Recognition. Identifies persons, organizations, locations, and miscellaneous entities in text using IOB2 tagging.
|
| 18 |
+
|
| 19 |
+
Mirrored for use with [inference4j](https://github.com/inference4j/inference4j), an inference-only AI library for Java.
|
| 20 |
+
|
| 21 |
+
## Original Source
|
| 22 |
+
|
| 23 |
+
- **Repository:** [dslim (ONNX by Xenova)](https://huggingface.co/dslim/bert-base-NER)
|
| 24 |
+
- **License:** mit
|
| 25 |
+
|
| 26 |
+
## Usage with inference4j
|
| 27 |
+
|
| 28 |
+
```java
|
| 29 |
+
try (BertNerRecognizer ner = BertNerRecognizer.builder()
|
| 30 |
+
.modelId("inference4j/bert-base-NER")
|
| 31 |
+
.build()) {
|
| 32 |
+
List<NamedEntity> entities = ner.recognize("John works at Google in London.");
|
| 33 |
+
for (NamedEntity e : entities) {
|
| 34 |
+
System.out.printf("%s (%s)%n", e.text(), e.label());
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
## Model Details
|
| 40 |
+
|
| 41 |
+
| Property | Value |
|
| 42 |
+
|----------|-------|
|
| 43 |
+
| Architecture | BERT Base (12 layers, 768 hidden, 110M params) |
|
| 44 |
+
| Task | Named Entity Recognition (IOB2 tagging) |
|
| 45 |
+
| Labels | O, B-PER, I-PER, B-ORG, I-ORG, B-LOC, I-LOC, B-MISC, I-MISC |
|
| 46 |
+
| Training data | CoNLL-2003 |
|
| 47 |
+
| F1 score | 91.3 |
|
| 48 |
+
| Max sequence length | 512 |
|
| 49 |
+
| Tokenizer | WordPiece (cased) |
|
| 50 |
+
| Original framework | PyTorch (HuggingFace Transformers) |
|
| 51 |
+
|
| 52 |
+
## License
|
| 53 |
+
|
| 54 |
+
This model is licensed under the [MIT License](https://opensource.org/licenses/MIT). Original model by [dslim](https://huggingface.co/dslim/bert-base-NER), ONNX export by [Xenova](https://huggingface.co/Xenova).
|
config.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "dslim/bert-base-NER",
|
| 3 |
+
"_num_labels": 9,
|
| 4 |
+
"architectures": [
|
| 5 |
+
"BertForTokenClassification"
|
| 6 |
+
],
|
| 7 |
+
"attention_probs_dropout_prob": 0.1,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"hidden_act": "gelu",
|
| 10 |
+
"hidden_dropout_prob": 0.1,
|
| 11 |
+
"hidden_size": 768,
|
| 12 |
+
"id2label": {
|
| 13 |
+
"0": "O",
|
| 14 |
+
"1": "B-MISC",
|
| 15 |
+
"2": "I-MISC",
|
| 16 |
+
"3": "B-PER",
|
| 17 |
+
"4": "I-PER",
|
| 18 |
+
"5": "B-ORG",
|
| 19 |
+
"6": "I-ORG",
|
| 20 |
+
"7": "B-LOC",
|
| 21 |
+
"8": "I-LOC"
|
| 22 |
+
},
|
| 23 |
+
"initializer_range": 0.02,
|
| 24 |
+
"intermediate_size": 3072,
|
| 25 |
+
"label2id": {
|
| 26 |
+
"B-LOC": 7,
|
| 27 |
+
"B-MISC": 1,
|
| 28 |
+
"B-ORG": 5,
|
| 29 |
+
"B-PER": 3,
|
| 30 |
+
"I-LOC": 8,
|
| 31 |
+
"I-MISC": 2,
|
| 32 |
+
"I-ORG": 6,
|
| 33 |
+
"I-PER": 4,
|
| 34 |
+
"O": 0
|
| 35 |
+
},
|
| 36 |
+
"layer_norm_eps": 1e-12,
|
| 37 |
+
"max_position_embeddings": 512,
|
| 38 |
+
"model_type": "bert",
|
| 39 |
+
"num_attention_heads": 12,
|
| 40 |
+
"num_hidden_layers": 12,
|
| 41 |
+
"output_past": true,
|
| 42 |
+
"pad_token_id": 0,
|
| 43 |
+
"position_embedding_type": "absolute",
|
| 44 |
+
"transformers_version": "4.29.2",
|
| 45 |
+
"type_vocab_size": 2,
|
| 46 |
+
"use_cache": true,
|
| 47 |
+
"vocab_size": 28996
|
| 48 |
+
}
|
model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9784f160524c01c12145872ed76c3361b0f90285b484678ad92b2c30be57b408
|
| 3 |
+
size 431172606
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|