Upload model
Browse files- README.md +36 -0
- added_tokens.json +4 -0
- config.json +232 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +14 -0
- vocab.txt +0 -0
README.md
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
license: apache-2.0
|
4 |
+
library_name: span-marker
|
5 |
+
tags:
|
6 |
+
- span-marker
|
7 |
+
- token-classification
|
8 |
+
- ner
|
9 |
+
- named-entity-recognition
|
10 |
+
pipeline_tag: token-classification
|
11 |
+
---
|
12 |
+
|
13 |
+
# SpanMarker for Named Entity Recognition
|
14 |
+
|
15 |
+
This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model that can be used for Named Entity Recognition. In particular, this SpanMarker model uses [bert-base-multilingual-cased](https://huggingface.co/bert-base-multilingual-cased) as the underlying encoder.
|
16 |
+
|
17 |
+
## Usage
|
18 |
+
|
19 |
+
To use this model for inference, first install the `span_marker` library:
|
20 |
+
|
21 |
+
```bash
|
22 |
+
pip install span_marker
|
23 |
+
```
|
24 |
+
|
25 |
+
You can then run inference with this model like so:
|
26 |
+
|
27 |
+
```python
|
28 |
+
from span_marker import SpanMarkerModel
|
29 |
+
|
30 |
+
# Download from the 🤗 Hub
|
31 |
+
model = SpanMarkerModel.from_pretrained("span_marker_model_name")
|
32 |
+
# Run inference
|
33 |
+
entities = model.predict("Amelia Earhart flew her single engine Lockheed Vega 5B across the Atlantic to Paris.")
|
34 |
+
```
|
35 |
+
|
36 |
+
See the [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) repository for documentation and additional information on this library.
|
added_tokens.json
ADDED
@@ -0,0 +1,4 @@
|
|
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|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "models\\span_marker_mbert_base_multinerd\\checkpoint-final",
|
3 |
+
"architectures": [
|
4 |
+
"SpanMarkerModel"
|
5 |
+
],
|
6 |
+
"encoder": {
|
7 |
+
"_name_or_path": "bert-base-multilingual-cased",
|
8 |
+
"add_cross_attention": false,
|
9 |
+
"architectures": [
|
10 |
+
"BertForMaskedLM"
|
11 |
+
],
|
12 |
+
"attention_probs_dropout_prob": 0.1,
|
13 |
+
"bad_words_ids": null,
|
14 |
+
"begin_suppress_tokens": null,
|
15 |
+
"bos_token_id": null,
|
16 |
+
"chunk_size_feed_forward": 0,
|
17 |
+
"classifier_dropout": null,
|
18 |
+
"cross_attention_hidden_size": null,
|
19 |
+
"decoder_start_token_id": null,
|
20 |
+
"directionality": "bidi",
|
21 |
+
"diversity_penalty": 0.0,
|
22 |
+
"do_sample": false,
|
23 |
+
"early_stopping": false,
|
24 |
+
"encoder_no_repeat_ngram_size": 0,
|
25 |
+
"eos_token_id": null,
|
26 |
+
"exponential_decay_length_penalty": null,
|
27 |
+
"finetuning_task": null,
|
28 |
+
"forced_bos_token_id": null,
|
29 |
+
"forced_eos_token_id": null,
|
30 |
+
"hidden_act": "gelu",
|
31 |
+
"hidden_dropout_prob": 0.1,
|
32 |
+
"hidden_size": 768,
|
33 |
+
"id2label": {
|
34 |
+
"0": "O",
|
35 |
+
"1": "B-PER",
|
36 |
+
"2": "I-PER",
|
37 |
+
"3": "B-ORG",
|
38 |
+
"4": "I-ORG",
|
39 |
+
"5": "B-LOC",
|
40 |
+
"6": "I-LOC",
|
41 |
+
"7": "B-ANIM",
|
42 |
+
"8": "I-ANIM",
|
43 |
+
"9": "B-BIO",
|
44 |
+
"10": "I-BIO",
|
45 |
+
"11": "B-CEL",
|
46 |
+
"12": "I-CEL",
|
47 |
+
"13": "B-DIS",
|
48 |
+
"14": "I-DIS",
|
49 |
+
"15": "B-EVE",
|
50 |
+
"16": "I-EVE",
|
51 |
+
"17": "B-FOOD",
|
52 |
+
"18": "I-FOOD",
|
53 |
+
"19": "B-INST",
|
54 |
+
"20": "I-INST",
|
55 |
+
"21": "B-MEDIA",
|
56 |
+
"22": "I-MEDIA",
|
57 |
+
"23": "B-MYTH",
|
58 |
+
"24": "I-MYTH",
|
59 |
+
"25": "B-PLANT",
|
60 |
+
"26": "I-PLANT",
|
61 |
+
"27": "B-TIME",
|
62 |
+
"28": "I-TIME",
|
63 |
+
"29": "B-VEHI",
|
64 |
+
"30": "I-VEHI"
|
65 |
+
},
|
66 |
+
"initializer_range": 0.02,
|
67 |
+
"intermediate_size": 3072,
|
68 |
+
"is_decoder": false,
|
69 |
+
"is_encoder_decoder": false,
|
70 |
+
"label2id": {
|
71 |
+
"B-ANIM": 7,
|
72 |
+
"B-BIO": 9,
|
73 |
+
"B-CEL": 11,
|
74 |
+
"B-DIS": 13,
|
75 |
+
"B-EVE": 15,
|
76 |
+
"B-FOOD": 17,
|
77 |
+
"B-INST": 19,
|
78 |
+
"B-LOC": 5,
|
79 |
+
"B-MEDIA": 21,
|
80 |
+
"B-MYTH": 23,
|
81 |
+
"B-ORG": 3,
|
82 |
+
"B-PER": 1,
|
83 |
+
"B-PLANT": 25,
|
84 |
+
"B-TIME": 27,
|
85 |
+
"B-VEHI": 29,
|
86 |
+
"I-ANIM": 8,
|
87 |
+
"I-BIO": 10,
|
88 |
+
"I-CEL": 12,
|
89 |
+
"I-DIS": 14,
|
90 |
+
"I-EVE": 16,
|
91 |
+
"I-FOOD": 18,
|
92 |
+
"I-INST": 20,
|
93 |
+
"I-LOC": 6,
|
94 |
+
"I-MEDIA": 22,
|
95 |
+
"I-MYTH": 24,
|
96 |
+
"I-ORG": 4,
|
97 |
+
"I-PER": 2,
|
98 |
+
"I-PLANT": 26,
|
99 |
+
"I-TIME": 28,
|
100 |
+
"I-VEHI": 30,
|
101 |
+
"O": 0
|
102 |
+
},
|
103 |
+
"layer_norm_eps": 1e-12,
|
104 |
+
"length_penalty": 1.0,
|
105 |
+
"max_length": 20,
|
106 |
+
"max_position_embeddings": 512,
|
107 |
+
"min_length": 0,
|
108 |
+
"model_type": "bert",
|
109 |
+
"no_repeat_ngram_size": 0,
|
110 |
+
"num_attention_heads": 12,
|
111 |
+
"num_beam_groups": 1,
|
112 |
+
"num_beams": 1,
|
113 |
+
"num_hidden_layers": 12,
|
114 |
+
"num_return_sequences": 1,
|
115 |
+
"output_attentions": false,
|
116 |
+
"output_hidden_states": false,
|
117 |
+
"output_scores": false,
|
118 |
+
"pad_token_id": 0,
|
119 |
+
"pooler_fc_size": 768,
|
120 |
+
"pooler_num_attention_heads": 12,
|
121 |
+
"pooler_num_fc_layers": 3,
|
122 |
+
"pooler_size_per_head": 128,
|
123 |
+
"pooler_type": "first_token_transform",
|
124 |
+
"position_embedding_type": "absolute",
|
125 |
+
"prefix": null,
|
126 |
+
"problem_type": null,
|
127 |
+
"pruned_heads": {},
|
128 |
+
"remove_invalid_values": false,
|
129 |
+
"repetition_penalty": 1.0,
|
130 |
+
"return_dict": true,
|
131 |
+
"return_dict_in_generate": false,
|
132 |
+
"sep_token_id": null,
|
133 |
+
"suppress_tokens": null,
|
134 |
+
"task_specific_params": null,
|
135 |
+
"temperature": 1.0,
|
136 |
+
"tf_legacy_loss": false,
|
137 |
+
"tie_encoder_decoder": false,
|
138 |
+
"tie_word_embeddings": true,
|
139 |
+
"tokenizer_class": null,
|
140 |
+
"top_k": 50,
|
141 |
+
"top_p": 1.0,
|
142 |
+
"torch_dtype": null,
|
143 |
+
"torchscript": false,
|
144 |
+
"transformers_version": "4.28.1",
|
145 |
+
"type_vocab_size": 2,
|
146 |
+
"typical_p": 1.0,
|
147 |
+
"use_bfloat16": false,
|
148 |
+
"use_cache": true,
|
149 |
+
"vocab_size": 119549
|
150 |
+
},
|
151 |
+
"entity_max_length": 8,
|
152 |
+
"id2label": {
|
153 |
+
"0": "O",
|
154 |
+
"1": "ANIM",
|
155 |
+
"2": "BIO",
|
156 |
+
"3": "CEL",
|
157 |
+
"4": "DIS",
|
158 |
+
"5": "EVE",
|
159 |
+
"6": "FOOD",
|
160 |
+
"7": "INST",
|
161 |
+
"8": "LOC",
|
162 |
+
"9": "MEDIA",
|
163 |
+
"10": "MYTH",
|
164 |
+
"11": "ORG",
|
165 |
+
"12": "PER",
|
166 |
+
"13": "PLANT",
|
167 |
+
"14": "TIME",
|
168 |
+
"15": "VEHI"
|
169 |
+
},
|
170 |
+
"id2reduced_id": {
|
171 |
+
"0": 0,
|
172 |
+
"1": 12,
|
173 |
+
"2": 12,
|
174 |
+
"3": 11,
|
175 |
+
"4": 11,
|
176 |
+
"5": 8,
|
177 |
+
"6": 8,
|
178 |
+
"7": 1,
|
179 |
+
"8": 1,
|
180 |
+
"9": 2,
|
181 |
+
"10": 2,
|
182 |
+
"11": 3,
|
183 |
+
"12": 3,
|
184 |
+
"13": 4,
|
185 |
+
"14": 4,
|
186 |
+
"15": 5,
|
187 |
+
"16": 5,
|
188 |
+
"17": 6,
|
189 |
+
"18": 6,
|
190 |
+
"19": 7,
|
191 |
+
"20": 7,
|
192 |
+
"21": 9,
|
193 |
+
"22": 9,
|
194 |
+
"23": 10,
|
195 |
+
"24": 10,
|
196 |
+
"25": 13,
|
197 |
+
"26": 13,
|
198 |
+
"27": 14,
|
199 |
+
"28": 14,
|
200 |
+
"29": 15,
|
201 |
+
"30": 15
|
202 |
+
},
|
203 |
+
"label2id": {
|
204 |
+
"ANIM": 1,
|
205 |
+
"BIO": 2,
|
206 |
+
"CEL": 3,
|
207 |
+
"DIS": 4,
|
208 |
+
"EVE": 5,
|
209 |
+
"FOOD": 6,
|
210 |
+
"INST": 7,
|
211 |
+
"LOC": 8,
|
212 |
+
"MEDIA": 9,
|
213 |
+
"MYTH": 10,
|
214 |
+
"O": 0,
|
215 |
+
"ORG": 11,
|
216 |
+
"PER": 12,
|
217 |
+
"PLANT": 13,
|
218 |
+
"TIME": 14,
|
219 |
+
"VEHI": 15
|
220 |
+
},
|
221 |
+
"marker_max_length": 128,
|
222 |
+
"max_next_context": null,
|
223 |
+
"max_prev_context": null,
|
224 |
+
"model_max_length": 256,
|
225 |
+
"model_max_length_default": 512,
|
226 |
+
"model_type": "span-marker",
|
227 |
+
"span_marker_version": "1.2.5.dev",
|
228 |
+
"torch_dtype": "float32",
|
229 |
+
"trained_with_document_context": false,
|
230 |
+
"transformers_version": "4.28.1",
|
231 |
+
"vocab_size": 119549
|
232 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c6f68a5f8e39005e62dbfeeabf29f9ac5b66b6e6cabc599c85e191f83d2cb27e
|
3 |
+
size 711588853
|
special_tokens_map.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"mask_token": "[MASK]",
|
4 |
+
"pad_token": "[PAD]",
|
5 |
+
"sep_token": "[SEP]",
|
6 |
+
"unk_token": "[UNK]"
|
7 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_prefix_space": true,
|
3 |
+
"clean_up_tokenization_spaces": true,
|
4 |
+
"cls_token": "[CLS]",
|
5 |
+
"do_lower_case": false,
|
6 |
+
"mask_token": "[MASK]",
|
7 |
+
"model_max_length": 512,
|
8 |
+
"pad_token": "[PAD]",
|
9 |
+
"sep_token": "[SEP]",
|
10 |
+
"strip_accents": null,
|
11 |
+
"tokenize_chinese_chars": true,
|
12 |
+
"tokenizer_class": "BertTokenizer",
|
13 |
+
"unk_token": "[UNK]"
|
14 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|