Commit ·
2793052
0
Parent(s):
Duplicate from Davlan/distilbert-base-multilingual-cased-ner-hrl
Browse filesCo-authored-by: David Adelani <Davlan@users.noreply.huggingface.co>
- .gitattributes +18 -0
- README.md +66 -0
- config.json +45 -0
- model.safetensors +3 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- tf_model.h5 +3 -0
- tokenizer_config.json +1 -0
- training_args.bin +3 -0
- vocab.txt +0 -0
.gitattributes
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: afl-3.0
|
| 3 |
+
---
|
| 4 |
+
Hugging Face's logo
|
| 5 |
+
---
|
| 6 |
+
language:
|
| 7 |
+
- ar
|
| 8 |
+
- de
|
| 9 |
+
- en
|
| 10 |
+
- es
|
| 11 |
+
- fr
|
| 12 |
+
- it
|
| 13 |
+
- lv
|
| 14 |
+
- nl
|
| 15 |
+
- pt
|
| 16 |
+
- zh
|
| 17 |
+
- multilingual
|
| 18 |
+
|
| 19 |
+
---
|
| 20 |
+
# distilbert-base-multilingual-cased-ner-hrl
|
| 21 |
+
## Model description
|
| 22 |
+
**distilbert-base-multilingual-cased-ner-hrl** is a **Named Entity Recognition** model for 10 high resourced languages (Arabic, German, English, Spanish, French, Italian, Latvian, Dutch, Portuguese and Chinese) based on a fine-tuned Distiled BERT base model. It has been trained to recognize three types of entities: location (LOC), organizations (ORG), and person (PER).
|
| 23 |
+
Specifically, this model is a *distilbert-base-multilingual-cased* model that was fine-tuned on an aggregation of 10 high-resourced languages
|
| 24 |
+
## Intended uses & limitations
|
| 25 |
+
#### How to use
|
| 26 |
+
You can use this model with Transformers *pipeline* for NER.
|
| 27 |
+
```python
|
| 28 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
| 29 |
+
from transformers import pipeline
|
| 30 |
+
tokenizer = AutoTokenizer.from_pretrained("Davlan/distilbert-base-multilingual-cased-ner-hrl")
|
| 31 |
+
model = AutoModelForTokenClassification.from_pretrained("Davlan/distilbert-base-multilingual-cased-ner-hrl")
|
| 32 |
+
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 33 |
+
example = "Nader Jokhadar had given Syria the lead with a well-struck header in the seventh minute."
|
| 34 |
+
ner_results = nlp(example)
|
| 35 |
+
print(ner_results)
|
| 36 |
+
```
|
| 37 |
+
#### Limitations and bias
|
| 38 |
+
This model is limited by its training dataset of entity-annotated news articles from a specific span of time. This may not generalize well for all use cases in different domains.
|
| 39 |
+
## Training data
|
| 40 |
+
The training data for the 10 languages are from:
|
| 41 |
+
|
| 42 |
+
Language|Dataset
|
| 43 |
+
-|-
|
| 44 |
+
Arabic | [ANERcorp](https://camel.abudhabi.nyu.edu/anercorp/)
|
| 45 |
+
German | [conll 2003](https://www.clips.uantwerpen.be/conll2003/ner/)
|
| 46 |
+
English | [conll 2003](https://www.clips.uantwerpen.be/conll2003/ner/)
|
| 47 |
+
Spanish | [conll 2002](https://www.clips.uantwerpen.be/conll2002/ner/)
|
| 48 |
+
French | [Europeana Newspapers](https://github.com/EuropeanaNewspapers/ner-corpora/tree/master/enp_FR.bnf.bio)
|
| 49 |
+
Italian | [Italian I-CAB](https://ontotext.fbk.eu/icab.html)
|
| 50 |
+
Latvian | [Latvian NER](https://github.com/LUMII-AILab/FullStack/tree/master/NamedEntities)
|
| 51 |
+
Dutch | [conll 2002](https://www.clips.uantwerpen.be/conll2002/ner/)
|
| 52 |
+
Portuguese |[Paramopama + Second Harem](https://github.com/davidsbatista/NER-datasets/tree/master/Portuguese)
|
| 53 |
+
Chinese | [MSRA](https://huggingface.co/datasets/msra_ner)
|
| 54 |
+
|
| 55 |
+
The training dataset distinguishes between the beginning and continuation of an entity so that if there are back-to-back entities of the same type, the model can output where the second entity begins. As in the dataset, each token will be classified as one of the following classes:
|
| 56 |
+
Abbreviation|Description
|
| 57 |
+
-|-
|
| 58 |
+
O|Outside of a named entity
|
| 59 |
+
B-PER |Beginning of a person’s name right after another person’s name
|
| 60 |
+
I-PER |Person’s name
|
| 61 |
+
B-ORG |Beginning of an organisation right after another organisation
|
| 62 |
+
I-ORG |Organisation
|
| 63 |
+
B-LOC |Beginning of a location right after another location
|
| 64 |
+
I-LOC |Location
|
| 65 |
+
## Training procedure
|
| 66 |
+
This model was trained on NVIDIA V100 GPU with recommended hyperparameters from HuggingFace code.
|
config.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "distilbert-base-multilingual-cased",
|
| 3 |
+
"activation": "gelu",
|
| 4 |
+
"architectures": [
|
| 5 |
+
"DistilBertForTokenClassification"
|
| 6 |
+
],
|
| 7 |
+
"attention_dropout": 0.1,
|
| 8 |
+
"dim": 768,
|
| 9 |
+
"dropout": 0.1,
|
| 10 |
+
"hidden_dim": 3072,
|
| 11 |
+
"id2label": {
|
| 12 |
+
"0": "O",
|
| 13 |
+
"1": "B-DATE",
|
| 14 |
+
"2": "I-DATE",
|
| 15 |
+
"3": "B-PER",
|
| 16 |
+
"4": "I-PER",
|
| 17 |
+
"5": "B-ORG",
|
| 18 |
+
"6": "I-ORG",
|
| 19 |
+
"7": "B-LOC",
|
| 20 |
+
"8": "I-LOC"
|
| 21 |
+
},
|
| 22 |
+
"initializer_range": 0.02,
|
| 23 |
+
"label2id": {
|
| 24 |
+
"B-DATE": 1,
|
| 25 |
+
"B-LOC": 7,
|
| 26 |
+
"B-ORG": 5,
|
| 27 |
+
"B-PER": 3,
|
| 28 |
+
"I-DATE": 2,
|
| 29 |
+
"I-LOC": 8,
|
| 30 |
+
"I-ORG": 6,
|
| 31 |
+
"I-PER": 4,
|
| 32 |
+
"O": 0
|
| 33 |
+
},
|
| 34 |
+
"max_position_embeddings": 512,
|
| 35 |
+
"model_type": "distilbert",
|
| 36 |
+
"n_heads": 12,
|
| 37 |
+
"n_layers": 6,
|
| 38 |
+
"output_past": true,
|
| 39 |
+
"pad_token_id": 0,
|
| 40 |
+
"qa_dropout": 0.1,
|
| 41 |
+
"seq_classif_dropout": 0.2,
|
| 42 |
+
"sinusoidal_pos_embds": false,
|
| 43 |
+
"tie_weights_": true,
|
| 44 |
+
"vocab_size": 119547
|
| 45 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c702d2d069b66236f57552155c90b50b0b89a7762190b423ded3910ef953ac29
|
| 3 |
+
size 538976358
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8601b94491416467859aec73fa478d25c745830a718adb140899044bee30edef
|
| 3 |
+
size 539006405
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
|
tf_model.h5
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eec9a0c1aa81fbb142125ddf79636a12bb044471ade872ce6f13156fddc18f4c
|
| 3 |
+
size 539091216
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"do_lower_case": false, "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "tokenize_chinese_chars": true, "strip_accents": null, "model_max_length": 512, "name_or_path": "distilbert-base-multilingual-cased"}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0347b6e82afe1a0e9da4fde1b900cd56d3ada9df24985d95839c4930486cadec
|
| 3 |
+
size 1519
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|