asahi417 commited on
Commit
99d8e91
1 Parent(s): 8d2df72

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-2019-90m-tweetner7-2020-2021-concat
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.6567966159826227
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6494460773230839
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6643154486586494
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.6099755599654287
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.602661693428744
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6189811354202427
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7888869833647745
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7800135654533122
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7979646120041632
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.6545553145336225
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6854060193072118
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6263622210690192
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6121643911579755
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6403532739362632
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5898647290448411
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7643070246813126
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.8005681818181818
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7311883757135443
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-2019-90m-tweetner7-2020-2021-concat
88
+
89
+ This model is a fine-tuned version of [cardiffnlp/twitter-roberta-base-2019-90m](https://huggingface.co/cardiffnlp/twitter-roberta-base-2019-90m) on the
90
+ [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset (`train_all` 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.6567966159826227
94
+ - Precision (micro): 0.6494460773230839
95
+ - Recall (micro): 0.6643154486586494
96
+ - F1 (macro): 0.6099755599654287
97
+ - Precision (macro): 0.602661693428744
98
+ - Recall (macro): 0.6189811354202427
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5087071240105541
104
+ - creative_work: 0.4729907773386035
105
+ - event: 0.48405253283302063
106
+ - group: 0.6147885050048434
107
+ - location: 0.679419525065963
108
+ - person: 0.83927591881514
109
+ - product: 0.6705945366898768
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.648368394653773, 0.6664006471768674]
114
+ - 95%: [0.646545111092117, 0.6680503208004025]
115
+ - F1 (macro):
116
+ - 90%: [0.648368394653773, 0.6664006471768674]
117
+ - 95%: [0.646545111092117, 0.6680503208004025]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/twitter-roberta-base-2019-90m-tweetner7-2020-2021-concat/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/twitter-roberta-base-2019-90m-tweetner7-2020-2021-concat/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-2019-90m-tweetner7-2020-2021-concat")
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_all
140
+ - dataset_name: None
141
+ - local_dataset: None
142
+ - model: cardiffnlp/twitter-roberta-base-2019-90m
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/twitter-roberta-base-2019-90m-tweetner7-2020-2021-concat/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.6393525543753161, "micro/f1_ci": {}, "micro/recall": 0.632, "micro/precision": 0.646878198567042, "macro/f1": 0.5955739662265487, "macro/f1_ci": {}, "macro/recall": 0.5933953061891987, "macro/precision": 0.6021591570769812, "per_entity_metric": {"corporation": {"f1": 0.6132075471698113, "f1_ci": {}, "precision": 0.5909090909090909, "recall": 0.6372549019607843}, "creative_work": {"f1": 0.4230769230769231, "f1_ci": {}, "precision": 0.4024390243902439, "recall": 0.44594594594594594}, "event": {"f1": 0.41004184100418406, "f1_ci": {}, "precision": 0.4537037037037037, "recall": 0.37404580152671757}, "group": {"f1": 0.6143497757847532, "f1_ci": {}, "precision": 0.6255707762557078, "recall": 0.6035242290748899}, "location": {"f1": 0.6405228758169934, "f1_ci": {}, "precision": 0.6049382716049383, "recall": 0.6805555555555556}, "person": {"f1": 0.8210526315789473, "f1_ci": {}, "precision": 0.8153310104529616, "recall": 0.8268551236749117}, "product": {"f1": 0.6467661691542289, "f1_ci": {}, "precision": 0.7222222222222222, "recall": 0.5855855855855856}}}, "2021.test": {"micro/f1": 0.6567966159826227, "micro/f1_ci": {"90": [0.648368394653773, 0.6664006471768674], "95": [0.646545111092117, 0.6680503208004025]}, "micro/recall": 0.6643154486586494, "micro/precision": 0.6494460773230839, "macro/f1": 0.6099755599654287, "macro/f1_ci": {"90": [0.5996849808261219, 0.6196609939303647], "95": [0.5981068219009371, 0.6213388278430806]}, "macro/recall": 0.6189811354202427, "macro/precision": 0.602661693428744, "per_entity_metric": {"corporation": {"f1": 0.5087071240105541, "f1_ci": {"90": [0.48418645598643384, 0.5346670166688542], "95": [0.4789882509840839, 0.5378380150591427]}, "precision": 0.4844221105527638, "recall": 0.5355555555555556}, "creative_work": {"f1": 0.4729907773386035, "f1_ci": {"90": [0.44239598560481413, 0.5042078308369256], "95": [0.43621394580304024, 0.510041651317275]}, "precision": 0.45616264294790343, "recall": 0.4911080711354309}, "event": {"f1": 0.48405253283302063, "f1_ci": {"90": [0.45995907383110685, 0.5078510542844324], "95": [0.4572237113916049, 0.5114127149849642]}, "precision": 0.4995159728944821, "recall": 0.4695177434030937}, "group": {"f1": 0.6147885050048434, "f1_ci": {"90": [0.5942964585813152, 0.6367114602499198], "95": [0.5886815262199213, 0.6417294334888041]}, "precision": 0.6029132362254591, "recall": 0.6271409749670619}, "location": {"f1": 0.679419525065963, "f1_ci": {"90": [0.6525572232398171, 0.7066645568922948], "95": [0.6461263147220855, 0.7104498210107556]}, "precision": 0.64375, "recall": 0.7192737430167597}, "person": {"f1": 0.83927591881514, "f1_ci": {"90": [0.8290404596313247, 0.8497318623631218], "95": [0.8264074120586163, 0.8510279929920115]}, "precision": 0.8324265505984766, "recall": 0.8462389380530974}, "product": {"f1": 0.6705945366898768, "f1_ci": {"90": [0.6480566067009147, 0.6920868989728419], "95": [0.6439099688540568, 0.6967782522764171]}, "precision": 0.6994413407821229, "recall": 0.6440329218106996}}}, "2020.test": {"micro/f1": 0.6545553145336225, "micro/f1_ci": {"90": [0.6337694636233485, 0.6740664541097675], "95": [0.6286942655715614, 0.6773336336898144]}, "micro/recall": 0.6263622210690192, "micro/precision": 0.6854060193072118, "macro/f1": 0.6121643911579755, "macro/f1_ci": {"90": [0.5886445730361866, 0.6317442192632546], "95": [0.5854534835525667, 0.6376447796836711]}, "macro/recall": 0.5898647290448411, "macro/precision": 0.6403532739362632, "per_entity_metric": {"corporation": {"f1": 0.5685279187817259, "f1_ci": {"90": [0.5082245989304813, 0.6205332894411982], "95": [0.49855067415904264, 0.6307356501580901]}, "precision": 0.5517241379310345, "recall": 0.5863874345549738}, "creative_work": {"f1": 0.5214899713467048, "f1_ci": {"90": [0.4615154306771073, 0.5762811565304089], "95": [0.4523527656187823, 0.5820755933952529]}, "precision": 0.5352941176470588, "recall": 0.5083798882681564}, "event": {"f1": 0.46680080482897385, "f1_ci": {"90": [0.4139061184152339, 0.5196369233051477], "95": [0.4056021681918053, 0.5302222222222222]}, "precision": 0.5, "recall": 0.4377358490566038}, "group": {"f1": 0.5668449197860962, "f1_ci": {"90": [0.5134957325746798, 0.6186378862301534], "95": [0.5024820823918631, 0.6271303331385156]}, "precision": 0.636, "recall": 0.5112540192926045}, "location": {"f1": 0.6510263929618768, "f1_ci": {"90": [0.5882352941176471, 0.711127694859038], "95": [0.5740167861420475, 0.7222263681592039]}, "precision": 0.6306818181818182, "recall": 0.6727272727272727}, "person": {"f1": 0.8454861111111112, "f1_ci": {"90": [0.8198943969474537, 0.8677685950413223], "95": [0.813751217094968, 0.8714086615122105]}, "precision": 0.8758992805755396, "recall": 0.8171140939597316}, "product": {"f1": 0.6649746192893401, "f1_ci": {"90": [0.6066754289322277, 0.7175162806745158], "95": [0.5919027721157766, 0.7241796440489434]}, "precision": 0.7528735632183908, "recall": 0.5954545454545455}}}, "2021.test (span detection)": {"micro/f1": 0.7888869833647745, "micro/f1_ci": {}, "micro/recall": 0.7979646120041632, "micro/precision": 0.7800135654533122, "macro/f1": 0.7888869833647745, "macro/f1_ci": {}, "macro/recall": 0.7979646120041632, "macro/precision": 0.7800135654533122}, "2020.test (span detection)": {"micro/f1": 0.7643070246813126, "micro/f1_ci": {}, "micro/recall": 0.7311883757135443, "micro/precision": 0.8005681818181818, "macro/f1": 0.7643070246813126, "macro/f1_ci": {}, "macro/recall": 0.7311883757135443, "macro/precision": 0.8005681818181818}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6545553145336225, "micro/f1_ci": {"90": [0.6337694636233485, 0.6740664541097675], "95": [0.6286942655715614, 0.6773336336898144]}, "micro/recall": 0.6263622210690192, "micro/precision": 0.6854060193072118, "macro/f1": 0.6121643911579755, "macro/f1_ci": {"90": [0.5886445730361866, 0.6317442192632546], "95": [0.5854534835525667, 0.6376447796836711]}, "macro/recall": 0.5898647290448411, "macro/precision": 0.6403532739362632, "per_entity_metric": {"corporation": {"f1": 0.5685279187817259, "f1_ci": {"90": [0.5082245989304813, 0.6205332894411982], "95": [0.49855067415904264, 0.6307356501580901]}, "precision": 0.5517241379310345, "recall": 0.5863874345549738}, "creative_work": {"f1": 0.5214899713467048, "f1_ci": {"90": [0.4615154306771073, 0.5762811565304089], "95": [0.4523527656187823, 0.5820755933952529]}, "precision": 0.5352941176470588, "recall": 0.5083798882681564}, "event": {"f1": 0.46680080482897385, "f1_ci": {"90": [0.4139061184152339, 0.5196369233051477], "95": [0.4056021681918053, 0.5302222222222222]}, "precision": 0.5, "recall": 0.4377358490566038}, "group": {"f1": 0.5668449197860962, "f1_ci": {"90": [0.5134957325746798, 0.6186378862301534], "95": [0.5024820823918631, 0.6271303331385156]}, "precision": 0.636, "recall": 0.5112540192926045}, "location": {"f1": 0.6510263929618768, "f1_ci": {"90": [0.5882352941176471, 0.711127694859038], "95": [0.5740167861420475, 0.7222263681592039]}, "precision": 0.6306818181818182, "recall": 0.6727272727272727}, "person": {"f1": 0.8454861111111112, "f1_ci": {"90": [0.8198943969474537, 0.8677685950413223], "95": [0.813751217094968, 0.8714086615122105]}, "precision": 0.8758992805755396, "recall": 0.8171140939597316}, "product": {"f1": 0.6649746192893401, "f1_ci": {"90": [0.6066754289322277, 0.7175162806745158], "95": [0.5919027721157766, 0.7241796440489434]}, "precision": 0.7528735632183908, "recall": 0.5954545454545455}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6567966159826227, "micro/f1_ci": {"90": [0.648368394653773, 0.6664006471768674], "95": [0.646545111092117, 0.6680503208004025]}, "micro/recall": 0.6643154486586494, "micro/precision": 0.6494460773230839, "macro/f1": 0.6099755599654287, "macro/f1_ci": {"90": [0.5996849808261219, 0.6196609939303647], "95": [0.5981068219009371, 0.6213388278430806]}, "macro/recall": 0.6189811354202427, "macro/precision": 0.602661693428744, "per_entity_metric": {"corporation": {"f1": 0.5087071240105541, "f1_ci": {"90": [0.48418645598643384, 0.5346670166688542], "95": [0.4789882509840839, 0.5378380150591427]}, "precision": 0.4844221105527638, "recall": 0.5355555555555556}, "creative_work": {"f1": 0.4729907773386035, "f1_ci": {"90": [0.44239598560481413, 0.5042078308369256], "95": [0.43621394580304024, 0.510041651317275]}, "precision": 0.45616264294790343, "recall": 0.4911080711354309}, "event": {"f1": 0.48405253283302063, "f1_ci": {"90": [0.45995907383110685, 0.5078510542844324], "95": [0.4572237113916049, 0.5114127149849642]}, "precision": 0.4995159728944821, "recall": 0.4695177434030937}, "group": {"f1": 0.6147885050048434, "f1_ci": {"90": [0.5942964585813152, 0.6367114602499198], "95": [0.5886815262199213, 0.6417294334888041]}, "precision": 0.6029132362254591, "recall": 0.6271409749670619}, "location": {"f1": 0.679419525065963, "f1_ci": {"90": [0.6525572232398171, 0.7066645568922948], "95": [0.6461263147220855, 0.7104498210107556]}, "precision": 0.64375, "recall": 0.7192737430167597}, "person": {"f1": 0.83927591881514, "f1_ci": {"90": [0.8290404596313247, 0.8497318623631218], "95": [0.8264074120586163, 0.8510279929920115]}, "precision": 0.8324265505984766, "recall": 0.8462389380530974}, "product": {"f1": 0.6705945366898768, "f1_ci": {"90": [0.6480566067009147, 0.6920868989728419], "95": [0.6439099688540568, 0.6967782522764171]}, "precision": 0.6994413407821229, "recall": 0.6440329218106996}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7643070246813126, "micro/f1_ci": {}, "micro/recall": 0.7311883757135443, "micro/precision": 0.8005681818181818, "macro/f1": 0.7643070246813126, "macro/f1_ci": {}, "macro/recall": 0.7311883757135443, "macro/precision": 0.8005681818181818}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7888869833647745, "micro/f1_ci": {}, "micro/recall": 0.7979646120041632, "micro/precision": 0.7800135654533122, "macro/f1": 0.7888869833647745, "macro/f1_ci": {}, "macro/recall": 0.7979646120041632, "macro/precision": 0.7800135654533122}
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": "2020_2021.train", "model": "cardiffnlp/twitter-roberta-base-2019-90m", "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_all", "dataset_name": null, "local_dataset": null, "model": "cardiffnlp/twitter-roberta-base-2019-90m", "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}