zhang19991111 commited on
Commit
6947173
·
verified ·
1 Parent(s): 579ee7f

Upload 10 files

Browse files
README.md CHANGED
@@ -1,35 +1,215 @@
1
- epoch:10
2
-
3
- Data:
4
- f1:0.6752577319587628
5
- number:189
6
- precision:0.6582914572864321
7
- recall:0.6931216931216931
8
-
9
- Material:
10
- f1:0.8099999999999999
11
- number:201
12
- precision:0.8140703517587939
13
- recall:0.8059701492537313
14
-
15
- Method:
16
- f1:0.5263157894736842
17
- number:20
18
- precision:0.5555555555555556
19
- recall:0.5
20
-
21
- Process:
22
- f1:0.6736842105263158
23
- number:205
24
- precision:0.7314285714285714
25
- recall:0.624390243902439
26
-
27
-
28
- test_loss:0.08379081636667252
29
- test_overall_accuracy:0.8418897637795275
30
- test_overall_f1:0.7147595356550579
31
- test_overall_precision:0.7292724196277496
32
- test_overall_recall:0.7008130081300813
33
- test_runtime:4.8228
34
- test_samples_per_second:31.931
35
- test_steps_per_second:4.147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: cc-by-sa-4.0
4
+ library_name: span-marker
5
+ tags:
6
+ - span-marker
7
+ - token-classification
8
+ - ner
9
+ - named-entity-recognition
10
+ - generated_from_span_marker_trainer
11
+ metrics:
12
+ - precision
13
+ - recall
14
+ - f1
15
+ widget:
16
+ - text: Inductively Coupled Plasma - Mass Spectrometry ( ICP - MS ) analysis of Longcliffe
17
+ SP52 limestone was undertaken to identify other impurities present , and the effect
18
+ of sorbent mass and SO2 concentration on elemental partitioning in the carbonator
19
+ between solid sorbent and gaseous phase was investigated , using a bubbler sampling
20
+ system .
21
+ - text: We extensively evaluate our work against benchmark and competitive protocols
22
+ across a range of metrics over three real connectivity and GPS traces such as
23
+ Sassy [ 44 ] , San Francisco Cabs [ 45 ] and Infocom 2006 [ 33 ] .
24
+ - text: In this research , we developed a robust two - layer classifier that can accurately
25
+ classify normal hearing ( NH ) from hearing impaired ( HI ) infants with congenital
26
+ sensori - neural hearing loss ( SNHL ) based on their Magnetic Resonance ( MR
27
+ ) images .
28
+ - text: In situ Peak Force Tapping AFM was employed for determining morphology and
29
+ nano - mechanical properties of the surface layer .
30
+ - text: By means of a criterion of Gilmer for polynomially dense subsets of the ring
31
+ of integers of a number field , we show that , if h∈K[X ] maps every element of
32
+ OK of degree n to an algebraic integer , then h(X ) is integral - valued over
33
+ OK , that is , h(OK)⊂OK .
34
+ pipeline_tag: token-classification
35
+ base_model: roberta-large
36
+ model-index:
37
+ - name: SpanMarker with roberta-large on my-data
38
+ results:
39
+ - task:
40
+ type: token-classification
41
+ name: Named Entity Recognition
42
+ dataset:
43
+ name: my-data
44
+ type: unknown
45
+ split: test
46
+ metrics:
47
+ - type: f1
48
+ value: 0.7147595356550579
49
+ name: F1
50
+ - type: precision
51
+ value: 0.7292724196277496
52
+ name: Precision
53
+ - type: recall
54
+ value: 0.7008130081300813
55
+ name: Recall
56
+ ---
57
+
58
+ # SpanMarker with roberta-large on my-data
59
+
60
+ This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model that can be used for Named Entity Recognition. This SpanMarker model uses [roberta-large](https://huggingface.co/roberta-large) as the underlying encoder.
61
+
62
+ ## Model Details
63
+
64
+ ### Model Description
65
+ - **Model Type:** SpanMarker
66
+ - **Encoder:** [roberta-large](https://huggingface.co/roberta-large)
67
+ - **Maximum Sequence Length:** 256 tokens
68
+ - **Maximum Entity Length:** 8 words
69
+ <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
70
+ - **Language:** en
71
+ - **License:** cc-by-sa-4.0
72
+
73
+ ### Model Sources
74
+
75
+ - **Repository:** [SpanMarker on GitHub](https://github.com/tomaarsen/SpanMarkerNER)
76
+ - **Thesis:** [SpanMarker For Named Entity Recognition](https://raw.githubusercontent.com/tomaarsen/SpanMarkerNER/main/thesis.pdf)
77
+
78
+ ### Model Labels
79
+ | Label | Examples |
80
+ |:---------|:--------------------------------------------------------------------------------------------------------|
81
+ | Data | "Depth time - series", "an overall mitochondrial", "defect" |
82
+ | Material | "cross - shore measurement locations", "the subject 's fibroblasts", "COXI , COXII and COXIII subunits" |
83
+ | Method | "an approximation", "in vitro", "EFSA" |
84
+ | Process | "intake", "translation", "a significant reduction of synthesis" |
85
+
86
+ ## Evaluation
87
+
88
+ ### Metrics
89
+ | Label | Precision | Recall | F1 |
90
+ |:---------|:----------|:-------|:-------|
91
+ | **all** | 0.7293 | 0.7008 | 0.7148 |
92
+ | Data | 0.6583 | 0.6931 | 0.6753 |
93
+ | Material | 0.8141 | 0.8060 | 0.8100 |
94
+ | Method | 0.5556 | 0.5 | 0.5263 |
95
+ | Process | 0.7314 | 0.6244 | 0.6737 |
96
+
97
+ ## Uses
98
+
99
+ ### Direct Use for Inference
100
+
101
+ ```python
102
+ from span_marker import SpanMarkerModel
103
+
104
+ # Download from the 🤗 Hub
105
+ model = SpanMarkerModel.from_pretrained("span_marker_model_id")
106
+ # Run inference
107
+ entities = model.predict("In situ Peak Force Tapping AFM was employed for determining morphology and nano - mechanical properties of the surface layer .")
108
+ ```
109
+
110
+ ### Downstream Use
111
+ You can finetune this model on your own dataset.
112
+
113
+ <details><summary>Click to expand</summary>
114
+
115
+ ```python
116
+ from span_marker import SpanMarkerModel, Trainer
117
+
118
+ # Download from the 🤗 Hub
119
+ model = SpanMarkerModel.from_pretrained("span_marker_model_id")
120
+
121
+ # Specify a Dataset with "tokens" and "ner_tag" columns
122
+ dataset = load_dataset("conll2003") # For example CoNLL2003
123
+
124
+ # Initialize a Trainer using the pretrained model & dataset
125
+ trainer = Trainer(
126
+ model=model,
127
+ train_dataset=dataset["train"],
128
+ eval_dataset=dataset["validation"],
129
+ )
130
+ trainer.train()
131
+ trainer.save_model("span_marker_model_id-finetuned")
132
+ ```
133
+ </details>
134
+
135
+ <!--
136
+ ### Out-of-Scope Use
137
+
138
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
139
+ -->
140
+
141
+ <!--
142
+ ## Bias, Risks and Limitations
143
+
144
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
145
+ -->
146
+
147
+ <!--
148
+ ### Recommendations
149
+
150
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
151
+ -->
152
+
153
+ ## Training Details
154
+
155
+ ### Training Set Metrics
156
+ | Training set | Min | Median | Max |
157
+ |:----------------------|:----|:--------|:----|
158
+ | Sentence length | 3 | 25.6049 | 106 |
159
+ | Entities per sentence | 0 | 5.2439 | 22 |
160
+
161
+ ### Training Hyperparameters
162
+ - learning_rate: 5e-05
163
+ - train_batch_size: 8
164
+ - eval_batch_size: 8
165
+ - seed: 42
166
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
167
+ - lr_scheduler_type: linear
168
+ - lr_scheduler_warmup_ratio: 0.1
169
+ - num_epochs: 10
170
+
171
+ ### Training Results
172
+ | Epoch | Step | Validation Loss | Validation Precision | Validation Recall | Validation F1 | Validation Accuracy |
173
+ |:------:|:----:|:---------------:|:--------------------:|:-----------------:|:-------------:|:-------------------:|
174
+ | 2.0134 | 300 | 0.0544 | 0.6819 | 0.6260 | 0.6527 | 0.8016 |
175
+ | 4.0268 | 600 | 0.0525 | 0.7217 | 0.7176 | 0.7196 | 0.8387 |
176
+ | 6.0403 | 900 | 0.0688 | 0.7652 | 0.7214 | 0.7426 | 0.8459 |
177
+ | 8.0537 | 1200 | 0.0703 | 0.7636 | 0.7214 | 0.7419 | 0.8349 |
178
+
179
+ ### Framework Versions
180
+ - Python: 3.10.12
181
+ - SpanMarker: 1.5.0
182
+ - Transformers: 4.36.2
183
+ - PyTorch: 2.0.1+cu118
184
+ - Datasets: 2.16.1
185
+ - Tokenizers: 0.15.0
186
+
187
+ ## Citation
188
+
189
+ ### BibTeX
190
+ ```
191
+ @software{Aarsen_SpanMarker,
192
+ author = {Aarsen, Tom},
193
+ license = {Apache-2.0},
194
+ title = {{SpanMarker for Named Entity Recognition}},
195
+ url = {https://github.com/tomaarsen/SpanMarkerNER}
196
+ }
197
+ ```
198
+
199
+ <!--
200
+ ## Glossary
201
+
202
+ *Clearly define terms in order to be accessible across audiences.*
203
+ -->
204
+
205
+ <!--
206
+ ## Model Card Authors
207
+
208
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
209
+ -->
210
+
211
+ <!--
212
+ ## Model Card Contact
213
+
214
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
215
+ -->
added_tokens.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "<end>": 50266,
3
+ "<start>": 50265
4
+ }
config.json ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": "O",
33
+ "1": "Data",
34
+ "2": "Material",
35
+ "3": "Method",
36
+ "4": "Process"
37
+ },
38
+ "initializer_range": 0.02,
39
+ "intermediate_size": 4096,
40
+ "is_decoder": false,
41
+ "is_encoder_decoder": false,
42
+ "label2id": {
43
+ "Data": 1,
44
+ "Material": 2,
45
+ "Method": 3,
46
+ "O": 0,
47
+ "Process": 4
48
+ },
49
+ "layer_norm_eps": 1e-05,
50
+ "length_penalty": 1.0,
51
+ "max_length": 20,
52
+ "max_position_embeddings": 514,
53
+ "min_length": 0,
54
+ "model_type": "roberta",
55
+ "no_repeat_ngram_size": 0,
56
+ "num_attention_heads": 16,
57
+ "num_beam_groups": 1,
58
+ "num_beams": 1,
59
+ "num_hidden_layers": 24,
60
+ "num_return_sequences": 1,
61
+ "output_attentions": false,
62
+ "output_hidden_states": false,
63
+ "output_scores": false,
64
+ "pad_token_id": 1,
65
+ "position_embedding_type": "absolute",
66
+ "prefix": null,
67
+ "problem_type": null,
68
+ "pruned_heads": {},
69
+ "remove_invalid_values": false,
70
+ "repetition_penalty": 1.0,
71
+ "return_dict": true,
72
+ "return_dict_in_generate": false,
73
+ "sep_token_id": null,
74
+ "suppress_tokens": null,
75
+ "task_specific_params": null,
76
+ "temperature": 1.0,
77
+ "tf_legacy_loss": false,
78
+ "tie_encoder_decoder": false,
79
+ "tie_word_embeddings": true,
80
+ "tokenizer_class": null,
81
+ "top_k": 50,
82
+ "top_p": 1.0,
83
+ "torch_dtype": null,
84
+ "torchscript": false,
85
+ "transformers_version": "4.36.2",
86
+ "type_vocab_size": 1,
87
+ "typical_p": 1.0,
88
+ "use_bfloat16": false,
89
+ "use_cache": true,
90
+ "vocab_size": 50272
91
+ },
92
+ "entity_max_length": 8,
93
+ "marker_max_length": 128,
94
+ "max_next_context": null,
95
+ "max_prev_context": null,
96
+ "model_max_length": 256,
97
+ "model_max_length_default": 512,
98
+ "model_type": "span-marker",
99
+ "span_marker_version": "1.5.0",
100
+ "torch_dtype": "float32",
101
+ "trained_with_document_context": false,
102
+ "transformers_version": "4.36.2",
103
+ "vocab_size": 50272
104
+ }
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:aa6a2e7009ac682bff296202cb976535883805fe4e3a97c6eab291de442c8c8a
3
+ size 1421556844
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,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": 8,
65
+ "eos_token": "</s>",
66
+ "errors": "replace",
67
+ "marker_max_length": 128,
68
+ "mask_token": "<mask>",
69
+ "model_max_length": 256,
70
+ "pad_token": "<pad>",
71
+ "sep_token": "</s>",
72
+ "tokenizer_class": "RobertaTokenizer",
73
+ "trim_offsets": true,
74
+ "unk_token": "<unk>"
75
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6d9882a435fdaca45c8e4162655ccdec4a7cddae09c6e00b5bef3d968d8ab0e
3
+ size 4283
vocab.json ADDED
The diff for this file is too large to render. See raw diff