ClovenDoug commited on
Commit
a976c8c
1 Parent(s): f7ef51d

Upload 9 files

Browse files
README.md ADDED
@@ -0,0 +1,228 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ metrics:
10
+ - precision
11
+ - recall
12
+ - f1
13
+ widget:
14
+ - text: 'In the 2017 publication "The Routledge Handbook of Collective Intentionality",
15
+ edited by Kirk Ludwig and Marija Jankovic, and released by Routledge, leading
16
+ scholars explored the complex concept of collective intentionality and its implications
17
+ for various disciplines, including philosophy, cognitive science, and social theory
18
+ . A thought-provoking 2015 article titled "The Uncivilization Thesis: A Critique"
19
+ by Megan Gittins, published in Environmental Ethics, offered a critical examination
20
+ of the controversial "uncivilization thesis" and its implications for our understanding
21
+ of the relationship between civilization and environmental sustainability.'
22
+ - text: In the "The Selfish Gene", renowned biologist Richard Dawkins introduced the
23
+ revolutionary concept of the "selfish gene" in 1976, published by Oxford University
24
+ Press . This influential work challenged traditional views of evolution and sparked
25
+ widespread discussions about the nature of altruism and cooperation . Fans of
26
+ science writing might appreciate "A Short History of Nearly Everything" by Bill
27
+ Bryson, a captivating exploration of the vast realms of scientific knowledge published
28
+ by Broadway Books in 2003.
29
+ - text: '"The Pragmatic Turn" (2020, University of Pennsylvania Press) provides key
30
+ insights into pragmatist philosophy, edited by John J. Stuhr . For provocative
31
+ science, try "Introducing Consciousness", Alex Westrin and Vidyut Lokhande''s
32
+ 2018 work published via Icon Books, challenging dominant models of self-awareness.'
33
+ - text: Have you read "The Selfish Gene" by Richard Dawkins? Published in 1976 by
34
+ Oxford University Press, this seminal work introduced the gene-centric view of
35
+ evolution and proposed the controversial concept of the "extended phenotype ."
36
+ Dawkins' ideas sparked intense debates and influenced diverse fields like evolutionary
37
+ biology, psychology, and memetics . Daniel C. Dennett's "Darwin's Dangerous Idea"
38
+ (1995, Simon & Schuster) is another must-read that explores the far-reaching implications
39
+ of evolutionary theory, from the origins of life to the nature of human consciousness
40
+ and free will.
41
+ - text: '"The Sociology of Philosophies", an insightful book penned by Randall Collins
42
+ and published in 1998 by Harvard University Press, examined the social factors
43
+ that influence the development and trajectory of philosophical thought throughout
44
+ history . Collins'' analysis shed light on how philosophical ideas are shaped
45
+ by the broader cultural, political, and intellectual contexts in which they emerge
46
+ . In a 2012 article from Philosophy of the Social Sciences, titled "The Relevance
47
+ of the Sociology of Philosophy", Isaac Reed further expounded on the importance
48
+ of this interdisciplinary approach, highlighting its potential to deepen our understanding
49
+ of the dynamics that shape human knowledge and inquiry.'
50
+ pipeline_tag: token-classification
51
+ model-index:
52
+ - name: SpanMarker
53
+ results:
54
+ - task:
55
+ type: token-classification
56
+ name: Named Entity Recognition
57
+ dataset:
58
+ name: Unknown
59
+ type: unknown
60
+ split: eval
61
+ metrics:
62
+ - type: f1
63
+ value: 0.0
64
+ name: F1
65
+ - type: precision
66
+ value: 0.0
67
+ name: Precision
68
+ - type: recall
69
+ value: 0.0
70
+ name: Recall
71
+ ---
72
+
73
+ # SpanMarker
74
+
75
+ This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model that can be used for Named Entity Recognition.
76
+
77
+ ## Model Details
78
+
79
+ ### Model Description
80
+ - **Model Type:** SpanMarker
81
+ <!-- - **Encoder:** [Unknown](https://huggingface.co/unknown) -->
82
+ - **Maximum Sequence Length:** 512 tokens
83
+ - **Maximum Entity Length:** 16 words
84
+ <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
85
+ <!-- - **Language:** Unknown -->
86
+ <!-- - **License:** Unknown -->
87
+
88
+ ### Model Sources
89
+
90
+ - **Repository:** [SpanMarker on GitHub](https://github.com/tomaarsen/SpanMarkerNER)
91
+ - **Thesis:** [SpanMarker For Named Entity Recognition](https://raw.githubusercontent.com/tomaarsen/SpanMarkerNER/main/thesis.pdf)
92
+
93
+ ### Model Labels
94
+ | Label | Examples |
95
+ |:-----------------|:----------------------------------------------------------------------------------------------------------------------------------------------|
96
+ | person | "Barney Glaser", "Malcolm Gladwell", "Charles Duhigg" |
97
+ | publication_date | "2000", "1967", "2018" |
98
+ | publisher | "Little , Brown and Company", "Sociology Press", "Avery" |
99
+ | work_of_art | "`` The Tipping Point : How Little Things Can Make a Big Difference ''", "`` The Power of Habit ''", "`` The Discovery of Grounded Theory ''" |
100
+
101
+ ## Evaluation
102
+
103
+ ### Metrics
104
+ | Label | Precision | Recall | F1 |
105
+ |:-----------------|:----------|:-------|:----|
106
+ | **all** | 0.0 | 0.0 | 0.0 |
107
+ | person | 0.0 | 0.0 | 0.0 |
108
+ | publication_date | 0.0 | 0.0 | 0.0 |
109
+ | publisher | 0.0 | 0.0 | 0.0 |
110
+ | work_of_art | 0.0 | 0.0 | 0.0 |
111
+
112
+ ## Uses
113
+
114
+ ### Direct Use for Inference
115
+
116
+ ```python
117
+ from span_marker import SpanMarkerModel
118
+
119
+ # Download from the 🤗 Hub
120
+ model = SpanMarkerModel.from_pretrained("span_marker_model_id")
121
+ # Run inference
122
+ entities = model.predict("\"The Pragmatic Turn\" (2020, University of Pennsylvania Press) provides key insights into pragmatist philosophy, edited by John J. Stuhr . For provocative science, try \"Introducing Consciousness\", Alex Westrin and Vidyut Lokhande's 2018 work published via Icon Books, challenging dominant models of self-awareness.")
123
+ ```
124
+
125
+ ### Downstream Use
126
+ You can finetune this model on your own dataset.
127
+
128
+ <details><summary>Click to expand</summary>
129
+
130
+ ```python
131
+ from span_marker import SpanMarkerModel, Trainer
132
+
133
+ # Download from the 🤗 Hub
134
+ model = SpanMarkerModel.from_pretrained("span_marker_model_id")
135
+
136
+ # Specify a Dataset with "tokens" and "ner_tag" columns
137
+ dataset = load_dataset("conll2003") # For example CoNLL2003
138
+
139
+ # Initialize a Trainer using the pretrained model & dataset
140
+ trainer = Trainer(
141
+ model=model,
142
+ train_dataset=dataset["train"],
143
+ eval_dataset=dataset["validation"],
144
+ )
145
+ trainer.train()
146
+ trainer.save_model("span_marker_model_id-finetuned")
147
+ ```
148
+ </details>
149
+
150
+ <!--
151
+ ### Out-of-Scope Use
152
+
153
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
154
+ -->
155
+
156
+ <!--
157
+ ## Bias, Risks and Limitations
158
+
159
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
160
+ -->
161
+
162
+ <!--
163
+ ### Recommendations
164
+
165
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
166
+ -->
167
+
168
+ ## Training Details
169
+
170
+ ### Training Set Metrics
171
+ | Training set | Min | Median | Max |
172
+ |:----------------------|:----|:---------|:----|
173
+ | Sentence length | 47 | 104.6034 | 200 |
174
+ | Entities per sentence | 3 | 4.0036 | 5 |
175
+
176
+ ### Training Hyperparameters
177
+ - learning_rate: 2e-05
178
+ - train_batch_size: 16
179
+ - eval_batch_size: 16
180
+ - seed: 42
181
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
182
+ - lr_scheduler_type: linear
183
+ - num_epochs: 3
184
+
185
+ ### Training Results
186
+ | Epoch | Step | Validation Loss | Validation Precision | Validation Recall | Validation F1 | Validation Accuracy |
187
+ |:-----:|:----:|:---------------:|:--------------------:|:-----------------:|:-------------:|:-------------------:|
188
+ | 1.0 | 563 | 0.0206 | 0.0 | 0.0 | 0.0 | 0.8513 |
189
+ | 2.0 | 1126 | 0.0173 | 0.0 | 0.0 | 0.0 | 0.8513 |
190
+ | 3.0 | 1689 | 0.0162 | 0.0 | 0.0 | 0.0 | 0.8513 |
191
+
192
+ ### Framework Versions
193
+ - Python: 3.10.13
194
+ - SpanMarker: 1.5.1.dev
195
+ - Transformers: 4.39.3
196
+ - PyTorch: 2.1.2
197
+ - Datasets: 2.16.0
198
+ - Tokenizers: 0.15.0
199
+
200
+ ## Citation
201
+
202
+ ### BibTeX
203
+ ```
204
+ @software{Aarsen_SpanMarker,
205
+ author = {Aarsen, Tom},
206
+ license = {Apache-2.0},
207
+ title = {{SpanMarker for Named Entity Recognition}},
208
+ url = {https://github.com/tomaarsen/SpanMarkerNER}
209
+ }
210
+ ```
211
+
212
+ <!--
213
+ ## Glossary
214
+
215
+ *Clearly define terms in order to be accessible across audiences.*
216
+ -->
217
+
218
+ <!--
219
+ ## Model Card Authors
220
+
221
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
222
+ -->
223
+
224
+ <!--
225
+ ## Model Card Contact
226
+
227
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
228
+ -->
added_tokens.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "<end>": 30523,
3
+ "<start>": 30522
4
+ }
config.json ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "SpanMarkerModel"
4
+ ],
5
+ "encoder": {
6
+ "_name_or_path": "prajjwal1/bert-tiny",
7
+ "add_cross_attention": false,
8
+ "architectures": null,
9
+ "attention_probs_dropout_prob": 0.1,
10
+ "bad_words_ids": null,
11
+ "begin_suppress_tokens": null,
12
+ "bos_token_id": null,
13
+ "chunk_size_feed_forward": 0,
14
+ "classifier_dropout": null,
15
+ "cross_attention_hidden_size": null,
16
+ "decoder_start_token_id": null,
17
+ "diversity_penalty": 0.0,
18
+ "do_sample": false,
19
+ "early_stopping": false,
20
+ "encoder_no_repeat_ngram_size": 0,
21
+ "eos_token_id": null,
22
+ "exponential_decay_length_penalty": null,
23
+ "finetuning_task": null,
24
+ "forced_bos_token_id": null,
25
+ "forced_eos_token_id": null,
26
+ "hidden_act": "gelu",
27
+ "hidden_dropout_prob": 0.1,
28
+ "hidden_size": 128,
29
+ "id2label": {
30
+ "0": "O",
31
+ "1": "B-publication_date",
32
+ "2": "I-publication_date",
33
+ "3": "B-person",
34
+ "4": "I-person",
35
+ "5": "B-work_of_art",
36
+ "6": "I-work_of_art",
37
+ "7": "B-publisher",
38
+ "8": "I-publisher"
39
+ },
40
+ "initializer_range": 0.02,
41
+ "intermediate_size": 512,
42
+ "is_decoder": false,
43
+ "is_encoder_decoder": false,
44
+ "label2id": {
45
+ "B-person": 3,
46
+ "B-publication_date": 1,
47
+ "B-publisher": 7,
48
+ "B-work_of_art": 5,
49
+ "I-person": 4,
50
+ "I-publication_date": 2,
51
+ "I-publisher": 8,
52
+ "I-work_of_art": 6,
53
+ "O": 0
54
+ },
55
+ "layer_norm_eps": 1e-12,
56
+ "length_penalty": 1.0,
57
+ "max_length": 20,
58
+ "max_position_embeddings": 512,
59
+ "min_length": 0,
60
+ "model_type": "bert",
61
+ "no_repeat_ngram_size": 0,
62
+ "num_attention_heads": 2,
63
+ "num_beam_groups": 1,
64
+ "num_beams": 1,
65
+ "num_hidden_layers": 2,
66
+ "num_return_sequences": 1,
67
+ "output_attentions": false,
68
+ "output_hidden_states": false,
69
+ "output_scores": false,
70
+ "pad_token_id": 0,
71
+ "position_embedding_type": "absolute",
72
+ "prefix": null,
73
+ "problem_type": null,
74
+ "pruned_heads": {},
75
+ "remove_invalid_values": false,
76
+ "repetition_penalty": 1.0,
77
+ "return_dict": true,
78
+ "return_dict_in_generate": false,
79
+ "sep_token_id": null,
80
+ "suppress_tokens": null,
81
+ "task_specific_params": null,
82
+ "temperature": 1.0,
83
+ "tf_legacy_loss": false,
84
+ "tie_encoder_decoder": false,
85
+ "tie_word_embeddings": true,
86
+ "tokenizer_class": null,
87
+ "top_k": 50,
88
+ "top_p": 1.0,
89
+ "torch_dtype": null,
90
+ "torchscript": false,
91
+ "transformers_version": "4.39.3",
92
+ "type_vocab_size": 2,
93
+ "typical_p": 1.0,
94
+ "use_bfloat16": false,
95
+ "use_cache": true,
96
+ "vocab_size": 30528
97
+ },
98
+ "entity_max_length": 16,
99
+ "id2label": {
100
+ "0": "O",
101
+ "1": "person",
102
+ "2": "publication_date",
103
+ "3": "publisher",
104
+ "4": "work_of_art"
105
+ },
106
+ "id2reduced_id": {
107
+ "0": 0,
108
+ "1": 2,
109
+ "2": 2,
110
+ "3": 1,
111
+ "4": 1,
112
+ "5": 4,
113
+ "6": 4,
114
+ "7": 3,
115
+ "8": 3
116
+ },
117
+ "label2id": {
118
+ "O": 0,
119
+ "person": 1,
120
+ "publication_date": 2,
121
+ "publisher": 3,
122
+ "work_of_art": 4
123
+ },
124
+ "marker_max_length": 128,
125
+ "max_next_context": null,
126
+ "max_prev_context": null,
127
+ "model_max_length": 512,
128
+ "model_max_length_default": 512,
129
+ "model_type": "span-marker",
130
+ "span_marker_version": "1.5.1.dev",
131
+ "torch_dtype": "float32",
132
+ "trained_with_document_context": false,
133
+ "transformers_version": "4.39.3",
134
+ "vocab_size": 30528
135
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0563f3c1fcfd2b6265a2086521e2ede9124d00512597657a4e38256b5bf1d6f1
3
+ size 17556588
special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": true,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "[PAD]",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "100": {
13
+ "content": "[UNK]",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "101": {
21
+ "content": "[CLS]",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "102": {
29
+ "content": "[SEP]",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "103": {
37
+ "content": "[MASK]",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "30522": {
45
+ "content": "<start>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "30523": {
53
+ "content": "<end>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ }
60
+ },
61
+ "clean_up_tokenization_spaces": true,
62
+ "cls_token": "[CLS]",
63
+ "do_basic_tokenize": true,
64
+ "do_lower_case": true,
65
+ "entity_max_length": 16,
66
+ "marker_max_length": 128,
67
+ "mask_token": "[MASK]",
68
+ "model_max_length": 512,
69
+ "never_split": null,
70
+ "pad_token": "[PAD]",
71
+ "sep_token": "[SEP]",
72
+ "strip_accents": null,
73
+ "tokenize_chinese_chars": true,
74
+ "tokenizer_class": "BertTokenizer",
75
+ "unk_token": "[UNK]"
76
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0f65b5f0ced4bfab93e9dd4c9c08b783de27ffe4bdba0712ee91f763e2c1ee80
3
+ size 4920
vocab.txt ADDED
The diff for this file is too large to render. See raw diff