Davlan commited on
Commit
be310e7
1 Parent(s): b3c80bb

add ner-her data

Browse files
README.md ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Hugging Face's logo
2
+ ---
3
+ language:
4
+ - ar
5
+ - de
6
+ - en
7
+ - es
8
+ - fr
9
+ - it
10
+ - lv
11
+ - nl
12
+ - pt
13
+ - zh
14
+ - multilingual
15
+
16
+ ---
17
+ # distilbert-base-multilingual-cased-ner-hrl
18
+ ## Model description
19
+ **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).
20
+ Specifically, this model is a *distilbert-base-multilingual-cased* model that was fine-tuned on an aggregation of 10 high-resourced languages
21
+ ## Intended uses & limitations
22
+ #### How to use
23
+ You can use this model with Transformers *pipeline* for NER.
24
+ ```python
25
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
26
+ from transformers import pipeline
27
+ tokenizer = AutoTokenizer.from_pretrained("Davlan/distilbert-base-multilingual-cased-ner-hrl")
28
+ model = AutoModelForTokenClassification.from_pretrained("Davlan/distilbert-base-multilingual-cased-ner-hrl")
29
+ nlp = pipeline("ner", model=model, tokenizer=tokenizer)
30
+ example = "Nader Jokhadar had given Syria the lead with a well-struck header in the seventh minute."
31
+ ner_results = nlp(example)
32
+ print(ner_results)
33
+ ```
34
+ #### Limitations and bias
35
+ 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.
36
+ ## Training data
37
+ The training data for the 10 languages are from:
38
+
39
+ Arabic: [ANERcorp](https://github.com/EmnamoR/Arabic-named-entity-recognition)
40
+ German: [conll 2003](https://www.clips.uantwerpen.be/conll2003/ner/)
41
+ English: [conll 2003](https://www.clips.uantwerpen.be/conll2003/ner/)
42
+ Spanish: [conll 2002](https://www.clips.uantwerpen.be/conll2002/ner/)
43
+ French: [Europeana Newspapers](https://github.com/EuropeanaNewspapers/ner-corpora/tree/master/enp_FR.bnf.bio)
44
+ Italian: []()
45
+ Latvian: [Latvian NER](https://github.com/LUMII-AILab/FullStack/tree/master/NamedEntities)
46
+ Dutch: [conll 2002](https://www.clips.uantwerpen.be/conll2002/ner/)
47
+ Portuguese: [Paramopama + Second Harem](https://github.com/davidsbatista/NER-datasets/tree/master/Portuguese)
48
+ Chinese: [MSRA](https://huggingface.co/datasets/msra_ner)
49
+
50
+ 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:
51
+ Abbreviation|Description
52
+ -|-
53
+ O|Outside of a named entity
54
+ B-PER |Beginning of a person’s name right after another person’s name
55
+ I-PER |Person’s name
56
+ B-ORG |Beginning of an organisation right after another organisation
57
+ I-ORG |Organisation
58
+ B-LOC |Beginning of a location right after another location
59
+ I-LOC |Location
60
+ ## Training procedure
61
+ This model was trained on NVIDIA V100 GPU with recommended hyperparameters from HuggingFace code.
62
+
63
+
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
+ }
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]"}
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