asahi417 commited on
Commit
b268402
1 Parent(s): fcd0a53

model update

Browse files
README.md ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - tner/tweetner7
4
+ metrics:
5
+ - f1
6
+ - precision
7
+ - recall
8
+ model-index:
9
+ - name: tner/bert-base-tweetner7-2020-2021-continuous
10
+ results:
11
+ - task:
12
+ name: Token Classification
13
+ type: token-classification
14
+ dataset:
15
+ name: tner/tweetner7/test_2021
16
+ type: tner/tweetner7/test_2021
17
+ args: tner/tweetner7/test_2021
18
+ metrics:
19
+ - name: F1
20
+ type: f1
21
+ value: 0.6180153025736147
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6195955369595537
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6164431082331174
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5683670244315128
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.569694944056475
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.5712308118378218
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7652789052533921
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7674148156762414
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7631548513935469
46
+ - task:
47
+ name: Token Classification
48
+ type: token-classification
49
+ dataset:
50
+ name: tner/tweetner7/test_2020
51
+ type: tner/tweetner7/test_2020
52
+ args: tner/tweetner7/test_2020
53
+ metrics:
54
+ - name: F1
55
+ type: f1
56
+ value: 0.6140546569994423
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6636528028933092
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.5713544369486248
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.5710807917000799
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6216528993817231
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5337579395628287
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7250418293363079
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7836045810729355
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.6746237675142709
81
+
82
+ pipeline_tag: token-classification
83
+ widget:
84
+ - text: "Get the all-analog Classic Vinyl Edition of `Takin' Off` Album from {{@Herbie Hancock@}} via {{USERNAME}} link below: {{URL}}"
85
+ example_title: "NER Example 1"
86
+ ---
87
+ # tner/bert-base-tweetner7-2020-2021-continuous
88
+
89
+ This model is a fine-tuned version of [tner/bert-base-tweetner-2020](https://huggingface.co/tner/bert-base-tweetner-2020) on the
90
+ [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset (`train_2021` split). The model is first fine-tuned on `train_2020`, and then continuously fine-tuned on `train_2021`.
91
+ Model fine-tuning is done via [T-NER](https://github.com/asahi417/tner)'s hyper-parameter search (see the repository
92
+ for more detail). It achieves the following results on the test set of 2021:
93
+ - F1 (micro): 0.6180153025736147
94
+ - Precision (micro): 0.6195955369595537
95
+ - Recall (micro): 0.6164431082331174
96
+ - F1 (macro): 0.5683670244315128
97
+ - Precision (macro): 0.569694944056475
98
+ - Recall (macro): 0.5712308118378218
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.47404505386875617
104
+ - creative_work: 0.3821742066171506
105
+ - event: 0.44045368620037806
106
+ - group: 0.5773490532332975
107
+ - location: 0.6442244224422442
108
+ - person: 0.8072178236052291
109
+ - product: 0.6531049250535331
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6091071020409725, 0.6281541017445712]
114
+ - 95%: [0.6068108439278024, 0.6300879315353104]
115
+ - F1 (macro):
116
+ - 90%: [0.6091071020409725, 0.6281541017445712]
117
+ - 95%: [0.6068108439278024, 0.6300879315353104]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/bert-base-tweetner7-2020-2021-continuous/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/bert-base-tweetner7-2020-2021-continuous/raw/main/eval/metric_span.json).
121
+
122
+ ### Usage
123
+ This model can be used through the [tner library](https://github.com/asahi417/tner). Install the library via pip
124
+ ```shell
125
+ pip install tner
126
+ ```
127
+ and activate model as below.
128
+ ```python
129
+ from tner import TransformersNER
130
+ model = TransformersNER("tner/bert-base-tweetner7-2020-2021-continuous")
131
+ model.predict(["Jacob Collier is a Grammy awarded English artist from London"])
132
+ ```
133
+ It can be used via transformers library but it is not recommended as CRF layer is not supported at the moment.
134
+
135
+ ### Training hyperparameters
136
+
137
+ The following hyperparameters were used during training:
138
+ - dataset: ['tner/tweetner7']
139
+ - dataset_split: train_2021
140
+ - dataset_name: None
141
+ - local_dataset: None
142
+ - model: tner/bert-base-tweetner-2020
143
+ - crf: True
144
+ - max_length: 128
145
+ - epoch: 30
146
+ - batch_size: 32
147
+ - lr: 1e-05
148
+ - random_seed: 0
149
+ - gradient_accumulation_steps: 1
150
+ - weight_decay: 1e-07
151
+ - lr_warmup_step_ratio: 0.15
152
+ - max_grad_norm: 1
153
+
154
+ The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/bert-base-tweetner7-2020-2021-continuous/raw/main/trainer_config.json).
155
+
156
+ ### Reference
157
+ If you use any resource from T-NER, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
158
+
159
+ ```
160
+
161
+ @inproceedings{ushio-camacho-collados-2021-ner,
162
+ title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition",
163
+ author = "Ushio, Asahi and
164
+ Camacho-Collados, Jose",
165
+ booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations",
166
+ month = apr,
167
+ year = "2021",
168
+ address = "Online",
169
+ publisher = "Association for Computational Linguistics",
170
+ url = "https://aclanthology.org/2021.eacl-demos.7",
171
+ doi = "10.18653/v1/2021.eacl-demos.7",
172
+ pages = "53--62",
173
+ abstract = "Language model (LM) pretraining has led to consistent improvements in many NLP downstream tasks, including named entity recognition (NER). In this paper, we present T-NER (Transformer-based Named Entity Recognition), a Python library for NER LM finetuning. In addition to its practical utility, T-NER facilitates the study and investigation of the cross-domain and cross-lingual generalization ability of LMs finetuned on NER. Our library also provides a web app where users can get model predictions interactively for arbitrary text, which facilitates qualitative model evaluation for non-expert programmers. We show the potential of the library by compiling nine public NER datasets into a unified format and evaluating the cross-domain and cross- lingual performance across the datasets. The results from our initial experiments show that in-domain performance is generally competitive across datasets. However, cross-domain generalization is challenging even with a large pretrained LM, which has nevertheless capacity to learn domain-specific features if fine- tuned on a combined dataset. To facilitate future research, we also release all our LM checkpoints via the Hugging Face model hub.",
174
+ }
175
+
176
+ ```
eval/metric.json DELETED
@@ -1 +0,0 @@
1
- {"2021.dev": {"micro/f1": 0.6148409893992933, "micro/f1_ci": {}, "micro/recall": 0.609, "micro/precision": 0.6207951070336392, "macro/f1": 0.5701559407018298, "macro/f1_ci": {}, "macro/recall": 0.5658302273189542, "macro/precision": 0.5779864735020361, "per_entity_metric": {"corporation": {"f1": 0.5486725663716814, "f1_ci": {}, "precision": 0.5, "recall": 0.6078431372549019}, "creative_work": {"f1": 0.4335664335664336, "f1_ci": {}, "precision": 0.4492753623188406, "recall": 0.4189189189189189}, "event": {"f1": 0.3939393939393939, "f1_ci": {}, "precision": 0.39097744360902253, "recall": 0.3969465648854962}, "group": {"f1": 0.6066350710900474, "f1_ci": {}, "precision": 0.6564102564102564, "recall": 0.5638766519823789}, "location": {"f1": 0.5815602836879432, "f1_ci": {}, "precision": 0.5942028985507246, "recall": 0.5694444444444444}, "person": {"f1": 0.795138888888889, "f1_ci": {}, "precision": 0.7815699658703071, "recall": 0.8091872791519434}, "product": {"f1": 0.6315789473684211, "f1_ci": {}, "precision": 0.673469387755102, "recall": 0.5945945945945946}}}, "2021.test": {"micro/f1": 0.6180153025736147, "micro/f1_ci": {"90": [0.6091071020409725, 0.6281541017445712], "95": [0.6068108439278024, 0.6300879315353104]}, "micro/recall": 0.6164431082331174, "micro/precision": 0.6195955369595537, "macro/f1": 0.5683670244315128, "macro/f1_ci": {"90": [0.5585356632073021, 0.5783570229745414], "95": [0.5566645989492551, 0.5802489470130128]}, "macro/recall": 0.5712308118378218, "macro/precision": 0.569694944056475, "per_entity_metric": {"corporation": {"f1": 0.47404505386875617, "f1_ci": {"90": [0.4490379133679127, 0.4990727568196289], "95": [0.4441134904075242, 0.5039688442060536]}, "precision": 0.4238178633975482, "recall": 0.5377777777777778}, "creative_work": {"f1": 0.3821742066171506, "f1_ci": {"90": [0.35211960334500386, 0.4128517316017316], "95": [0.34730538922155685, 0.41977224730637996]}, "precision": 0.37733333333333335, "recall": 0.387140902872777}, "event": {"f1": 0.44045368620037806, "f1_ci": {"90": [0.41686079777668794, 0.4635629737606736], "95": [0.41271162200014244, 0.4690119025876094]}, "precision": 0.4582104228121927, "recall": 0.4240218380345769}, "group": {"f1": 0.5773490532332975, "f1_ci": {"90": [0.5552643235358515, 0.6014339048948261], "95": [0.5519955277939024, 0.604945054945055]}, "precision": 0.6307572209211554, "recall": 0.5322793148880105}, "location": {"f1": 0.6442244224422442, "f1_ci": {"90": [0.616027444804906, 0.6713668122570161], "95": [0.6104101752199371, 0.6748156291439195]}, "precision": 0.6107634543178974, "recall": 0.6815642458100558}, "person": {"f1": 0.8072178236052291, "f1_ci": {"90": [0.7949127874965743, 0.8191705751547954], "95": [0.7917901949040049, 0.8214841028371646]}, "precision": 0.8061787421846267, "recall": 0.8082595870206489}, "product": {"f1": 0.6531049250535331, "f1_ci": {"90": [0.6304396220938515, 0.674394710721743], "95": [0.6260682322959881, 0.678272448791214]}, "precision": 0.6808035714285714, "recall": 0.6275720164609053}}}, "2020.test": {"micro/f1": 0.6140546569994423, "micro/f1_ci": {"90": [0.5935696915654249, 0.633132472774783], "95": [0.5888371280910468, 0.6376608622599]}, "micro/recall": 0.5713544369486248, "micro/precision": 0.6636528028933092, "macro/f1": 0.5710807917000799, "macro/f1_ci": {"90": [0.5478250595501791, 0.592402271276497], "95": [0.5441015143150139, 0.5966065608106168]}, "macro/recall": 0.5337579395628287, "macro/precision": 0.6216528993817231, "per_entity_metric": {"corporation": {"f1": 0.5441176470588235, "f1_ci": {"90": [0.48876663303573126, 0.592100492100492], "95": [0.4804129604224749, 0.600520698653001]}, "precision": 0.511520737327189, "recall": 0.581151832460733}, "creative_work": {"f1": 0.42405063291139244, "f1_ci": {"90": [0.364188207958176, 0.48667350928641245], "95": [0.34920102269095554, 0.4985368691673284]}, "precision": 0.48905109489051096, "recall": 0.3743016759776536}, "event": {"f1": 0.4146341463414634, "f1_ci": {"90": [0.36212023989801767, 0.4683313491581428], "95": [0.3502082112930749, 0.4778481449922852]}, "precision": 0.44933920704845814, "recall": 0.3849056603773585}, "group": {"f1": 0.51252408477842, "f1_ci": {"90": [0.4573452121522882, 0.5658367176663969], "95": [0.44864981072900945, 0.5744367822180436]}, "precision": 0.6394230769230769, "recall": 0.42765273311897106}, "location": {"f1": 0.6349206349206349, "f1_ci": {"90": [0.5640853553605231, 0.6964856230031949], "95": [0.5436840439003798, 0.7125786608600979]}, "precision": 0.6666666666666666, "recall": 0.6060606060606061}, "person": {"f1": 0.798951048951049, "f1_ci": {"90": [0.7706629441193157, 0.8219729070364663], "95": [0.7663099298662476, 0.8272448572277301]}, "precision": 0.833941605839416, "recall": 0.7667785234899329}, "product": {"f1": 0.6683673469387755, "f1_ci": {"90": [0.6137868712702471, 0.7193481343491076], "95": [0.6005505949083819, 0.72868637441356]}, "precision": 0.7616279069767442, "recall": 0.5954545454545455}}}, "2021.test (span detection)": {"micro/f1": 0.7652789052533921, "micro/f1_ci": {}, "micro/recall": 0.7631548513935469, "micro/precision": 0.7674148156762414, "macro/f1": 0.7652789052533921, "macro/f1_ci": {}, "macro/recall": 0.7631548513935469, "macro/precision": 0.7674148156762414}, "2020.test (span detection)": {"micro/f1": 0.7250418293363079, "micro/f1_ci": {}, "micro/recall": 0.6746237675142709, "micro/precision": 0.7836045810729355, "macro/f1": 0.7250418293363079, "macro/f1_ci": {}, "macro/recall": 0.6746237675142709, "macro/precision": 0.7836045810729355}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6140546569994423, "micro/f1_ci": {"90": [0.5935696915654249, 0.633132472774783], "95": [0.5888371280910468, 0.6376608622599]}, "micro/recall": 0.5713544369486248, "micro/precision": 0.6636528028933092, "macro/f1": 0.5710807917000799, "macro/f1_ci": {"90": [0.5478250595501791, 0.592402271276497], "95": [0.5441015143150139, 0.5966065608106168]}, "macro/recall": 0.5337579395628287, "macro/precision": 0.6216528993817231, "per_entity_metric": {"corporation": {"f1": 0.5441176470588235, "f1_ci": {"90": [0.48876663303573126, 0.592100492100492], "95": [0.4804129604224749, 0.600520698653001]}, "precision": 0.511520737327189, "recall": 0.581151832460733}, "creative_work": {"f1": 0.42405063291139244, "f1_ci": {"90": [0.364188207958176, 0.48667350928641245], "95": [0.34920102269095554, 0.4985368691673284]}, "precision": 0.48905109489051096, "recall": 0.3743016759776536}, "event": {"f1": 0.4146341463414634, "f1_ci": {"90": [0.36212023989801767, 0.4683313491581428], "95": [0.3502082112930749, 0.4778481449922852]}, "precision": 0.44933920704845814, "recall": 0.3849056603773585}, "group": {"f1": 0.51252408477842, "f1_ci": {"90": [0.4573452121522882, 0.5658367176663969], "95": [0.44864981072900945, 0.5744367822180436]}, "precision": 0.6394230769230769, "recall": 0.42765273311897106}, "location": {"f1": 0.6349206349206349, "f1_ci": {"90": [0.5640853553605231, 0.6964856230031949], "95": [0.5436840439003798, 0.7125786608600979]}, "precision": 0.6666666666666666, "recall": 0.6060606060606061}, "person": {"f1": 0.798951048951049, "f1_ci": {"90": [0.7706629441193157, 0.8219729070364663], "95": [0.7663099298662476, 0.8272448572277301]}, "precision": 0.833941605839416, "recall": 0.7667785234899329}, "product": {"f1": 0.6683673469387755, "f1_ci": {"90": [0.6137868712702471, 0.7193481343491076], "95": [0.6005505949083819, 0.72868637441356]}, "precision": 0.7616279069767442, "recall": 0.5954545454545455}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6180153025736147, "micro/f1_ci": {"90": [0.6091071020409725, 0.6281541017445712], "95": [0.6068108439278024, 0.6300879315353104]}, "micro/recall": 0.6164431082331174, "micro/precision": 0.6195955369595537, "macro/f1": 0.5683670244315128, "macro/f1_ci": {"90": [0.5585356632073021, 0.5783570229745414], "95": [0.5566645989492551, 0.5802489470130128]}, "macro/recall": 0.5712308118378218, "macro/precision": 0.569694944056475, "per_entity_metric": {"corporation": {"f1": 0.47404505386875617, "f1_ci": {"90": [0.4490379133679127, 0.4990727568196289], "95": [0.4441134904075242, 0.5039688442060536]}, "precision": 0.4238178633975482, "recall": 0.5377777777777778}, "creative_work": {"f1": 0.3821742066171506, "f1_ci": {"90": [0.35211960334500386, 0.4128517316017316], "95": [0.34730538922155685, 0.41977224730637996]}, "precision": 0.37733333333333335, "recall": 0.387140902872777}, "event": {"f1": 0.44045368620037806, "f1_ci": {"90": [0.41686079777668794, 0.4635629737606736], "95": [0.41271162200014244, 0.4690119025876094]}, "precision": 0.4582104228121927, "recall": 0.4240218380345769}, "group": {"f1": 0.5773490532332975, "f1_ci": {"90": [0.5552643235358515, 0.6014339048948261], "95": [0.5519955277939024, 0.604945054945055]}, "precision": 0.6307572209211554, "recall": 0.5322793148880105}, "location": {"f1": 0.6442244224422442, "f1_ci": {"90": [0.616027444804906, 0.6713668122570161], "95": [0.6104101752199371, 0.6748156291439195]}, "precision": 0.6107634543178974, "recall": 0.6815642458100558}, "person": {"f1": 0.8072178236052291, "f1_ci": {"90": [0.7949127874965743, 0.8191705751547954], "95": [0.7917901949040049, 0.8214841028371646]}, "precision": 0.8061787421846267, "recall": 0.8082595870206489}, "product": {"f1": 0.6531049250535331, "f1_ci": {"90": [0.6304396220938515, 0.674394710721743], "95": [0.6260682322959881, 0.678272448791214]}, "precision": 0.6808035714285714, "recall": 0.6275720164609053}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7250418293363079, "micro/f1_ci": {}, "micro/recall": 0.6746237675142709, "micro/precision": 0.7836045810729355, "macro/f1": 0.7250418293363079, "macro/f1_ci": {}, "macro/recall": 0.6746237675142709, "macro/precision": 0.7836045810729355}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7652789052533921, "micro/f1_ci": {}, "micro/recall": 0.7631548513935469, "micro/precision": 0.7674148156762414, "macro/f1": 0.7652789052533921, "macro/f1_ci": {}, "macro/recall": 0.7631548513935469, "macro/precision": 0.7674148156762414}
eval/prediction.2020.test.json DELETED
The diff for this file is too large to render. See raw diff
 
eval/prediction.2021.dev.json DELETED
The diff for this file is too large to render. See raw diff
 
eval/prediction.2021.test.json DELETED
The diff for this file is too large to render. See raw diff
 
trainer_config.json CHANGED
@@ -1 +1 @@
1
- {"data_split": "2021.train", "model": "tner/bert-base-tweetner-2020", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 1e-05, "random_seed": 0, "gradient_accumulation_steps": 1, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.15, "max_grad_norm": 1}
 
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train_2021", "dataset_name": null, "local_dataset": null, "model": "tner/bert-base-tweetner-2020", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 1e-05, "random_seed": 0, "gradient_accumulation_steps": 1, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.15, "max_grad_norm": 1}