asahi417 commited on
Commit
09fa572
1 Parent(s): ed88a7b

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-large-tweetner7-2021
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.6289961994187345
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6087191691908265
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6506706753006476
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5812541319576294
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5735814298740157
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.5939651947848222
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7649656251746688
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7402639549978365
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7913727304267376
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.6161290322580646
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6391522587841606
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.5947067981318112
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.5683990688463066
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6097755448151788
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5400218465464566
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7446236559139785
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7724484104852203
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7187337830825117
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-large-tweetner7-2021
88
+
89
+ This model is a fine-tuned version of [vinai/bertweet-large](https://huggingface.co/vinai/bertweet-large) on the
90
+ [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset (`train_2021` split).
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.6289961994187345
94
+ - Precision (micro): 0.6087191691908265
95
+ - Recall (micro): 0.6506706753006476
96
+ - F1 (macro): 0.5812541319576294
97
+ - Precision (macro): 0.5735814298740157
98
+ - Recall (macro): 0.5939651947848222
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.48868253047011023
104
+ - creative_work: 0.42327272727272724
105
+ - event: 0.44868301544050865
106
+ - group: 0.5640022358859699
107
+ - location: 0.6620973269362577
108
+ - person: 0.8104852993269572
109
+ - product: 0.6715557883708747
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6203286893040556, 0.6380714998883444]
114
+ - 95%: [0.618788856392642, 0.6396755249087301]
115
+ - F1 (macro):
116
+ - 90%: [0.6203286893040556, 0.6380714998883444]
117
+ - 95%: [0.618788856392642, 0.6396755249087301]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/bertweet-large-tweetner7-2021/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/bertweet-large-tweetner7-2021/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-large-tweetner7-2021")
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: vinai/bertweet-large
143
+ - crf: True
144
+ - max_length: 128
145
+ - epoch: 30
146
+ - batch_size: 32
147
+ - lr: 0.0001
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-large-tweetner7-2021/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.6263627353815658, "micro/f1_ci": {}, "micro/recall": 0.632, "micro/precision": 0.6208251473477406, "macro/f1": 0.5851732462052094, "macro/f1_ci": {}, "macro/recall": 0.5802751033017407, "macro/precision": 0.593621347021893, "per_entity_metric": {"corporation": {"f1": 0.5463917525773196, "f1_ci": {}, "precision": 0.5760869565217391, "recall": 0.5196078431372549}, "creative_work": {"f1": 0.4852941176470588, "f1_ci": {}, "precision": 0.532258064516129, "recall": 0.44594594594594594}, "event": {"f1": 0.3858267716535433, "f1_ci": {}, "precision": 0.3983739837398374, "recall": 0.37404580152671757}, "group": {"f1": 0.5991902834008097, "f1_ci": {}, "precision": 0.5543071161048689, "recall": 0.6519823788546255}, "location": {"f1": 0.6619718309859155, "f1_ci": {}, "precision": 0.6714285714285714, "recall": 0.6527777777777778}, "person": {"f1": 0.8109028960817718, "f1_ci": {}, "precision": 0.7828947368421053, "recall": 0.8409893992932862}, "product": {"f1": 0.6066350710900474, "f1_ci": {}, "precision": 0.64, "recall": 0.5765765765765766}}}, "2021.test": {"micro/f1": 0.6289961994187345, "micro/f1_ci": {"90": [0.6203286893040556, 0.6380714998883444], "95": [0.618788856392642, 0.6396755249087301]}, "micro/recall": 0.6506706753006476, "micro/precision": 0.6087191691908265, "macro/f1": 0.5812541319576294, "macro/f1_ci": {"90": [0.5718189466207007, 0.5907047023159696], "95": [0.570148090704244, 0.5931380949842975]}, "macro/recall": 0.5939651947848222, "macro/precision": 0.5735814298740157, "per_entity_metric": {"corporation": {"f1": 0.48868253047011023, "f1_ci": {"90": [0.4622326197034712, 0.5141309821972517], "95": [0.45822312966462947, 0.5197904004107121]}, "precision": 0.511543134872418, "recall": 0.4677777777777778}, "creative_work": {"f1": 0.42327272727272724, "f1_ci": {"90": [0.3913589008836675, 0.4552146375791695], "95": [0.3850330909993861, 0.4622114861898092]}, "precision": 0.4518633540372671, "recall": 0.39808481532147744}, "event": {"f1": 0.44868301544050865, "f1_ci": {"90": [0.42517128763823137, 0.47089546185055303], "95": [0.4216687641767551, 0.47516390056355695]}, "precision": 0.44786944696282865, "recall": 0.4494995450409463}, "group": {"f1": 0.5640022358859699, "f1_ci": {"90": [0.5448494589371451, 0.5843005073412731], "95": [0.5421339693259705, 0.5878924507524776]}, "precision": 0.48980582524271843, "recall": 0.6646903820816864}, "location": {"f1": 0.6620973269362577, "f1_ci": {"90": [0.6352623534621973, 0.690561115703398], "95": [0.6289274269426315, 0.6947830874588952]}, "precision": 0.6500672947510094, "recall": 0.6745810055865922}, "person": {"f1": 0.8104852993269572, "f1_ci": {"90": [0.799557380100791, 0.8217653397796916], "95": [0.7971684255110281, 0.8235506568956528]}, "precision": 0.7798227675528289, "recall": 0.8436578171091446}, "product": {"f1": 0.6715557883708747, "f1_ci": {"90": [0.6500796119207709, 0.6930743533068904], "95": [0.6454759597916919, 0.6962197964351413]}, "precision": 0.6840981856990395, "recall": 0.6594650205761317}}}, "2020.test": {"micro/f1": 0.6161290322580646, "micro/f1_ci": {"90": [0.5949692044423199, 0.6348133495240706], "95": [0.5906211738918474, 0.6387329419785034]}, "micro/recall": 0.5947067981318112, "micro/precision": 0.6391522587841606, "macro/f1": 0.5683990688463066, "macro/f1_ci": {"90": [0.5462082120303768, 0.5875745777633213], "95": [0.5437194741427591, 0.5916963455087217]}, "macro/recall": 0.5400218465464566, "macro/precision": 0.6097755448151788, "per_entity_metric": {"corporation": {"f1": 0.5423728813559322, "f1_ci": {"90": [0.48275862068965514, 0.5929934808499968], "95": [0.47023042714482405, 0.6019455599044377]}, "precision": 0.588957055214724, "recall": 0.5026178010471204}, "creative_work": {"f1": 0.4083044982698961, "f1_ci": {"90": [0.346557894572335, 0.46643109540636035], "95": [0.3343989071038251, 0.47619747899159665]}, "precision": 0.5363636363636364, "recall": 0.329608938547486}, "event": {"f1": 0.4333996023856858, "f1_ci": {"90": [0.38188421268382666, 0.4827709579914872], "95": [0.37525349684513126, 0.4931558836526215]}, "precision": 0.4579831932773109, "recall": 0.41132075471698115}, "group": {"f1": 0.5029761904761905, "f1_ci": {"90": [0.4562762107198253, 0.5490223970100132], "95": [0.44656489065498883, 0.5570021645021644]}, "precision": 0.46814404432132967, "recall": 0.5434083601286174}, "location": {"f1": 0.6455696202531647, "f1_ci": {"90": [0.5733723179930872, 0.7066023126161469], "95": [0.5611300842594408, 0.7190768823321695]}, "precision": 0.6754966887417219, "recall": 0.6181818181818182}, "person": {"f1": 0.8156797331109257, "f1_ci": {"90": [0.7894149420580739, 0.8392227413778143], "95": [0.7836139407658933, 0.842927744644483]}, "precision": 0.8109452736318408, "recall": 0.8204697986577181}, "product": {"f1": 0.6304909560723515, "f1_ci": {"90": [0.5734299459382219, 0.6784810126582278], "95": [0.5633052659716654, 0.6857142857142857]}, "precision": 0.7305389221556886, "recall": 0.5545454545454546}}}, "2021.test (span detection)": {"micro/f1": 0.7649656251746688, "micro/f1_ci": {}, "micro/recall": 0.7913727304267376, "micro/precision": 0.7402639549978365, "macro/f1": 0.7649656251746688, "macro/f1_ci": {}, "macro/recall": 0.7913727304267376, "macro/precision": 0.7402639549978365}, "2020.test (span detection)": {"micro/f1": 0.7446236559139785, "micro/f1_ci": {}, "micro/recall": 0.7187337830825117, "micro/precision": 0.7724484104852203, "macro/f1": 0.7446236559139785, "macro/f1_ci": {}, "macro/recall": 0.7187337830825117, "macro/precision": 0.7724484104852203}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6161290322580646, "micro/f1_ci": {"90": [0.5949692044423199, 0.6348133495240706], "95": [0.5906211738918474, 0.6387329419785034]}, "micro/recall": 0.5947067981318112, "micro/precision": 0.6391522587841606, "macro/f1": 0.5683990688463066, "macro/f1_ci": {"90": [0.5462082120303768, 0.5875745777633213], "95": [0.5437194741427591, 0.5916963455087217]}, "macro/recall": 0.5400218465464566, "macro/precision": 0.6097755448151788, "per_entity_metric": {"corporation": {"f1": 0.5423728813559322, "f1_ci": {"90": [0.48275862068965514, 0.5929934808499968], "95": [0.47023042714482405, 0.6019455599044377]}, "precision": 0.588957055214724, "recall": 0.5026178010471204}, "creative_work": {"f1": 0.4083044982698961, "f1_ci": {"90": [0.346557894572335, 0.46643109540636035], "95": [0.3343989071038251, 0.47619747899159665]}, "precision": 0.5363636363636364, "recall": 0.329608938547486}, "event": {"f1": 0.4333996023856858, "f1_ci": {"90": [0.38188421268382666, 0.4827709579914872], "95": [0.37525349684513126, 0.4931558836526215]}, "precision": 0.4579831932773109, "recall": 0.41132075471698115}, "group": {"f1": 0.5029761904761905, "f1_ci": {"90": [0.4562762107198253, 0.5490223970100132], "95": [0.44656489065498883, 0.5570021645021644]}, "precision": 0.46814404432132967, "recall": 0.5434083601286174}, "location": {"f1": 0.6455696202531647, "f1_ci": {"90": [0.5733723179930872, 0.7066023126161469], "95": [0.5611300842594408, 0.7190768823321695]}, "precision": 0.6754966887417219, "recall": 0.6181818181818182}, "person": {"f1": 0.8156797331109257, "f1_ci": {"90": [0.7894149420580739, 0.8392227413778143], "95": [0.7836139407658933, 0.842927744644483]}, "precision": 0.8109452736318408, "recall": 0.8204697986577181}, "product": {"f1": 0.6304909560723515, "f1_ci": {"90": [0.5734299459382219, 0.6784810126582278], "95": [0.5633052659716654, 0.6857142857142857]}, "precision": 0.7305389221556886, "recall": 0.5545454545454546}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6289961994187345, "micro/f1_ci": {"90": [0.6203286893040556, 0.6380714998883444], "95": [0.618788856392642, 0.6396755249087301]}, "micro/recall": 0.6506706753006476, "micro/precision": 0.6087191691908265, "macro/f1": 0.5812541319576294, "macro/f1_ci": {"90": [0.5718189466207007, 0.5907047023159696], "95": [0.570148090704244, 0.5931380949842975]}, "macro/recall": 0.5939651947848222, "macro/precision": 0.5735814298740157, "per_entity_metric": {"corporation": {"f1": 0.48868253047011023, "f1_ci": {"90": [0.4622326197034712, 0.5141309821972517], "95": [0.45822312966462947, 0.5197904004107121]}, "precision": 0.511543134872418, "recall": 0.4677777777777778}, "creative_work": {"f1": 0.42327272727272724, "f1_ci": {"90": [0.3913589008836675, 0.4552146375791695], "95": [0.3850330909993861, 0.4622114861898092]}, "precision": 0.4518633540372671, "recall": 0.39808481532147744}, "event": {"f1": 0.44868301544050865, "f1_ci": {"90": [0.42517128763823137, 0.47089546185055303], "95": [0.4216687641767551, 0.47516390056355695]}, "precision": 0.44786944696282865, "recall": 0.4494995450409463}, "group": {"f1": 0.5640022358859699, "f1_ci": {"90": [0.5448494589371451, 0.5843005073412731], "95": [0.5421339693259705, 0.5878924507524776]}, "precision": 0.48980582524271843, "recall": 0.6646903820816864}, "location": {"f1": 0.6620973269362577, "f1_ci": {"90": [0.6352623534621973, 0.690561115703398], "95": [0.6289274269426315, 0.6947830874588952]}, "precision": 0.6500672947510094, "recall": 0.6745810055865922}, "person": {"f1": 0.8104852993269572, "f1_ci": {"90": [0.799557380100791, 0.8217653397796916], "95": [0.7971684255110281, 0.8235506568956528]}, "precision": 0.7798227675528289, "recall": 0.8436578171091446}, "product": {"f1": 0.6715557883708747, "f1_ci": {"90": [0.6500796119207709, 0.6930743533068904], "95": [0.6454759597916919, 0.6962197964351413]}, "precision": 0.6840981856990395, "recall": 0.6594650205761317}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7446236559139785, "micro/f1_ci": {}, "micro/recall": 0.7187337830825117, "micro/precision": 0.7724484104852203, "macro/f1": 0.7446236559139785, "macro/f1_ci": {}, "macro/recall": 0.7187337830825117, "macro/precision": 0.7724484104852203}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7649656251746688, "micro/f1_ci": {}, "micro/recall": 0.7913727304267376, "micro/precision": 0.7402639549978365, "macro/f1": 0.7649656251746688, "macro/f1_ci": {}, "macro/recall": 0.7913727304267376, "macro/precision": 0.7402639549978365}
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": "vinai/bertweet-large", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 0.0001, "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": "vinai/bertweet-large", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 0.0001, "random_seed": 0, "gradient_accumulation_steps": 1, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.3, "max_grad_norm": 1}