eek commited on
Commit
1ce6954
1 Parent(s): c10d271

Training complete

Browse files
README.md ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: span-marker
3
+ tags:
4
+ - span-marker
5
+ - token-classification
6
+ - ner
7
+ - named-entity-recognition
8
+ - generated_from_span_marker_trainer
9
+ datasets:
10
+ - DFKI-SLT/few-nerd
11
+ metrics:
12
+ - precision
13
+ - recall
14
+ - f1
15
+ widget: []
16
+ pipeline_tag: token-classification
17
+ ---
18
+
19
+ # SpanMarker
20
+
21
+ This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model trained on the [DFKI-SLT/few-nerd](https://huggingface.co/datasets/DFKI-SLT/few-nerd) dataset that can be used for Named Entity Recognition.
22
+
23
+ ## Model Details
24
+
25
+ ### Model Description
26
+ - **Model Type:** SpanMarker
27
+ <!-- - **Encoder:** [Unknown](https://huggingface.co/unknown) -->
28
+ - **Maximum Sequence Length:** 256 tokens
29
+ - **Maximum Entity Length:** 6 words
30
+ - **Training Dataset:** [DFKI-SLT/few-nerd](https://huggingface.co/datasets/DFKI-SLT/few-nerd)
31
+ <!-- - **Language:** Unknown -->
32
+ <!-- - **License:** Unknown -->
33
+
34
+ ### Model Sources
35
+
36
+ - **Repository:** [SpanMarker on GitHub](https://github.com/tomaarsen/SpanMarkerNER)
37
+ - **Thesis:** [SpanMarker For Named Entity Recognition](https://raw.githubusercontent.com/tomaarsen/SpanMarkerNER/main/thesis.pdf)
38
+
39
+ ## Uses
40
+
41
+ ### Direct Use for Inference
42
+
43
+ ```python
44
+ from span_marker import SpanMarkerModel
45
+
46
+ # Download from the 🤗 Hub
47
+ model = SpanMarkerModel.from_pretrained("span_marker_model_id")
48
+ # Run inference
49
+ entities = model.predict("None")
50
+ ```
51
+
52
+ ### Downstream Use
53
+ You can finetune this model on your own dataset.
54
+
55
+ <details><summary>Click to expand</summary>
56
+
57
+ ```python
58
+ from span_marker import SpanMarkerModel, Trainer
59
+
60
+ # Download from the 🤗 Hub
61
+ model = SpanMarkerModel.from_pretrained("span_marker_model_id")
62
+
63
+ # Specify a Dataset with "tokens" and "ner_tag" columns
64
+ dataset = load_dataset("conll2003") # For example CoNLL2003
65
+
66
+ # Initialize a Trainer using the pretrained model & dataset
67
+ trainer = Trainer(
68
+ model=model,
69
+ train_dataset=dataset["train"],
70
+ eval_dataset=dataset["validation"],
71
+ )
72
+ trainer.train()
73
+ trainer.save_model("span_marker_model_id-finetuned")
74
+ ```
75
+ </details>
76
+
77
+ <!--
78
+ ### Out-of-Scope Use
79
+
80
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
81
+ -->
82
+
83
+ <!--
84
+ ## Bias, Risks and Limitations
85
+
86
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
87
+ -->
88
+
89
+ <!--
90
+ ### Recommendations
91
+
92
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
93
+ -->
94
+
95
+ ## Training Details
96
+
97
+ ### Framework Versions
98
+ - Python: 3.10.13
99
+ - SpanMarker: 1.5.0
100
+ - Transformers: 4.36.2
101
+ - PyTorch: 2.2.1+cu121
102
+ - Datasets: 2.18.0
103
+ - Tokenizers: 0.15.2
104
+
105
+ ## Citation
106
+
107
+ ### BibTeX
108
+ ```
109
+ @software{Aarsen_SpanMarker,
110
+ author = {Aarsen, Tom},
111
+ license = {Apache-2.0},
112
+ title = {{SpanMarker for Named Entity Recognition}},
113
+ url = {https://github.com/tomaarsen/SpanMarkerNER}
114
+ }
115
+ ```
116
+
117
+ <!--
118
+ ## Glossary
119
+
120
+ *Clearly define terms in order to be accessible across audiences.*
121
+ -->
122
+
123
+ <!--
124
+ ## Model Card Authors
125
+
126
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
127
+ -->
128
+
129
+ <!--
130
+ ## Model Card Contact
131
+
132
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
133
+ -->
added_tokens.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "<end>": 50266,
3
+ "<start>": 50265
4
+ }
config.json ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/shared/jupyter/summary/ner/models/span-marker-muppet-roberta-large-fewnerd-fine-super/checkpoint-25000",
3
+ "architectures": [
4
+ "SpanMarkerModel"
5
+ ],
6
+ "encoder": {
7
+ "_name_or_path": "facebook/muppet-roberta-large",
8
+ "add_cross_attention": false,
9
+ "architectures": [
10
+ "RobertaForMaskedLM"
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": 1024,
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": 4096,
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": "roberta",
180
+ "no_repeat_ngram_size": 0,
181
+ "num_attention_heads": 16,
182
+ "num_beam_groups": 1,
183
+ "num_beams": 1,
184
+ "num_hidden_layers": 24,
185
+ "num_return_sequences": 1,
186
+ "output_attentions": false,
187
+ "output_hidden_states": false,
188
+ "output_scores": false,
189
+ "pad_token_id": 1,
190
+ "position_embedding_type": "absolute",
191
+ "prefix": null,
192
+ "problem_type": null,
193
+ "pruned_heads": {},
194
+ "remove_invalid_values": false,
195
+ "repetition_penalty": 1.0,
196
+ "return_dict": true,
197
+ "return_dict_in_generate": false,
198
+ "sep_token_id": null,
199
+ "suppress_tokens": null,
200
+ "task_specific_params": null,
201
+ "temperature": 1.0,
202
+ "tf_legacy_loss": false,
203
+ "tie_encoder_decoder": false,
204
+ "tie_word_embeddings": true,
205
+ "tokenizer_class": null,
206
+ "top_k": 50,
207
+ "top_p": 1.0,
208
+ "torch_dtype": null,
209
+ "torchscript": false,
210
+ "transformers_version": "4.36.2",
211
+ "type_vocab_size": 1,
212
+ "typical_p": 1.0,
213
+ "use_bfloat16": false,
214
+ "use_cache": true,
215
+ "vocab_size": 50272
216
+ },
217
+ "entity_max_length": 6,
218
+ "marker_max_length": 128,
219
+ "max_next_context": null,
220
+ "max_prev_context": null,
221
+ "model_max_length": 256,
222
+ "model_max_length_default": 512,
223
+ "model_type": "span-marker",
224
+ "span_marker_version": "1.5.0",
225
+ "torch_dtype": "float32",
226
+ "trained_with_document_context": false,
227
+ "transformers_version": "4.36.2",
228
+ "vocab_size": 50272
229
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6649a259223ddbdb733c23a32a8f7363a45db8a380d11979a1f97415420a7fd7
3
+ size 1422065004
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
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": true,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<s>",
6
+ "lstrip": false,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<pad>",
14
+ "lstrip": false,
15
+ "normalized": true,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "</s>",
22
+ "lstrip": false,
23
+ "normalized": true,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "<unk>",
30
+ "lstrip": false,
31
+ "normalized": true,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "50264": {
37
+ "content": "<mask>",
38
+ "lstrip": true,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "50265": {
45
+ "content": "<start>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "50266": {
53
+ "content": "<end>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ }
60
+ },
61
+ "bos_token": "<s>",
62
+ "clean_up_tokenization_spaces": true,
63
+ "cls_token": "<s>",
64
+ "eos_token": "</s>",
65
+ "errors": "replace",
66
+ "mask_token": "<mask>",
67
+ "model_max_length": 1000000000000000019884624838656,
68
+ "pad_token": "<pad>",
69
+ "sep_token": "</s>",
70
+ "tokenizer_class": "RobertaTokenizer",
71
+ "trim_offsets": true,
72
+ "unk_token": "<unk>"
73
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9af1cef335c2800228ad41dd533f4c30ebcf059efe2fdb05da2361cc81b68f30
3
+ size 4728
vocab.json ADDED
The diff for this file is too large to render. See raw diff