Jerado commited on
Commit
9180731
1 Parent(s): de009a8

End of training

Browse files
README.md ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ library_name: span-marker
6
+ tags:
7
+ - span-marker
8
+ - token-classification
9
+ - ner
10
+ - named-entity-recognition
11
+ - generated_from_span_marker_trainer
12
+ base_model: roberta-large
13
+ datasets:
14
+ - Jerado/enron_intangibles_ner
15
+ metrics:
16
+ - precision
17
+ - recall
18
+ - f1
19
+ widget:
20
+ - text: Negotiated rates in these types of deals (basis for new builds) have been
21
+ allowed to stand for the life of the contracts, in the case of Kern River and
22
+ Mojave.
23
+ - text: It seems that there is a single significant policy concern for the ASIC policy
24
+ committee.
25
+ - text: 'The appropriate price is in Enpower, but the revenue has never appeared (Deal
26
+ #590753).'
27
+ - text: FYI, to me, a prepayment for a service contract would generally be amortized
28
+ over the life of the contract.
29
+ - text: 'From: d..steffes @ enron.com To: john.shelk @ enron.com, l..nicolay @ enron.com,
30
+ richard.shapiro @ enron.com, sarah.novosel @ enron.com Subject: Southern Co.''s
31
+ Testimony The first order of business is getting the cost / benefit analysis done.'
32
+ pipeline_tag: token-classification
33
+ model-index:
34
+ - name: SpanMarker with roberta-large on Jerado/enron_intangibles_ner
35
+ results:
36
+ - task:
37
+ type: token-classification
38
+ name: Named Entity Recognition
39
+ dataset:
40
+ name: Unknown
41
+ type: Jerado/enron_intangibles_ner
42
+ split: test
43
+ metrics:
44
+ - type: f1
45
+ value: 0.4390243902439024
46
+ name: F1
47
+ - type: precision
48
+ value: 0.42857142857142855
49
+ name: Precision
50
+ - type: recall
51
+ value: 0.45
52
+ name: Recall
53
+ ---
54
+
55
+ # SpanMarker with roberta-large on Jerado/enron_intangibles_ner
56
+
57
+ This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model trained on the [Jerado/enron_intangibles_ner](https://huggingface.co/datasets/Jerado/enron_intangibles_ner) dataset that can be used for Named Entity Recognition. This SpanMarker model uses [roberta-large](https://huggingface.co/roberta-large) as the underlying encoder.
58
+
59
+ ## Model Details
60
+
61
+ ### Model Description
62
+ - **Model Type:** SpanMarker
63
+ - **Encoder:** [roberta-large](https://huggingface.co/roberta-large)
64
+ - **Maximum Sequence Length:** 256 tokens
65
+ - **Maximum Entity Length:** 6 words
66
+ - **Training Dataset:** [Jerado/enron_intangibles_ner](https://huggingface.co/datasets/Jerado/enron_intangibles_ner)
67
+ - **Language:** en
68
+ - **License:** apache-2.0
69
+
70
+ ### Model Sources
71
+
72
+ - **Repository:** [SpanMarker on GitHub](https://github.com/tomaarsen/SpanMarkerNER)
73
+ - **Thesis:** [SpanMarker For Named Entity Recognition](https://raw.githubusercontent.com/tomaarsen/SpanMarkerNER/main/thesis.pdf)
74
+
75
+ ### Model Labels
76
+ | Label | Examples |
77
+ |:-----------|:--------------------------------------------|
78
+ | Intangible | "deal", "sample EES deal", "Enpower system" |
79
+
80
+ ## Evaluation
81
+
82
+ ### Metrics
83
+ | Label | Precision | Recall | F1 |
84
+ |:-----------|:----------|:-------|:-------|
85
+ | **all** | 0.4286 | 0.45 | 0.4390 |
86
+ | Intangible | 0.4286 | 0.45 | 0.4390 |
87
+
88
+ ## Uses
89
+
90
+ ### Direct Use for Inference
91
+
92
+ ```python
93
+ from span_marker import SpanMarkerModel
94
+
95
+ # Download from the 🤗 Hub
96
+ model = SpanMarkerModel.from_pretrained("span_marker_model_id")
97
+ # Run inference
98
+ entities = model.predict("It seems that there is a single significant policy concern for the ASIC policy committee.")
99
+ ```
100
+
101
+ ### Downstream Use
102
+ You can finetune this model on your own dataset.
103
+
104
+ <details><summary>Click to expand</summary>
105
+
106
+ ```python
107
+ from span_marker import SpanMarkerModel, Trainer
108
+
109
+ # Download from the 🤗 Hub
110
+ model = SpanMarkerModel.from_pretrained("span_marker_model_id")
111
+
112
+ # Specify a Dataset with "tokens" and "ner_tag" columns
113
+ dataset = load_dataset("conll2003") # For example CoNLL2003
114
+
115
+ # Initialize a Trainer using the pretrained model & dataset
116
+ trainer = Trainer(
117
+ model=model,
118
+ train_dataset=dataset["train"],
119
+ eval_dataset=dataset["validation"],
120
+ )
121
+ trainer.train()
122
+ trainer.save_model("span_marker_model_id-finetuned")
123
+ ```
124
+ </details>
125
+
126
+ <!--
127
+ ### Out-of-Scope Use
128
+
129
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
130
+ -->
131
+
132
+ <!--
133
+ ## Bias, Risks and Limitations
134
+
135
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
136
+ -->
137
+
138
+ <!--
139
+ ### Recommendations
140
+
141
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
142
+ -->
143
+
144
+ ## Training Details
145
+
146
+ ### Training Set Metrics
147
+ | Training set | Min | Median | Max |
148
+ |:----------------------|:----|:--------|:----|
149
+ | Sentence length | 1 | 19.8706 | 216 |
150
+ | Entities per sentence | 0 | 0.1865 | 6 |
151
+
152
+ ### Training Hyperparameters
153
+ - learning_rate: 1e-05
154
+ - train_batch_size: 4
155
+ - eval_batch_size: 4
156
+ - seed: 42
157
+ - gradient_accumulation_steps: 2
158
+ - total_train_batch_size: 8
159
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
160
+ - lr_scheduler_type: linear
161
+ - lr_scheduler_warmup_ratio: 0.1
162
+ - num_epochs: 11
163
+ - mixed_precision_training: Native AMP
164
+
165
+ ### Training Results
166
+ | Epoch | Step | Validation Loss | Validation Precision | Validation Recall | Validation F1 | Validation Accuracy |
167
+ |:-------:|:----:|:---------------:|:--------------------:|:-----------------:|:-------------:|:-------------------:|
168
+ | 3.3557 | 500 | 0.0075 | 0.4444 | 0.1667 | 0.2424 | 0.9753 |
169
+ | 6.7114 | 1000 | 0.0084 | 0.5714 | 0.3333 | 0.4211 | 0.9793 |
170
+ | 10.0671 | 1500 | 0.0098 | 0.6111 | 0.4583 | 0.5238 | 0.9815 |
171
+
172
+ ### Framework Versions
173
+ - Python: 3.10.12
174
+ - SpanMarker: 1.5.0
175
+ - Transformers: 4.40.0
176
+ - PyTorch: 2.2.1+cu121
177
+ - Datasets: 2.19.0
178
+ - Tokenizers: 0.19.1
179
+
180
+ ## Citation
181
+
182
+ ### BibTeX
183
+ ```
184
+ @software{Aarsen_SpanMarker,
185
+ author = {Aarsen, Tom},
186
+ license = {Apache-2.0},
187
+ title = {{SpanMarker for Named Entity Recognition}},
188
+ url = {https://github.com/tomaarsen/SpanMarkerNER}
189
+ }
190
+ ```
191
+
192
+ <!--
193
+ ## Glossary
194
+
195
+ *Clearly define terms in order to be accessible across audiences.*
196
+ -->
197
+
198
+ <!--
199
+ ## Model Card Authors
200
+
201
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
202
+ -->
203
+
204
+ <!--
205
+ ## Model Card Contact
206
+
207
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
208
+ -->
added_tokens.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "<end>": 50266,
3
+ "<start>": 50265
4
+ }
config.json ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "SpanMarkerModel"
4
+ ],
5
+ "encoder": {
6
+ "_name_or_path": "roberta-large",
7
+ "add_cross_attention": false,
8
+ "architectures": [
9
+ "RobertaForMaskedLM"
10
+ ],
11
+ "attention_probs_dropout_prob": 0.1,
12
+ "bad_words_ids": null,
13
+ "begin_suppress_tokens": null,
14
+ "bos_token_id": 0,
15
+ "chunk_size_feed_forward": 0,
16
+ "classifier_dropout": null,
17
+ "cross_attention_hidden_size": null,
18
+ "decoder_start_token_id": null,
19
+ "diversity_penalty": 0.0,
20
+ "do_sample": false,
21
+ "early_stopping": false,
22
+ "encoder_no_repeat_ngram_size": 0,
23
+ "eos_token_id": 2,
24
+ "exponential_decay_length_penalty": null,
25
+ "finetuning_task": null,
26
+ "forced_bos_token_id": null,
27
+ "forced_eos_token_id": null,
28
+ "hidden_act": "gelu",
29
+ "hidden_dropout_prob": 0.1,
30
+ "hidden_size": 1024,
31
+ "id2label": {
32
+ "0": "B-Intangible",
33
+ "1": "I-Intangible",
34
+ "2": "O"
35
+ },
36
+ "initializer_range": 0.02,
37
+ "intermediate_size": 4096,
38
+ "is_decoder": false,
39
+ "is_encoder_decoder": false,
40
+ "label2id": {
41
+ "B-Intangible": 0,
42
+ "I-Intangible": 1,
43
+ "O": 2
44
+ },
45
+ "layer_norm_eps": 1e-05,
46
+ "length_penalty": 1.0,
47
+ "max_length": 20,
48
+ "max_position_embeddings": 514,
49
+ "min_length": 0,
50
+ "model_type": "roberta",
51
+ "no_repeat_ngram_size": 0,
52
+ "num_attention_heads": 16,
53
+ "num_beam_groups": 1,
54
+ "num_beams": 1,
55
+ "num_hidden_layers": 24,
56
+ "num_return_sequences": 1,
57
+ "output_attentions": false,
58
+ "output_hidden_states": false,
59
+ "output_scores": false,
60
+ "pad_token_id": 1,
61
+ "position_embedding_type": "absolute",
62
+ "prefix": null,
63
+ "problem_type": null,
64
+ "pruned_heads": {},
65
+ "remove_invalid_values": false,
66
+ "repetition_penalty": 1.0,
67
+ "return_dict": true,
68
+ "return_dict_in_generate": false,
69
+ "sep_token_id": null,
70
+ "suppress_tokens": null,
71
+ "task_specific_params": null,
72
+ "temperature": 1.0,
73
+ "tf_legacy_loss": false,
74
+ "tie_encoder_decoder": false,
75
+ "tie_word_embeddings": true,
76
+ "tokenizer_class": null,
77
+ "top_k": 50,
78
+ "top_p": 1.0,
79
+ "torch_dtype": null,
80
+ "torchscript": false,
81
+ "transformers_version": "4.40.0",
82
+ "type_vocab_size": 1,
83
+ "typical_p": 1.0,
84
+ "use_bfloat16": false,
85
+ "use_cache": true,
86
+ "vocab_size": 50272
87
+ },
88
+ "entity_max_length": 6,
89
+ "id2label": {
90
+ "0": "O",
91
+ "1": "Intangible"
92
+ },
93
+ "id2reduced_id": {
94
+ "0": 1,
95
+ "1": 1,
96
+ "2": 0
97
+ },
98
+ "label2id": {
99
+ "Intangible": 1,
100
+ "O": 0
101
+ },
102
+ "marker_max_length": 128,
103
+ "max_next_context": null,
104
+ "max_prev_context": null,
105
+ "model_max_length": 256,
106
+ "model_max_length_default": 512,
107
+ "model_type": "span-marker",
108
+ "span_marker_version": "1.5.0",
109
+ "torch_dtype": "float32",
110
+ "trained_with_document_context": false,
111
+ "transformers_version": "4.40.0",
112
+ "vocab_size": 50272
113
+ }
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:26861c858ea0a649dead7163c9abc5c1f0da3b93c92e0aa20f3d35dbf004a85a
3
+ size 1421532256
runs/Apr29_23-00-38_99379f0e9fb2/events.out.tfevents.1714431653.99379f0e9fb2.912.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64f620457fa835e76b7c219d8d4666e47dd4df7ba87a1e6711e6d9f339effd6b
3
+ size 7071
runs/Apr29_23-00-38_99379f0e9fb2/events.out.tfevents.1714431807.99379f0e9fb2.912.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:59f507881a52305e96647b8fe44eb6c0841caefcaaab0ec63561541665157969
3
+ size 6864
runs/Apr29_23-00-38_99379f0e9fb2/events.out.tfevents.1714431835.99379f0e9fb2.912.2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ce80a5b5422448c9466e10ba886aa70de1286bb0114d1a5dc01495eba44f9aa
3
+ size 15474
runs/Apr29_23-00-38_99379f0e9fb2/events.out.tfevents.1714433596.99379f0e9fb2.912.3 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e635d9a00af28b54a841f787f22b9f0d103a4c9b867faeced12311f872e8f412
3
+ size 1096
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,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "entity_max_length": 6,
65
+ "eos_token": "</s>",
66
+ "errors": "replace",
67
+ "mask_token": "<mask>",
68
+ "model_max_length": 256,
69
+ "pad_token": "<pad>",
70
+ "sep_token": "</s>",
71
+ "tokenizer_class": "RobertaTokenizer",
72
+ "trim_offsets": true,
73
+ "unk_token": "<unk>"
74
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:28c95918ef10d534a1d4f14672d00631c5f2c8a5267d9ddfc2b05582819efca7
3
+ size 4984
vocab.json ADDED
The diff for this file is too large to render. See raw diff