tomaarsen HF staff commited on
Commit
13f4da1
1 Parent(s): 33071f7

Upload model

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
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 [xlm-roberta-base](https://huggingface.co/xlm-roberta-base) 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 @@
 
 
 
 
 
1
+ {
2
+ "<end>": 250003,
3
+ "<start>": 250002
4
+ }
config.json ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "models/span_marker_xlm_roberta_base_multinerd/checkpoint-final",
3
+ "architectures": [
4
+ "SpanMarkerModel"
5
+ ],
6
+ "encoder": {
7
+ "_name_or_path": "xlm-roberta-base",
8
+ "add_cross_attention": false,
9
+ "architectures": [
10
+ "XLMRobertaForMaskedLM"
11
+ ],
12
+ "attention_probs_dropout_prob": 0.1,
13
+ "bad_words_ids": null,
14
+ "begin_suppress_tokens": null,
15
+ "bos_token_id": 0,
16
+ "chunk_size_feed_forward": 0,
17
+ "classifier_dropout": null,
18
+ "cross_attention_hidden_size": null,
19
+ "decoder_start_token_id": null,
20
+ "diversity_penalty": 0.0,
21
+ "do_sample": false,
22
+ "early_stopping": false,
23
+ "encoder_no_repeat_ngram_size": 0,
24
+ "eos_token_id": 2,
25
+ "exponential_decay_length_penalty": null,
26
+ "finetuning_task": null,
27
+ "forced_bos_token_id": null,
28
+ "forced_eos_token_id": null,
29
+ "hidden_act": "gelu",
30
+ "hidden_dropout_prob": 0.1,
31
+ "hidden_size": 768,
32
+ "id2label": {
33
+ "0": "O",
34
+ "1": "B-PER",
35
+ "2": "I-PER",
36
+ "3": "B-ORG",
37
+ "4": "I-ORG",
38
+ "5": "B-LOC",
39
+ "6": "I-LOC",
40
+ "7": "B-ANIM",
41
+ "8": "I-ANIM",
42
+ "9": "B-BIO",
43
+ "10": "I-BIO",
44
+ "11": "B-CEL",
45
+ "12": "I-CEL",
46
+ "13": "B-DIS",
47
+ "14": "I-DIS",
48
+ "15": "B-EVE",
49
+ "16": "I-EVE",
50
+ "17": "B-FOOD",
51
+ "18": "I-FOOD",
52
+ "19": "B-INST",
53
+ "20": "I-INST",
54
+ "21": "B-MEDIA",
55
+ "22": "I-MEDIA",
56
+ "23": "B-MYTH",
57
+ "24": "I-MYTH",
58
+ "25": "B-PLANT",
59
+ "26": "I-PLANT",
60
+ "27": "B-TIME",
61
+ "28": "I-TIME",
62
+ "29": "B-VEHI",
63
+ "30": "I-VEHI"
64
+ },
65
+ "initializer_range": 0.02,
66
+ "intermediate_size": 3072,
67
+ "is_decoder": false,
68
+ "is_encoder_decoder": false,
69
+ "label2id": {
70
+ "B-ANIM": 7,
71
+ "B-BIO": 9,
72
+ "B-CEL": 11,
73
+ "B-DIS": 13,
74
+ "B-EVE": 15,
75
+ "B-FOOD": 17,
76
+ "B-INST": 19,
77
+ "B-LOC": 5,
78
+ "B-MEDIA": 21,
79
+ "B-MYTH": 23,
80
+ "B-ORG": 3,
81
+ "B-PER": 1,
82
+ "B-PLANT": 25,
83
+ "B-TIME": 27,
84
+ "B-VEHI": 29,
85
+ "I-ANIM": 8,
86
+ "I-BIO": 10,
87
+ "I-CEL": 12,
88
+ "I-DIS": 14,
89
+ "I-EVE": 16,
90
+ "I-FOOD": 18,
91
+ "I-INST": 20,
92
+ "I-LOC": 6,
93
+ "I-MEDIA": 22,
94
+ "I-MYTH": 24,
95
+ "I-ORG": 4,
96
+ "I-PER": 2,
97
+ "I-PLANT": 26,
98
+ "I-TIME": 28,
99
+ "I-VEHI": 30,
100
+ "O": 0
101
+ },
102
+ "layer_norm_eps": 1e-05,
103
+ "length_penalty": 1.0,
104
+ "max_length": 20,
105
+ "max_position_embeddings": 514,
106
+ "min_length": 0,
107
+ "model_type": "xlm-roberta",
108
+ "no_repeat_ngram_size": 0,
109
+ "num_attention_heads": 12,
110
+ "num_beam_groups": 1,
111
+ "num_beams": 1,
112
+ "num_hidden_layers": 12,
113
+ "num_return_sequences": 1,
114
+ "output_attentions": false,
115
+ "output_hidden_states": false,
116
+ "output_past": true,
117
+ "output_scores": false,
118
+ "pad_token_id": 1,
119
+ "position_embedding_type": "absolute",
120
+ "prefix": null,
121
+ "problem_type": null,
122
+ "pruned_heads": {},
123
+ "remove_invalid_values": false,
124
+ "repetition_penalty": 1.0,
125
+ "return_dict": true,
126
+ "return_dict_in_generate": false,
127
+ "sep_token_id": null,
128
+ "suppress_tokens": null,
129
+ "task_specific_params": null,
130
+ "temperature": 1.0,
131
+ "tf_legacy_loss": false,
132
+ "tie_encoder_decoder": false,
133
+ "tie_word_embeddings": true,
134
+ "tokenizer_class": null,
135
+ "top_k": 50,
136
+ "top_p": 1.0,
137
+ "torch_dtype": null,
138
+ "torchscript": false,
139
+ "transformers_version": "4.28.1",
140
+ "type_vocab_size": 1,
141
+ "typical_p": 1.0,
142
+ "use_bfloat16": false,
143
+ "use_cache": true,
144
+ "vocab_size": 250004
145
+ },
146
+ "entity_max_length": 6,
147
+ "id2label": {
148
+ "0": "O",
149
+ "1": "ANIM",
150
+ "2": "BIO",
151
+ "3": "CEL",
152
+ "4": "DIS",
153
+ "5": "EVE",
154
+ "6": "FOOD",
155
+ "7": "INST",
156
+ "8": "LOC",
157
+ "9": "MEDIA",
158
+ "10": "MYTH",
159
+ "11": "ORG",
160
+ "12": "PER",
161
+ "13": "PLANT",
162
+ "14": "TIME",
163
+ "15": "VEHI"
164
+ },
165
+ "id2reduced_id": {
166
+ "0": 0,
167
+ "1": 12,
168
+ "2": 12,
169
+ "3": 11,
170
+ "4": 11,
171
+ "5": 8,
172
+ "6": 8,
173
+ "7": 1,
174
+ "8": 1,
175
+ "9": 2,
176
+ "10": 2,
177
+ "11": 3,
178
+ "12": 3,
179
+ "13": 4,
180
+ "14": 4,
181
+ "15": 5,
182
+ "16": 5,
183
+ "17": 6,
184
+ "18": 6,
185
+ "19": 7,
186
+ "20": 7,
187
+ "21": 9,
188
+ "22": 9,
189
+ "23": 10,
190
+ "24": 10,
191
+ "25": 13,
192
+ "26": 13,
193
+ "27": 14,
194
+ "28": 14,
195
+ "29": 15,
196
+ "30": 15
197
+ },
198
+ "label2id": {
199
+ "ANIM": 1,
200
+ "BIO": 2,
201
+ "CEL": 3,
202
+ "DIS": 4,
203
+ "EVE": 5,
204
+ "FOOD": 6,
205
+ "INST": 7,
206
+ "LOC": 8,
207
+ "MEDIA": 9,
208
+ "MYTH": 10,
209
+ "O": 0,
210
+ "ORG": 11,
211
+ "PER": 12,
212
+ "PLANT": 13,
213
+ "TIME": 14,
214
+ "VEHI": 15
215
+ },
216
+ "marker_max_length": 128,
217
+ "max_next_context": null,
218
+ "max_prev_context": null,
219
+ "model_max_length": 256,
220
+ "model_max_length_default": 512,
221
+ "model_type": "span-marker",
222
+ "span_marker_version": "1.2.5.dev",
223
+ "torch_dtype": "float32",
224
+ "trained_with_document_context": false,
225
+ "transformers_version": "4.28.1",
226
+ "vocab_size": 250004
227
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3ea4133db3f6422e8683665d09ead96727287130eacbf5b2772130a40988a67
3
+ size 1112349685
sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
+ size 5069051
special_tokens_map.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "cls_token": "<s>",
4
+ "eos_token": "</s>",
5
+ "mask_token": {
6
+ "content": "<mask>",
7
+ "lstrip": true,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "pad_token": "<pad>",
13
+ "sep_token": "</s>",
14
+ "unk_token": "<unk>"
15
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7becf84dcb8c923f94254aff98d6e2f21190c901a95f5f4ec1059aa70a1215d0
3
+ size 17083026
tokenizer_config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": true,
3
+ "bos_token": "<s>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "cls_token": "<s>",
6
+ "eos_token": "</s>",
7
+ "mask_token": {
8
+ "__type": "AddedToken",
9
+ "content": "<mask>",
10
+ "lstrip": true,
11
+ "normalized": true,
12
+ "rstrip": false,
13
+ "single_word": false
14
+ },
15
+ "model_max_length": 512,
16
+ "pad_token": "<pad>",
17
+ "sep_token": "</s>",
18
+ "tokenizer_class": "XLMRobertaTokenizer",
19
+ "unk_token": "<unk>"
20
+ }