Upload model
Browse files- README.md +106 -99
- config.json +8 -8
- pytorch_model.bin +2 -2
README.md
CHANGED
@@ -1,126 +1,133 @@
|
|
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 |
-
|
11 |
-
widget:
|
12 |
-
- text: "here, da = direct assessment, rr = relative ranking, ds = discrete scale and cs = continuous scale."
|
13 |
-
example_title: "Uncased 1"
|
14 |
-
- text: "modifying or replacing the erasable programmable read only memory (eprom) in a phone would allow the configuration of any esn and min via software for cellular devices."
|
15 |
-
example_title: "Uncased 2"
|
16 |
-
- text: "we propose a technique called aggressive stochastic weight averaging (aswa) and an extension called norm-filtered aggressive stochastic weight averaging (naswa) which improves te stability of models over random seeds."
|
17 |
-
example_title: "Uncased 3"
|
18 |
-
- text: "the choice of the encoder and decoder modules of dnpg can be quite flexible, for instance long-short term memory networks (lstm) or convolutional neural network (cnn)."
|
19 |
-
example_title: "Uncased 4"
|
20 |
-
model-index:
|
21 |
-
- name: SpanMarker w. bert-base-uncased on Acronym Identification by Tom Aarsen
|
22 |
-
results:
|
23 |
-
- task:
|
24 |
-
type: token-classification
|
25 |
-
name: Named Entity Recognition
|
26 |
-
dataset:
|
27 |
-
type: acronym_identification
|
28 |
-
name: Acronym Identification
|
29 |
-
split: validation
|
30 |
-
revision: c3c245a18bbd57b1682b099e14460eebf154cbdf
|
31 |
-
metrics:
|
32 |
-
- type: f1
|
33 |
-
value: 0.9198
|
34 |
-
name: F1
|
35 |
-
- type: precision
|
36 |
-
value: 0.9252
|
37 |
-
name: Precision
|
38 |
-
- type: recall
|
39 |
-
value: 0.9145
|
40 |
-
name: Recall
|
41 |
-
datasets:
|
42 |
-
- acronym_identification
|
43 |
-
language:
|
44 |
-
- en
|
45 |
metrics:
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
49 |
---
|
50 |
|
51 |
-
# SpanMarker
|
|
|
|
|
52 |
|
53 |
-
|
54 |
|
55 |
-
|
56 |
-
[tomaarsen/span-marker-bert-base-acronyms](https://huggingface.co/tomaarsen/span-marker-bert-base-acronyms).
|
57 |
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
-
|
61 |
-
- Overall Precision: 0.9252
|
62 |
-
- Overall Recall: 0.9145
|
63 |
-
- Overall F1: 0.9198
|
64 |
-
- Overall Accuracy: 0.9797
|
65 |
|
66 |
-
|
|
|
67 |
|
68 |
-
|
69 |
-
|-----------|--------------|
|
70 |
-
| SHORT | "nlp", "coqa", "soda", "sca" |
|
71 |
-
| LONG | "natural language processing", "conversational question answering", "symposium on discrete algorithms", "successive convex approximation" |
|
72 |
|
73 |
-
|
74 |
|
75 |
-
|
|
|
76 |
|
77 |
-
|
78 |
-
|
|
|
|
|
79 |
```
|
80 |
|
81 |
-
|
|
|
|
|
|
|
82 |
|
83 |
```python
|
84 |
-
from span_marker import SpanMarkerModel
|
85 |
|
86 |
# Download from the 🤗 Hub
|
87 |
-
model = SpanMarkerModel.from_pretrained("
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
-
|
93 |
-
|
94 |
-
## Training procedure
|
95 |
-
|
96 |
-
### Training hyperparameters
|
97 |
-
|
98 |
-
The following hyperparameters were used during training:
|
99 |
-
- learning_rate: 5e-05
|
100 |
-
- train_batch_size: 32
|
101 |
-
- eval_batch_size: 32
|
102 |
-
- seed: 42
|
103 |
-
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
104 |
-
- lr_scheduler_type: linear
|
105 |
-
- lr_scheduler_warmup_ratio: 0.1
|
106 |
-
- num_epochs: 2
|
107 |
-
|
108 |
-
### Training results
|
109 |
-
|
110 |
-
| Training Loss | Epoch | Step | Validation Loss | Overall Precision | Overall Recall | Overall F1 | Overall Accuracy |
|
111 |
-
|:-------------:|:-----:|:----:|:---------------:|:-----------------:|:--------------:|:----------:|:----------------:|
|
112 |
-
| 0.013 | 0.31 | 200 | 0.0101 | 0.8998 | 0.8514 | 0.8749 | 0.9696 |
|
113 |
-
| 0.0088 | 0.62 | 400 | 0.0082 | 0.8997 | 0.9142 | 0.9069 | 0.9764 |
|
114 |
-
| 0.0082 | 0.94 | 600 | 0.0071 | 0.9173 | 0.8955 | 0.9063 | 0.9765 |
|
115 |
-
| 0.0063 | 1.25 | 800 | 0.0066 | 0.9210 | 0.9187 | 0.9198 | 0.9802 |
|
116 |
-
| 0.0066 | 1.56 | 1000 | 0.0066 | 0.9302 | 0.8941 | 0.9118 | 0.9783 |
|
117 |
-
| 0.0064 | 1.87 | 1200 | 0.0063 | 0.9304 | 0.9042 | 0.9171 | 0.9792 |
|
118 |
-
| 0.0063 | 2.00 | 1290 | 0.0063 | 0.9252 | 0.9145 | 0.9198 | 0.9797 |
|
119 |
-
|
120 |
-
### Framework versions
|
121 |
-
|
122 |
-
- SpanMarker 1.2.4
|
123 |
-
- Transformers 4.31.0
|
124 |
-
- Pytorch 1.13.1+cu117
|
125 |
-
- Datasets 2.14.3
|
126 |
-
- Tokenizers 0.13.2
|
|
|
|
|
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 |
+
pipeline_tag: token-classification
|
15 |
---
|
16 |
|
17 |
+
# SpanMarker
|
18 |
+
|
19 |
+
This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model that can be used for Named Entity Recognition.
|
20 |
|
21 |
+
## Model Details
|
22 |
|
23 |
+
### Model Description
|
|
|
24 |
|
25 |
+
- **Model Type:** SpanMarker
|
26 |
+
<!-- - **Encoder:** [Unknown](https://huggingface.co/unknown) -->
|
27 |
+
- **Maximum Sequence Length:** 256 tokens
|
28 |
+
- **Maximum Entity Length:** 8 words
|
29 |
+
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
|
30 |
+
<!-- - **Language:** Unknown -->
|
31 |
+
<!-- - **License:** Unknown -->
|
32 |
|
33 |
+
### Model Sources
|
|
|
|
|
|
|
|
|
34 |
|
35 |
+
- **Repository:** [SpanMarker on GitHub](https://github.com/tomaarsen/SpanMarkerNER)
|
36 |
+
- **Thesis:** [SpanMarker For Named Entity Recognition](https://raw.githubusercontent.com/tomaarsen/SpanMarkerNER/main/thesis.pdf)
|
37 |
|
38 |
+
## Uses
|
|
|
|
|
|
|
39 |
|
40 |
+
### Direct Use for Inference
|
41 |
|
42 |
+
```python
|
43 |
+
from span_marker import SpanMarkerModel
|
44 |
|
45 |
+
# Download from the 🤗 Hub
|
46 |
+
model = SpanMarkerModel.from_pretrained("span_marker_model_id")
|
47 |
+
# Run inference
|
48 |
+
entities = model.predict("Amelia Earhart flew her single engine Lockheed Vega 5B across the Atlantic to Paris.")
|
49 |
```
|
50 |
|
51 |
+
### Downstream Use
|
52 |
+
You can finetune this model on your own dataset.
|
53 |
+
|
54 |
+
<details><summary>Click to expand</summary>
|
55 |
|
56 |
```python
|
57 |
+
from span_marker import SpanMarkerModel, Trainer
|
58 |
|
59 |
# Download from the 🤗 Hub
|
60 |
+
model = SpanMarkerModel.from_pretrained("span_marker_model_id")
|
61 |
+
|
62 |
+
# Specify a Dataset with "tokens" and "ner_tag" columns
|
63 |
+
dataset = load_dataset("conll2003") # For example CoNLL2003
|
64 |
+
|
65 |
+
# Initialize a Trainer using the pretrained model & dataset
|
66 |
+
trainer = Trainer(
|
67 |
+
model=model,
|
68 |
+
train_dataset=dataset["train"],
|
69 |
+
eval_dataset=dataset["validation"],
|
70 |
+
)
|
71 |
+
trainer.train()
|
72 |
+
trainer.save_model("span_marker_model_id-finetuned")
|
73 |
```
|
74 |
+
</details>
|
75 |
+
|
76 |
+
<!--
|
77 |
+
### Out-of-Scope Use
|
78 |
+
|
79 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
80 |
+
-->
|
81 |
+
|
82 |
+
<!--
|
83 |
+
## Bias, Risks and Limitations
|
84 |
+
|
85 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
86 |
+
-->
|
87 |
+
|
88 |
+
<!--
|
89 |
+
### Recommendations
|
90 |
+
|
91 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
92 |
+
-->
|
93 |
+
|
94 |
+
## Training Details
|
95 |
+
|
96 |
+
### Framework Versions
|
97 |
+
|
98 |
+
- Python: 3.9.16
|
99 |
+
- SpanMarker: 1.3.1.dev
|
100 |
+
- Transformers: 4.30.0
|
101 |
+
- PyTorch: 2.0.1+cu118
|
102 |
+
- Datasets: 2.14.0
|
103 |
+
- Tokenizers: 0.13.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 |
+
-->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "models\\
|
3 |
"architectures": [
|
4 |
"SpanMarkerModel"
|
5 |
],
|
@@ -84,7 +84,7 @@
|
|
84 |
"top_p": 1.0,
|
85 |
"torch_dtype": null,
|
86 |
"torchscript": false,
|
87 |
-
"transformers_version": "4.
|
88 |
"type_vocab_size": 2,
|
89 |
"typical_p": 1.0,
|
90 |
"use_bfloat16": false,
|
@@ -94,8 +94,8 @@
|
|
94 |
"entity_max_length": 8,
|
95 |
"id2label": {
|
96 |
"0": "O",
|
97 |
-
"1": "
|
98 |
-
"2": "
|
99 |
},
|
100 |
"id2reduced_id": {
|
101 |
"0": 1,
|
@@ -106,8 +106,8 @@
|
|
106 |
},
|
107 |
"label2id": {
|
108 |
"O": 0,
|
109 |
-
"
|
110 |
-
"
|
111 |
},
|
112 |
"marker_max_length": 128,
|
113 |
"max_next_context": null,
|
@@ -115,9 +115,9 @@
|
|
115 |
"model_max_length": 256,
|
116 |
"model_max_length_default": 512,
|
117 |
"model_type": "span-marker",
|
118 |
-
"span_marker_version": "1.
|
119 |
"torch_dtype": "float32",
|
120 |
"trained_with_document_context": false,
|
121 |
-
"transformers_version": "4.
|
122 |
"vocab_size": 30524
|
123 |
}
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "models\\tomaarsen\\span-marker-bert-base-uncased-acronyms-2\\checkpoint-final",
|
3 |
"architectures": [
|
4 |
"SpanMarkerModel"
|
5 |
],
|
|
|
84 |
"top_p": 1.0,
|
85 |
"torch_dtype": null,
|
86 |
"torchscript": false,
|
87 |
+
"transformers_version": "4.30.0",
|
88 |
"type_vocab_size": 2,
|
89 |
"typical_p": 1.0,
|
90 |
"use_bfloat16": false,
|
|
|
94 |
"entity_max_length": 8,
|
95 |
"id2label": {
|
96 |
"0": "O",
|
97 |
+
"1": "long",
|
98 |
+
"2": "short"
|
99 |
},
|
100 |
"id2reduced_id": {
|
101 |
"0": 1,
|
|
|
106 |
},
|
107 |
"label2id": {
|
108 |
"O": 0,
|
109 |
+
"long": 1,
|
110 |
+
"short": 2
|
111 |
},
|
112 |
"marker_max_length": 128,
|
113 |
"max_next_context": null,
|
|
|
115 |
"model_max_length": 256,
|
116 |
"model_max_length_default": 512,
|
117 |
"model_type": "span-marker",
|
118 |
+
"span_marker_version": "1.3.1.dev",
|
119 |
"torch_dtype": "float32",
|
120 |
"trained_with_document_context": false,
|
121 |
+
"transformers_version": "4.30.0",
|
122 |
"vocab_size": 30524
|
123 |
}
|
pytorch_model.bin
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bfd74890b3300297596046acebae932375efd77c793188aa0d62fcca1ad080c5
|
3 |
+
size 438024117
|