asahi417 commited on
Commit
d29ec07
1 Parent(s): 743ab58

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-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.6641431520991053
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6588529813381885
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6695189639222942
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.6165782134695219
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.6102975783874098
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6256153624327598
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7896759392027531
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.783340919435594
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7961142592806754
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.6587912087912088
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6999416228838296
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6222106901920083
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6182374585427982
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6571485734047059
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5865594344408018
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7641561297416162
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.8123904149620105
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7213284898806435
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-2020-2021-continuous
88
+
89
+ This model is a fine-tuned version of [tner/bertweet-large-tweetner-2020](https://huggingface.co/tner/bertweet-large-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.6641431520991053
94
+ - Precision (micro): 0.6588529813381885
95
+ - Recall (micro): 0.6695189639222942
96
+ - F1 (macro): 0.6165782134695219
97
+ - Precision (macro): 0.6102975783874098
98
+ - Recall (macro): 0.6256153624327598
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5507246376811594
104
+ - creative_work: 0.4684914067472947
105
+ - event: 0.4815724815724816
106
+ - group: 0.6143572621035058
107
+ - location: 0.6886731391585761
108
+ - person: 0.8404178674351586
109
+ - product: 0.6718106995884774
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6551977421192867, 0.6726790034801573]
114
+ - 95%: [0.6537478870999098, 0.6745822333244045]
115
+ - F1 (macro):
116
+ - 90%: [0.6551977421192867, 0.6726790034801573]
117
+ - 95%: [0.6537478870999098, 0.6745822333244045]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/bertweet-large-tweetner7-2020-2021-continuous/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/bertweet-large-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-large-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-large-tweetner-2020
143
+ - crf: True
144
+ - max_length: 128
145
+ - epoch: 30
146
+ - batch_size: 32
147
+ - lr: 1e-06
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/bertweet-large-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.6532663316582915, "micro/f1_ci": {}, "micro/recall": 0.65, "micro/precision": 0.6565656565656566, "macro/f1": 0.6130509850715328, "macro/f1_ci": {}, "macro/recall": 0.615356967051296, "macro/precision": 0.613081734826762, "per_entity_metric": {"corporation": {"f1": 0.5904761904761905, "f1_ci": {}, "precision": 0.5740740740740741, "recall": 0.6078431372549019}, "creative_work": {"f1": 0.49673202614379086, "f1_ci": {}, "precision": 0.4810126582278481, "recall": 0.5135135135135135}, "event": {"f1": 0.4170212765957447, "f1_ci": {}, "precision": 0.47115384615384615, "recall": 0.37404580152671757}, "group": {"f1": 0.618510158013544, "f1_ci": {}, "precision": 0.6342592592592593, "recall": 0.6035242290748899}, "location": {"f1": 0.6845637583892618, "f1_ci": {}, "precision": 0.6623376623376623, "recall": 0.7083333333333334}, "person": {"f1": 0.8324697754749568, "f1_ci": {}, "precision": 0.8141891891891891, "recall": 0.8515901060070671}, "product": {"f1": 0.6515837104072398, "f1_ci": {}, "precision": 0.6545454545454545, "recall": 0.6486486486486487}}}, "2021.test": {"micro/f1": 0.6641431520991053, "micro/f1_ci": {"90": [0.6551977421192867, 0.6726790034801573], "95": [0.6537478870999098, 0.6745822333244045]}, "micro/recall": 0.6695189639222942, "micro/precision": 0.6588529813381885, "macro/f1": 0.6165782134695219, "macro/f1_ci": {"90": [0.6067197256596341, 0.6256044510960733], "95": [0.6051019712561241, 0.6272725844616904]}, "macro/recall": 0.6256153624327598, "macro/precision": 0.6102975783874098, "per_entity_metric": {"corporation": {"f1": 0.5507246376811594, "f1_ci": {"90": [0.5254082699108996, 0.5773166181256275], "95": [0.5208478779438392, 0.5823103234936461]}, "precision": 0.5525727069351231, "recall": 0.5488888888888889}, "creative_work": {"f1": 0.4684914067472947, "f1_ci": {"90": [0.43769556974104906, 0.4987696892294594], "95": [0.4306276297645928, 0.503900885472692]}, "precision": 0.4380952380952381, "recall": 0.5034199726402189}, "event": {"f1": 0.4815724815724816, "f1_ci": {"90": [0.45748383888612637, 0.5051356400612352], "95": [0.453626352887228, 0.5078142035880663]}, "precision": 0.5235042735042735, "recall": 0.445859872611465}, "group": {"f1": 0.6143572621035058, "f1_ci": {"90": [0.5931312033684751, 0.6362758250713497], "95": [0.5898185538332443, 0.640990290362259]}, "precision": 0.6228842247799594, "recall": 0.6060606060606061}, "location": {"f1": 0.6886731391585761, "f1_ci": {"90": [0.6638351146228115, 0.7148122115942915], "95": [0.6584092995447562, 0.7185025217834956]}, "precision": 0.6417370325693607, "recall": 0.7430167597765364}, "person": {"f1": 0.8404178674351586, "f1_ci": {"90": [0.8298100715749012, 0.8504605055787255], "95": [0.828366934999076, 0.851877851877852]}, "precision": 0.8214788732394366, "recall": 0.8602507374631269}, "product": {"f1": 0.6718106995884774, "f1_ci": {"90": [0.65082156900923, 0.6922712449645116], "95": [0.6453161615534301, 0.6960348412597874]}, "precision": 0.6718106995884774, "recall": 0.6718106995884774}}}, "2020.test": {"micro/f1": 0.6587912087912088, "micro/f1_ci": {"90": [0.6388349564310538, 0.6775372411164946], "95": [0.6347700739178536, 0.6817724596099083]}, "micro/recall": 0.6222106901920083, "micro/precision": 0.6999416228838296, "macro/f1": 0.6182374585427982, "macro/f1_ci": {"90": [0.5956469999846385, 0.6396562173710457], "95": [0.5924717479435003, 0.643052479903031]}, "macro/recall": 0.5865594344408018, "macro/precision": 0.6571485734047059, "per_entity_metric": {"corporation": {"f1": 0.5837837837837839, "f1_ci": {"90": [0.5257238173647558, 0.6340269047020367], "95": [0.5147848132574822, 0.6415194434712977]}, "precision": 0.6033519553072626, "recall": 0.5654450261780105}, "creative_work": {"f1": 0.5464788732394367, "f1_ci": {"90": [0.4858406810117715, 0.6012249962680998], "95": [0.4752830687830688, 0.6118356854309848]}, "precision": 0.5511363636363636, "recall": 0.5418994413407822}, "event": {"f1": 0.4612244897959184, "f1_ci": {"90": [0.40925298655360004, 0.5121951219512195], "95": [0.4, 0.5224982057102179]}, "precision": 0.5022222222222222, "recall": 0.42641509433962266}, "group": {"f1": 0.5639097744360902, "f1_ci": {"90": [0.5085325152068667, 0.6129582440493426], "95": [0.4999765478424015, 0.6242067115955933]}, "precision": 0.6787330316742082, "recall": 0.48231511254019294}, "location": {"f1": 0.6666666666666666, "f1_ci": {"90": [0.5992845117845118, 0.725033185840708], "95": [0.5871509772636617, 0.7378266550522647]}, "precision": 0.6792452830188679, "recall": 0.6545454545454545}, "person": {"f1": 0.8389319552110249, "f1_ci": {"90": [0.8120086435076491, 0.8618636353151934], "95": [0.8049340069594505, 0.8669009775259731]}, "precision": 0.8619469026548673, "recall": 0.8171140939597316}, "product": {"f1": 0.6666666666666667, "f1_ci": {"90": [0.6168948944597402, 0.7127101210767604], "95": [0.604633351992265, 0.7208783153405305]}, "precision": 0.723404255319149, "recall": 0.6181818181818182}}}, "2021.test (span detection)": {"micro/f1": 0.7896759392027531, "micro/f1_ci": {}, "micro/recall": 0.7961142592806754, "micro/precision": 0.783340919435594, "macro/f1": 0.7896759392027531, "macro/f1_ci": {}, "macro/recall": 0.7961142592806754, "macro/precision": 0.783340919435594}, "2020.test (span detection)": {"micro/f1": 0.7641561297416162, "micro/f1_ci": {}, "micro/recall": 0.7213284898806435, "micro/precision": 0.8123904149620105, "macro/f1": 0.7641561297416162, "macro/f1_ci": {}, "macro/recall": 0.7213284898806435, "macro/precision": 0.8123904149620105}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6587912087912088, "micro/f1_ci": {"90": [0.6388349564310538, 0.6775372411164946], "95": [0.6347700739178536, 0.6817724596099083]}, "micro/recall": 0.6222106901920083, "micro/precision": 0.6999416228838296, "macro/f1": 0.6182374585427982, "macro/f1_ci": {"90": [0.5956469999846385, 0.6396562173710457], "95": [0.5924717479435003, 0.643052479903031]}, "macro/recall": 0.5865594344408018, "macro/precision": 0.6571485734047059, "per_entity_metric": {"corporation": {"f1": 0.5837837837837839, "f1_ci": {"90": [0.5257238173647558, 0.6340269047020367], "95": [0.5147848132574822, 0.6415194434712977]}, "precision": 0.6033519553072626, "recall": 0.5654450261780105}, "creative_work": {"f1": 0.5464788732394367, "f1_ci": {"90": [0.4858406810117715, 0.6012249962680998], "95": [0.4752830687830688, 0.6118356854309848]}, "precision": 0.5511363636363636, "recall": 0.5418994413407822}, "event": {"f1": 0.4612244897959184, "f1_ci": {"90": [0.40925298655360004, 0.5121951219512195], "95": [0.4, 0.5224982057102179]}, "precision": 0.5022222222222222, "recall": 0.42641509433962266}, "group": {"f1": 0.5639097744360902, "f1_ci": {"90": [0.5085325152068667, 0.6129582440493426], "95": [0.4999765478424015, 0.6242067115955933]}, "precision": 0.6787330316742082, "recall": 0.48231511254019294}, "location": {"f1": 0.6666666666666666, "f1_ci": {"90": [0.5992845117845118, 0.725033185840708], "95": [0.5871509772636617, 0.7378266550522647]}, "precision": 0.6792452830188679, "recall": 0.6545454545454545}, "person": {"f1": 0.8389319552110249, "f1_ci": {"90": [0.8120086435076491, 0.8618636353151934], "95": [0.8049340069594505, 0.8669009775259731]}, "precision": 0.8619469026548673, "recall": 0.8171140939597316}, "product": {"f1": 0.6666666666666667, "f1_ci": {"90": [0.6168948944597402, 0.7127101210767604], "95": [0.604633351992265, 0.7208783153405305]}, "precision": 0.723404255319149, "recall": 0.6181818181818182}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6641431520991053, "micro/f1_ci": {"90": [0.6551977421192867, 0.6726790034801573], "95": [0.6537478870999098, 0.6745822333244045]}, "micro/recall": 0.6695189639222942, "micro/precision": 0.6588529813381885, "macro/f1": 0.6165782134695219, "macro/f1_ci": {"90": [0.6067197256596341, 0.6256044510960733], "95": [0.6051019712561241, 0.6272725844616904]}, "macro/recall": 0.6256153624327598, "macro/precision": 0.6102975783874098, "per_entity_metric": {"corporation": {"f1": 0.5507246376811594, "f1_ci": {"90": [0.5254082699108996, 0.5773166181256275], "95": [0.5208478779438392, 0.5823103234936461]}, "precision": 0.5525727069351231, "recall": 0.5488888888888889}, "creative_work": {"f1": 0.4684914067472947, "f1_ci": {"90": [0.43769556974104906, 0.4987696892294594], "95": [0.4306276297645928, 0.503900885472692]}, "precision": 0.4380952380952381, "recall": 0.5034199726402189}, "event": {"f1": 0.4815724815724816, "f1_ci": {"90": [0.45748383888612637, 0.5051356400612352], "95": [0.453626352887228, 0.5078142035880663]}, "precision": 0.5235042735042735, "recall": 0.445859872611465}, "group": {"f1": 0.6143572621035058, "f1_ci": {"90": [0.5931312033684751, 0.6362758250713497], "95": [0.5898185538332443, 0.640990290362259]}, "precision": 0.6228842247799594, "recall": 0.6060606060606061}, "location": {"f1": 0.6886731391585761, "f1_ci": {"90": [0.6638351146228115, 0.7148122115942915], "95": [0.6584092995447562, 0.7185025217834956]}, "precision": 0.6417370325693607, "recall": 0.7430167597765364}, "person": {"f1": 0.8404178674351586, "f1_ci": {"90": [0.8298100715749012, 0.8504605055787255], "95": [0.828366934999076, 0.851877851877852]}, "precision": 0.8214788732394366, "recall": 0.8602507374631269}, "product": {"f1": 0.6718106995884774, "f1_ci": {"90": [0.65082156900923, 0.6922712449645116], "95": [0.6453161615534301, 0.6960348412597874]}, "precision": 0.6718106995884774, "recall": 0.6718106995884774}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7641561297416162, "micro/f1_ci": {}, "micro/recall": 0.7213284898806435, "micro/precision": 0.8123904149620105, "macro/f1": 0.7641561297416162, "macro/f1_ci": {}, "macro/recall": 0.7213284898806435, "macro/precision": 0.8123904149620105}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7896759392027531, "micro/f1_ci": {}, "micro/recall": 0.7961142592806754, "micro/precision": 0.783340919435594, "macro/f1": 0.7896759392027531, "macro/f1_ci": {}, "macro/recall": 0.7961142592806754, "macro/precision": 0.783340919435594}
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-large-tweetner-2020", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 1e-06, "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/bertweet-large-tweetner-2020", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 1e-06, "random_seed": 0, "gradient_accumulation_steps": 1, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.15, "max_grad_norm": 1}