asahi417 commited on
Commit
a2f7039
1 Parent(s): 183a3eb

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/bertweet-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.6584472230299506
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6623376623376623
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6546022201665125
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.6102300887168732
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.611802506987418
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6126461527097806
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7909735954402699
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7956007956007956
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7863999074823639
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.6516111264114568
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6942488262910798
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6139076284379865
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6135259272473801
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6543224335799225
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5830306967374339
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7680440771349863
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.8185554903112156
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.723404255319149
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/bertweet-base-tweetner7-2020-2021-continuous
88
+
89
+ This model is a fine-tuned version of [tner/bertweet-base-tweetner-2020](https://huggingface.co/tner/bertweet-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.6584472230299506
94
+ - Precision (micro): 0.6623376623376623
95
+ - Recall (micro): 0.6546022201665125
96
+ - F1 (macro): 0.6102300887168732
97
+ - Precision (macro): 0.611802506987418
98
+ - Recall (macro): 0.6126461527097806
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5185185185185185
104
+ - creative_work: 0.4682686383240912
105
+ - event: 0.49658536585365853
106
+ - group: 0.6117404737384141
107
+ - location: 0.6658081133290406
108
+ - person: 0.8447412353923205
109
+ - product: 0.6659482758620691
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6494608590732527, 0.6679885108746003]
114
+ - 95%: [0.6476930900555805, 0.6694290853194725]
115
+ - F1 (macro):
116
+ - 90%: [0.6494608590732527, 0.6679885108746003]
117
+ - 95%: [0.6476930900555805, 0.6694290853194725]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/bertweet-base-tweetner7-2020-2021-continuous/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/bertweet-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/bertweet-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/bertweet-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.3
152
+ - max_grad_norm: 1
153
+
154
+ The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/bertweet-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.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6516111264114568, "micro/f1_ci": {"90": [0.6307643696766942, 0.6719969183970778], "95": [0.6279769593276863, 0.6754876660511644]}, "micro/recall": 0.6139076284379865, "micro/precision": 0.6942488262910798, "macro/f1": 0.6135259272473801, "macro/f1_ci": {"90": [0.5906927661860492, 0.6344368144341196], "95": [0.5857025826391625, 0.6398643336684641]}, "macro/recall": 0.5830306967374339, "macro/precision": 0.6543224335799225, "per_entity_metric": {"corporation": {"f1": 0.5576407506702413, "f1_ci": {"90": [0.49716845518670816, 0.6133509933774834], "95": [0.4834629553827261, 0.6226928728295388]}, "precision": 0.5714285714285714, "recall": 0.5445026178010471}, "creative_work": {"f1": 0.5683060109289618, "f1_ci": {"90": [0.5116146934460888, 0.6213143806261214], "95": [0.4987511327781342, 0.6269530761644141]}, "precision": 0.5561497326203209, "recall": 0.5810055865921788}, "event": {"f1": 0.4621513944223108, "f1_ci": {"90": [0.407666973744818, 0.5147216611966674], "95": [0.39747293617586504, 0.5267074887252602]}, "precision": 0.48945147679324896, "recall": 0.4377358490566038}, "group": {"f1": 0.5632183908045978, "f1_ci": {"90": [0.5081111741349972, 0.6198251387919285], "95": [0.4973684935701162, 0.627101507914578]}, "precision": 0.6966824644549763, "recall": 0.47266881028938906}, "location": {"f1": 0.6626865671641792, "f1_ci": {"90": [0.5987634662263112, 0.7208521653381543], "95": [0.5852242504835591, 0.7327961432506889]}, "precision": 0.6529411764705882, "recall": 0.6727272727272727}, "person": {"f1": 0.8293963254593175, "f1_ci": {"90": [0.80330438414185, 0.8518550780745903], "95": [0.7989825274493244, 0.8552756712441073]}, "precision": 0.8665447897623401, "recall": 0.7953020134228188}, "product": {"f1": 0.6512820512820514, "f1_ci": {"90": [0.6014985014985015, 0.7033119235335301], "95": [0.5895308160048044, 0.7101524983776768]}, "precision": 0.7470588235294118, "recall": 0.5772727272727273}}}
eval/{metric.json → metric.test_2021.json} RENAMED
@@ -1 +1 @@
1
- {"2021.dev": {"micro/f1": 0.6467308667004562, "micro/f1_ci": {}, "micro/recall": 0.638, "micro/precision": 0.6557040082219938, "macro/f1": 0.5978684732798378, "macro/f1_ci": {}, "macro/recall": 0.5943341624899113, "macro/precision": 0.6055590663418738, "per_entity_metric": {"corporation": {"f1": 0.5825242718446602, "f1_ci": {}, "precision": 0.5769230769230769, "recall": 0.5882352941176471}, "creative_work": {"f1": 0.4268292682926829, "f1_ci": {}, "precision": 0.3888888888888889, "recall": 0.47297297297297297}, "event": {"f1": 0.46090534979423864, "f1_ci": {}, "precision": 0.5, "recall": 0.42748091603053434}, "group": {"f1": 0.6325581395348837, "f1_ci": {}, "precision": 0.6699507389162561, "recall": 0.5991189427312775}, "location": {"f1": 0.6133333333333332, "f1_ci": {}, "precision": 0.5897435897435898, "recall": 0.6388888888888888}, "person": {"f1": 0.8347826086956522, "f1_ci": {}, "precision": 0.821917808219178, "recall": 0.8480565371024735}, "product": {"f1": 0.6341463414634145, "f1_ci": {}, "precision": 0.6914893617021277, "recall": 0.5855855855855856}}}, "2021.test": {"micro/f1": 0.6584472230299506, "micro/f1_ci": {"90": [0.6494608590732527, 0.6679885108746003], "95": [0.6476930900555805, 0.6694290853194725]}, "micro/recall": 0.6546022201665125, "micro/precision": 0.6623376623376623, "macro/f1": 0.6102300887168732, "macro/f1_ci": {"90": [0.6004038513370128, 0.6197560648878369], "95": [0.5983376336540169, 0.6210193530268486]}, "macro/recall": 0.6126461527097806, "macro/precision": 0.611802506987418, "per_entity_metric": {"corporation": {"f1": 0.5185185185185185, "f1_ci": {"90": [0.49337153061983774, 0.5439587858969501], "95": [0.48740574277388654, 0.5496106513391685]}, "precision": 0.5159515951595159, "recall": 0.5211111111111111}, "creative_work": {"f1": 0.4682686383240912, "f1_ci": {"90": [0.438666115261993, 0.4978700091388796], "95": [0.43393763344195974, 0.503641894873691]}, "precision": 0.4260089686098655, "recall": 0.5198358413132695}, "event": {"f1": 0.49658536585365853, "f1_ci": {"90": [0.47272381446418543, 0.5189233272281362], "95": [0.46833006812245065, 0.52501206086096]}, "precision": 0.5352260778128286, "recall": 0.46314831665150136}, "group": {"f1": 0.6117404737384141, "f1_ci": {"90": [0.591561073989307, 0.6339137710303029], "95": [0.5878883127243717, 0.63736429288823]}, "precision": 0.6387096774193548, "recall": 0.5869565217391305}, "location": {"f1": 0.6658081133290406, "f1_ci": {"90": [0.6385166723863426, 0.692362621847589], "95": [0.6316389021787584, 0.6965855246144679]}, "precision": 0.6176821983273596, "recall": 0.7220670391061452}, "person": {"f1": 0.8447412353923205, "f1_ci": {"90": [0.8347663259120971, 0.8552561479552422], "95": [0.8329609550207723, 0.8566901985328257]}, "precision": 0.8499440089585666, "recall": 0.8396017699115044}, "product": {"f1": 0.6659482758620691, "f1_ci": {"90": [0.6434850321173191, 0.6866341444247477], "95": [0.6403631144443871, 0.690716861020364]}, "precision": 0.6990950226244343, "recall": 0.6358024691358025}}}, "2020.test": {"micro/f1": 0.6516111264114568, "micro/f1_ci": {"90": [0.6307643696766942, 0.6719969183970778], "95": [0.6279769593276863, 0.6754876660511644]}, "micro/recall": 0.6139076284379865, "micro/precision": 0.6942488262910798, "macro/f1": 0.6135259272473801, "macro/f1_ci": {"90": [0.5906927661860492, 0.6344368144341196], "95": [0.5857025826391625, 0.6398643336684641]}, "macro/recall": 0.5830306967374339, "macro/precision": 0.6543224335799225, "per_entity_metric": {"corporation": {"f1": 0.5576407506702413, "f1_ci": {"90": [0.49716845518670816, 0.6133509933774834], "95": [0.4834629553827261, 0.6226928728295388]}, "precision": 0.5714285714285714, "recall": 0.5445026178010471}, "creative_work": {"f1": 0.5683060109289618, "f1_ci": {"90": [0.5116146934460888, 0.6213143806261214], "95": [0.4987511327781342, 0.6269530761644141]}, "precision": 0.5561497326203209, "recall": 0.5810055865921788}, "event": {"f1": 0.4621513944223108, "f1_ci": {"90": [0.407666973744818, 0.5147216611966674], "95": [0.39747293617586504, 0.5267074887252602]}, "precision": 0.48945147679324896, "recall": 0.4377358490566038}, "group": {"f1": 0.5632183908045978, "f1_ci": {"90": [0.5081111741349972, 0.6198251387919285], "95": [0.4973684935701162, 0.627101507914578]}, "precision": 0.6966824644549763, "recall": 0.47266881028938906}, "location": {"f1": 0.6626865671641792, "f1_ci": {"90": [0.5987634662263112, 0.7208521653381543], "95": [0.5852242504835591, 0.7327961432506889]}, "precision": 0.6529411764705882, "recall": 0.6727272727272727}, "person": {"f1": 0.8293963254593175, "f1_ci": {"90": [0.80330438414185, 0.8518550780745903], "95": [0.7989825274493244, 0.8552756712441073]}, "precision": 0.8665447897623401, "recall": 0.7953020134228188}, "product": {"f1": 0.6512820512820514, "f1_ci": {"90": [0.6014985014985015, 0.7033119235335301], "95": [0.5895308160048044, 0.7101524983776768]}, "precision": 0.7470588235294118, "recall": 0.5772727272727273}}}, "2021.test (span detection)": {"micro/f1": 0.7909735954402699, "micro/f1_ci": {}, "micro/recall": 0.7863999074823639, "micro/precision": 0.7956007956007956, "macro/f1": 0.7909735954402699, "macro/f1_ci": {}, "macro/recall": 0.7863999074823639, "macro/precision": 0.7956007956007956}, "2020.test (span detection)": {"micro/f1": 0.7680440771349863, "micro/f1_ci": {}, "micro/recall": 0.723404255319149, "micro/precision": 0.8185554903112156, "macro/f1": 0.7680440771349863, "macro/f1_ci": {}, "macro/recall": 0.723404255319149, "macro/precision": 0.8185554903112156}}
1
+ {"micro/f1": 0.6584472230299506, "micro/f1_ci": {"90": [0.6494608590732527, 0.6679885108746003], "95": [0.6476930900555805, 0.6694290853194725]}, "micro/recall": 0.6546022201665125, "micro/precision": 0.6623376623376623, "macro/f1": 0.6102300887168732, "macro/f1_ci": {"90": [0.6004038513370128, 0.6197560648878369], "95": [0.5983376336540169, 0.6210193530268486]}, "macro/recall": 0.6126461527097806, "macro/precision": 0.611802506987418, "per_entity_metric": {"corporation": {"f1": 0.5185185185185185, "f1_ci": {"90": [0.49337153061983774, 0.5439587858969501], "95": [0.48740574277388654, 0.5496106513391685]}, "precision": 0.5159515951595159, "recall": 0.5211111111111111}, "creative_work": {"f1": 0.4682686383240912, "f1_ci": {"90": [0.438666115261993, 0.4978700091388796], "95": [0.43393763344195974, 0.503641894873691]}, "precision": 0.4260089686098655, "recall": 0.5198358413132695}, "event": {"f1": 0.49658536585365853, "f1_ci": {"90": [0.47272381446418543, 0.5189233272281362], "95": [0.46833006812245065, 0.52501206086096]}, "precision": 0.5352260778128286, "recall": 0.46314831665150136}, "group": {"f1": 0.6117404737384141, "f1_ci": {"90": [0.591561073989307, 0.6339137710303029], "95": [0.5878883127243717, 0.63736429288823]}, "precision": 0.6387096774193548, "recall": 0.5869565217391305}, "location": {"f1": 0.6658081133290406, "f1_ci": {"90": [0.6385166723863426, 0.692362621847589], "95": [0.6316389021787584, 0.6965855246144679]}, "precision": 0.6176821983273596, "recall": 0.7220670391061452}, "person": {"f1": 0.8447412353923205, "f1_ci": {"90": [0.8347663259120971, 0.8552561479552422], "95": [0.8329609550207723, 0.8566901985328257]}, "precision": 0.8499440089585666, "recall": 0.8396017699115044}, "product": {"f1": 0.6659482758620691, "f1_ci": {"90": [0.6434850321173191, 0.6866341444247477], "95": [0.6403631144443871, 0.690716861020364]}, "precision": 0.6990950226244343, "recall": 0.6358024691358025}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7680440771349863, "micro/f1_ci": {}, "micro/recall": 0.723404255319149, "micro/precision": 0.8185554903112156, "macro/f1": 0.7680440771349863, "macro/f1_ci": {}, "macro/recall": 0.723404255319149, "macro/precision": 0.8185554903112156}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7909735954402699, "micro/f1_ci": {}, "micro/recall": 0.7863999074823639, "micro/precision": 0.7956007956007956, "macro/f1": 0.7909735954402699, "macro/f1_ci": {}, "macro/recall": 0.7863999074823639, "macro/precision": 0.7956007956007956}
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/bertweet-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.3, "max_grad_norm": 1}
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train_2021", "dataset_name": null, "local_dataset": null, "model": "tner/bertweet-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.3, "max_grad_norm": 1}