tomaarsen HF staff commited on
Commit
625c198
1 Parent(s): 3418b64

Upload model

Browse files
.gitattributes CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ 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,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "models\\span_marker_xlm_roberta_base_fewnerd_fine_super_2\\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": "art-broadcastprogram",
35
+ "2": "art-film",
36
+ "3": "art-music",
37
+ "4": "art-other",
38
+ "5": "art-painting",
39
+ "6": "art-writtenart",
40
+ "7": "building-airport",
41
+ "8": "building-hospital",
42
+ "9": "building-hotel",
43
+ "10": "building-library",
44
+ "11": "building-other",
45
+ "12": "building-restaurant",
46
+ "13": "building-sportsfacility",
47
+ "14": "building-theater",
48
+ "15": "event-attack/battle/war/militaryconflict",
49
+ "16": "event-disaster",
50
+ "17": "event-election",
51
+ "18": "event-other",
52
+ "19": "event-protest",
53
+ "20": "event-sportsevent",
54
+ "21": "location-GPE",
55
+ "22": "location-bodiesofwater",
56
+ "23": "location-island",
57
+ "24": "location-mountain",
58
+ "25": "location-other",
59
+ "26": "location-park",
60
+ "27": "location-road/railway/highway/transit",
61
+ "28": "organization-company",
62
+ "29": "organization-education",
63
+ "30": "organization-government/governmentagency",
64
+ "31": "organization-media/newspaper",
65
+ "32": "organization-other",
66
+ "33": "organization-politicalparty",
67
+ "34": "organization-religion",
68
+ "35": "organization-showorganization",
69
+ "36": "organization-sportsleague",
70
+ "37": "organization-sportsteam",
71
+ "38": "other-astronomything",
72
+ "39": "other-award",
73
+ "40": "other-biologything",
74
+ "41": "other-chemicalthing",
75
+ "42": "other-currency",
76
+ "43": "other-disease",
77
+ "44": "other-educationaldegree",
78
+ "45": "other-god",
79
+ "46": "other-language",
80
+ "47": "other-law",
81
+ "48": "other-livingthing",
82
+ "49": "other-medical",
83
+ "50": "person-actor",
84
+ "51": "person-artist/author",
85
+ "52": "person-athlete",
86
+ "53": "person-director",
87
+ "54": "person-other",
88
+ "55": "person-politician",
89
+ "56": "person-scholar",
90
+ "57": "person-soldier",
91
+ "58": "product-airplane",
92
+ "59": "product-car",
93
+ "60": "product-food",
94
+ "61": "product-game",
95
+ "62": "product-other",
96
+ "63": "product-ship",
97
+ "64": "product-software",
98
+ "65": "product-train",
99
+ "66": "product-weapon"
100
+ },
101
+ "initializer_range": 0.02,
102
+ "intermediate_size": 3072,
103
+ "is_decoder": false,
104
+ "is_encoder_decoder": false,
105
+ "label2id": {
106
+ "O": 0,
107
+ "art-broadcastprogram": 1,
108
+ "art-film": 2,
109
+ "art-music": 3,
110
+ "art-other": 4,
111
+ "art-painting": 5,
112
+ "art-writtenart": 6,
113
+ "building-airport": 7,
114
+ "building-hospital": 8,
115
+ "building-hotel": 9,
116
+ "building-library": 10,
117
+ "building-other": 11,
118
+ "building-restaurant": 12,
119
+ "building-sportsfacility": 13,
120
+ "building-theater": 14,
121
+ "event-attack/battle/war/militaryconflict": 15,
122
+ "event-disaster": 16,
123
+ "event-election": 17,
124
+ "event-other": 18,
125
+ "event-protest": 19,
126
+ "event-sportsevent": 20,
127
+ "location-GPE": 21,
128
+ "location-bodiesofwater": 22,
129
+ "location-island": 23,
130
+ "location-mountain": 24,
131
+ "location-other": 25,
132
+ "location-park": 26,
133
+ "location-road/railway/highway/transit": 27,
134
+ "organization-company": 28,
135
+ "organization-education": 29,
136
+ "organization-government/governmentagency": 30,
137
+ "organization-media/newspaper": 31,
138
+ "organization-other": 32,
139
+ "organization-politicalparty": 33,
140
+ "organization-religion": 34,
141
+ "organization-showorganization": 35,
142
+ "organization-sportsleague": 36,
143
+ "organization-sportsteam": 37,
144
+ "other-astronomything": 38,
145
+ "other-award": 39,
146
+ "other-biologything": 40,
147
+ "other-chemicalthing": 41,
148
+ "other-currency": 42,
149
+ "other-disease": 43,
150
+ "other-educationaldegree": 44,
151
+ "other-god": 45,
152
+ "other-language": 46,
153
+ "other-law": 47,
154
+ "other-livingthing": 48,
155
+ "other-medical": 49,
156
+ "person-actor": 50,
157
+ "person-artist/author": 51,
158
+ "person-athlete": 52,
159
+ "person-director": 53,
160
+ "person-other": 54,
161
+ "person-politician": 55,
162
+ "person-scholar": 56,
163
+ "person-soldier": 57,
164
+ "product-airplane": 58,
165
+ "product-car": 59,
166
+ "product-food": 60,
167
+ "product-game": 61,
168
+ "product-other": 62,
169
+ "product-ship": 63,
170
+ "product-software": 64,
171
+ "product-train": 65,
172
+ "product-weapon": 66
173
+ },
174
+ "layer_norm_eps": 1e-05,
175
+ "length_penalty": 1.0,
176
+ "max_length": 20,
177
+ "max_position_embeddings": 514,
178
+ "min_length": 0,
179
+ "model_type": "xlm-roberta",
180
+ "no_repeat_ngram_size": 0,
181
+ "num_attention_heads": 12,
182
+ "num_beam_groups": 1,
183
+ "num_beams": 1,
184
+ "num_hidden_layers": 12,
185
+ "num_return_sequences": 1,
186
+ "output_attentions": false,
187
+ "output_hidden_states": false,
188
+ "output_past": true,
189
+ "output_scores": false,
190
+ "pad_token_id": 1,
191
+ "position_embedding_type": "absolute",
192
+ "prefix": null,
193
+ "problem_type": null,
194
+ "pruned_heads": {},
195
+ "remove_invalid_values": false,
196
+ "repetition_penalty": 1.0,
197
+ "return_dict": true,
198
+ "return_dict_in_generate": false,
199
+ "sep_token_id": null,
200
+ "suppress_tokens": null,
201
+ "task_specific_params": null,
202
+ "temperature": 1.0,
203
+ "tf_legacy_loss": false,
204
+ "tie_encoder_decoder": false,
205
+ "tie_word_embeddings": true,
206
+ "tokenizer_class": null,
207
+ "top_k": 50,
208
+ "top_p": 1.0,
209
+ "torch_dtype": null,
210
+ "torchscript": false,
211
+ "transformers_version": "4.28.1",
212
+ "type_vocab_size": 1,
213
+ "typical_p": 1.0,
214
+ "use_bfloat16": false,
215
+ "use_cache": true,
216
+ "vocab_size": 250004
217
+ },
218
+ "entity_max_length": 8,
219
+ "marker_max_length": 128,
220
+ "max_next_context": null,
221
+ "max_prev_context": null,
222
+ "model_max_length": 256,
223
+ "model_max_length_default": 512,
224
+ "model_type": "span-marker",
225
+ "span_marker_version": "1.1.2.dev",
226
+ "torch_dtype": "float32",
227
+ "trained_with_document_context": false,
228
+ "transformers_version": "4.28.1",
229
+ "vocab_size": 250004
230
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:60fe4f5f65948af6c809d5da6a3337475d071a4ea4320f7cd3843b1bf0989d1a
3
+ size 1112663221
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
+ }