asahi417 commited on
Commit
28f462f
1 Parent(s): 26b7487

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/twitter-roberta-base-dec2021-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.6511305152373794
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6512434933487565
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6510175763182239
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.6001624572691789
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5998564738871041
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6026065175267361
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7810548230395559
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7811451706188548
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7809644963571181
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.6491659830462128
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6861271676300578
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6159833938764919
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6069402050119113
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6442441821706234
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5785382402328414
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7582056892778994
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.8016194331983806
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7192527244421381
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/twitter-roberta-base-dec2021-tweetner7-2020-2021-continuous
88
+
89
+ This model is a fine-tuned version of [tner/twitter-roberta-base-dec2021-tweetner-2020](https://huggingface.co/tner/twitter-roberta-base-dec2021-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.6511305152373794
94
+ - Precision (micro): 0.6512434933487565
95
+ - Recall (micro): 0.6510175763182239
96
+ - F1 (macro): 0.6001624572691789
97
+ - Precision (macro): 0.5998564738871041
98
+ - Recall (macro): 0.6026065175267361
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5055066079295154
104
+ - creative_work: 0.47089601046435575
105
+ - event: 0.4448705656759348
106
+ - group: 0.6124532153793807
107
+ - location: 0.6592689295039165
108
+ - person: 0.8386047352250136
109
+ - product: 0.6695371367061357
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.642462096346594, 0.6609916755115764]
114
+ - 95%: [0.6408253162283987, 0.6624122690460243]
115
+ - F1 (macro):
116
+ - 90%: [0.642462096346594, 0.6609916755115764]
117
+ - 95%: [0.6408253162283987, 0.6624122690460243]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/twitter-roberta-base-dec2021-tweetner7-2020-2021-continuous/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/twitter-roberta-base-dec2021-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/twitter-roberta-base-dec2021-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/twitter-roberta-base-dec2021-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/twitter-roberta-base-dec2021-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.6554364471669218, "micro/f1_ci": {}, "micro/recall": 0.642, "micro/precision": 0.6694473409801877, "macro/f1": 0.6087510711295604, "macro/f1_ci": {}, "macro/recall": 0.5991010730868513, "macro/precision": 0.6218285105939485, "per_entity_metric": {"corporation": {"f1": 0.6108374384236452, "f1_ci": {}, "precision": 0.6138613861386139, "recall": 0.6078431372549019}, "creative_work": {"f1": 0.45751633986928103, "f1_ci": {}, "precision": 0.4430379746835443, "recall": 0.47297297297297297}, "event": {"f1": 0.40163934426229503, "f1_ci": {}, "precision": 0.4336283185840708, "recall": 0.37404580152671757}, "group": {"f1": 0.6305882352941177, "f1_ci": {}, "precision": 0.6767676767676768, "recall": 0.5903083700440529}, "location": {"f1": 0.6486486486486486, "f1_ci": {}, "precision": 0.631578947368421, "recall": 0.6666666666666666}, "person": {"f1": 0.845360824742268, "f1_ci": {}, "precision": 0.822742474916388, "recall": 0.8692579505300353}, "product": {"f1": 0.6666666666666666, "f1_ci": {}, "precision": 0.7311827956989247, "recall": 0.6126126126126126}}}, "2021.test": {"micro/f1": 0.6511305152373794, "micro/f1_ci": {"90": [0.642462096346594, 0.6609916755115764], "95": [0.6408253162283987, 0.6624122690460243]}, "micro/recall": 0.6510175763182239, "micro/precision": 0.6512434933487565, "macro/f1": 0.6001624572691789, "macro/f1_ci": {"90": [0.5901708847507007, 0.6097665575193055], "95": [0.5888565388821982, 0.6118037716085052]}, "macro/recall": 0.6026065175267361, "macro/precision": 0.5998564738871041, "per_entity_metric": {"corporation": {"f1": 0.5055066079295154, "f1_ci": {"90": [0.4795108259823577, 0.5314827844358865], "95": [0.47512205140935393, 0.5370951036754466]}, "precision": 0.5010917030567685, "recall": 0.51}, "creative_work": {"f1": 0.47089601046435575, "f1_ci": {"90": [0.4388153533937774, 0.5006399300719518], "95": [0.43339740347763767, 0.5075641025641026]}, "precision": 0.45112781954887216, "recall": 0.49247606019151846}, "event": {"f1": 0.4448705656759348, "f1_ci": {"90": [0.42021842980877167, 0.4694968412120253], "95": [0.4172649729995091, 0.47311864603972936]}, "precision": 0.47011144883485306, "recall": 0.4222020018198362}, "group": {"f1": 0.6124532153793807, "f1_ci": {"90": [0.5921133629458252, 0.6340167270391573], "95": [0.5880199080398861, 0.6392029295658258]}, "precision": 0.633356790992259, "recall": 0.5928853754940712}, "location": {"f1": 0.6592689295039165, "f1_ci": {"90": [0.6311301135283953, 0.6870809918170167], "95": [0.6245597506552384, 0.6916507734689553]}, "precision": 0.6188725490196079, "recall": 0.7053072625698324}, "person": {"f1": 0.8386047352250136, "f1_ci": {"90": [0.8283014185488987, 0.849145485613308], "95": [0.8264822934958931, 0.8509705657789103]}, "precision": 0.8224034030485643, "recall": 0.855457227138643}, "product": {"f1": 0.6695371367061357, "f1_ci": {"90": [0.6478977777349548, 0.690164987381028], "95": [0.6442664425770308, 0.6940732215736676]}, "precision": 0.7020316027088036, "recall": 0.6399176954732511}}}, "2020.test": {"micro/f1": 0.6491659830462128, "micro/f1_ci": {"90": [0.6280007201617593, 0.6678052877275604], "95": [0.6247949658941321, 0.6707378300649642]}, "micro/recall": 0.6159833938764919, "micro/precision": 0.6861271676300578, "macro/f1": 0.6069402050119113, "macro/f1_ci": {"90": [0.5829474424142466, 0.6260172030045239], "95": [0.5793951015223383, 0.6295893432029354]}, "macro/recall": 0.5785382402328414, "macro/precision": 0.6442441821706234, "per_entity_metric": {"corporation": {"f1": 0.5789473684210525, "f1_ci": {"90": [0.5207642393655372, 0.6353760012967892], "95": [0.5117579445571332, 0.6448522845546982]}, "precision": 0.582010582010582, "recall": 0.5759162303664922}, "creative_work": {"f1": 0.5443786982248521, "f1_ci": {"90": [0.48426502074133543, 0.5977857707711539], "95": [0.4738210862619808, 0.6085017655739433]}, "precision": 0.5786163522012578, "recall": 0.5139664804469274}, "event": {"f1": 0.4457593688362919, "f1_ci": {"90": [0.39509076082965866, 0.49660721529539203], "95": [0.38427644947900896, 0.5070749170346758]}, "precision": 0.4669421487603306, "recall": 0.42641509433962266}, "group": {"f1": 0.5426944971537002, "f1_ci": {"90": [0.4868301918138208, 0.5974094446853673], "95": [0.47702845288552664, 0.6059962546294038]}, "precision": 0.6620370370370371, "recall": 0.45980707395498394}, "location": {"f1": 0.6392961876832844, "f1_ci": {"90": [0.5677690275421404, 0.7015931566978687], "95": [0.5552227017200145, 0.7174627408215195]}, "precision": 0.6193181818181818, "recall": 0.6606060606060606}, "person": {"f1": 0.8376068376068376, "f1_ci": {"90": [0.8110208478648377, 0.8603842274653795], "95": [0.8048297410286258, 0.8660754340480075]}, "precision": 0.8536585365853658, "recall": 0.8221476510067114}, "product": {"f1": 0.6598984771573604, "f1_ci": {"90": [0.6068542290474638, 0.710933659227575], "95": [0.5948648648648649, 0.7219422734128618]}, "precision": 0.7471264367816092, "recall": 0.5909090909090909}}}, "2021.test (span detection)": {"micro/f1": 0.7810548230395559, "micro/f1_ci": {}, "micro/recall": 0.7809644963571181, "micro/precision": 0.7811451706188548, "macro/f1": 0.7810548230395559, "macro/f1_ci": {}, "macro/recall": 0.7809644963571181, "macro/precision": 0.7811451706188548}, "2020.test (span detection)": {"micro/f1": 0.7582056892778994, "micro/f1_ci": {}, "micro/recall": 0.7192527244421381, "micro/precision": 0.8016194331983806, "macro/f1": 0.7582056892778994, "macro/f1_ci": {}, "macro/recall": 0.7192527244421381, "macro/precision": 0.8016194331983806}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6491659830462128, "micro/f1_ci": {"90": [0.6280007201617593, 0.6678052877275604], "95": [0.6247949658941321, 0.6707378300649642]}, "micro/recall": 0.6159833938764919, "micro/precision": 0.6861271676300578, "macro/f1": 0.6069402050119113, "macro/f1_ci": {"90": [0.5829474424142466, 0.6260172030045239], "95": [0.5793951015223383, 0.6295893432029354]}, "macro/recall": 0.5785382402328414, "macro/precision": 0.6442441821706234, "per_entity_metric": {"corporation": {"f1": 0.5789473684210525, "f1_ci": {"90": [0.5207642393655372, 0.6353760012967892], "95": [0.5117579445571332, 0.6448522845546982]}, "precision": 0.582010582010582, "recall": 0.5759162303664922}, "creative_work": {"f1": 0.5443786982248521, "f1_ci": {"90": [0.48426502074133543, 0.5977857707711539], "95": [0.4738210862619808, 0.6085017655739433]}, "precision": 0.5786163522012578, "recall": 0.5139664804469274}, "event": {"f1": 0.4457593688362919, "f1_ci": {"90": [0.39509076082965866, 0.49660721529539203], "95": [0.38427644947900896, 0.5070749170346758]}, "precision": 0.4669421487603306, "recall": 0.42641509433962266}, "group": {"f1": 0.5426944971537002, "f1_ci": {"90": [0.4868301918138208, 0.5974094446853673], "95": [0.47702845288552664, 0.6059962546294038]}, "precision": 0.6620370370370371, "recall": 0.45980707395498394}, "location": {"f1": 0.6392961876832844, "f1_ci": {"90": [0.5677690275421404, 0.7015931566978687], "95": [0.5552227017200145, 0.7174627408215195]}, "precision": 0.6193181818181818, "recall": 0.6606060606060606}, "person": {"f1": 0.8376068376068376, "f1_ci": {"90": [0.8110208478648377, 0.8603842274653795], "95": [0.8048297410286258, 0.8660754340480075]}, "precision": 0.8536585365853658, "recall": 0.8221476510067114}, "product": {"f1": 0.6598984771573604, "f1_ci": {"90": [0.6068542290474638, 0.710933659227575], "95": [0.5948648648648649, 0.7219422734128618]}, "precision": 0.7471264367816092, "recall": 0.5909090909090909}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6511305152373794, "micro/f1_ci": {"90": [0.642462096346594, 0.6609916755115764], "95": [0.6408253162283987, 0.6624122690460243]}, "micro/recall": 0.6510175763182239, "micro/precision": 0.6512434933487565, "macro/f1": 0.6001624572691789, "macro/f1_ci": {"90": [0.5901708847507007, 0.6097665575193055], "95": [0.5888565388821982, 0.6118037716085052]}, "macro/recall": 0.6026065175267361, "macro/precision": 0.5998564738871041, "per_entity_metric": {"corporation": {"f1": 0.5055066079295154, "f1_ci": {"90": [0.4795108259823577, 0.5314827844358865], "95": [0.47512205140935393, 0.5370951036754466]}, "precision": 0.5010917030567685, "recall": 0.51}, "creative_work": {"f1": 0.47089601046435575, "f1_ci": {"90": [0.4388153533937774, 0.5006399300719518], "95": [0.43339740347763767, 0.5075641025641026]}, "precision": 0.45112781954887216, "recall": 0.49247606019151846}, "event": {"f1": 0.4448705656759348, "f1_ci": {"90": [0.42021842980877167, 0.4694968412120253], "95": [0.4172649729995091, 0.47311864603972936]}, "precision": 0.47011144883485306, "recall": 0.4222020018198362}, "group": {"f1": 0.6124532153793807, "f1_ci": {"90": [0.5921133629458252, 0.6340167270391573], "95": [0.5880199080398861, 0.6392029295658258]}, "precision": 0.633356790992259, "recall": 0.5928853754940712}, "location": {"f1": 0.6592689295039165, "f1_ci": {"90": [0.6311301135283953, 0.6870809918170167], "95": [0.6245597506552384, 0.6916507734689553]}, "precision": 0.6188725490196079, "recall": 0.7053072625698324}, "person": {"f1": 0.8386047352250136, "f1_ci": {"90": [0.8283014185488987, 0.849145485613308], "95": [0.8264822934958931, 0.8509705657789103]}, "precision": 0.8224034030485643, "recall": 0.855457227138643}, "product": {"f1": 0.6695371367061357, "f1_ci": {"90": [0.6478977777349548, 0.690164987381028], "95": [0.6442664425770308, 0.6940732215736676]}, "precision": 0.7020316027088036, "recall": 0.6399176954732511}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7582056892778994, "micro/f1_ci": {}, "micro/recall": 0.7192527244421381, "micro/precision": 0.8016194331983806, "macro/f1": 0.7582056892778994, "macro/f1_ci": {}, "macro/recall": 0.7192527244421381, "macro/precision": 0.8016194331983806}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7810548230395559, "micro/f1_ci": {}, "micro/recall": 0.7809644963571181, "micro/precision": 0.7811451706188548, "macro/f1": 0.7810548230395559, "macro/f1_ci": {}, "macro/recall": 0.7809644963571181, "macro/precision": 0.7811451706188548}
eval/prediction.2020.dev.json DELETED
The diff for this file is too large to render. See raw diff
 
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/twitter-roberta-base-dec2021-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/twitter-roberta-base-dec2021-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}