asahi417 commited on
Commit
711a6c3
1 Parent(s): 79b68b9

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-dec2020-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.655146764318819
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6484313059236607
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6620027752081407
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.60565538970149
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5978135601251405
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6152969312272543
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7802700846875715
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7722278853777325
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7884815542962877
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.6529060293318849
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6849002849002849
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6237675142708874
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6127864056494463
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6440791059118922
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5885664058069695
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7588267246061923
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.796011396011396
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.724961079398028
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-dec2020-tweetner7-2020-2021-continuous
88
+
89
+ This model is a fine-tuned version of [tner/twitter-roberta-base-dec2020-tweetner-2020](https://huggingface.co/tner/twitter-roberta-base-dec2020-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.655146764318819
94
+ - Precision (micro): 0.6484313059236607
95
+ - Recall (micro): 0.6620027752081407
96
+ - F1 (macro): 0.60565538970149
97
+ - Precision (macro): 0.5978135601251405
98
+ - Recall (macro): 0.6152969312272543
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5356371490280778
104
+ - creative_work: 0.4529526281635302
105
+ - event: 0.4692272096251735
106
+ - group: 0.610738255033557
107
+ - location: 0.6627831715210356
108
+ - person: 0.8433472499546196
109
+ - product: 0.6649020645844361
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.646485917836786, 0.6644401423537809]
114
+ - 95%: [0.6449507873997479, 0.6659444015725502]
115
+ - F1 (macro):
116
+ - 90%: [0.646485917836786, 0.6644401423537809]
117
+ - 95%: [0.6449507873997479, 0.6659444015725502]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/twitter-roberta-base-dec2020-tweetner7-2020-2021-continuous/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/twitter-roberta-base-dec2020-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-dec2020-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-dec2020-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.3
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-dec2020-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.6494949494949495, "micro/f1_ci": {}, "micro/recall": 0.643, "micro/precision": 0.6561224489795918, "macro/f1": 0.6068039027139369, "macro/f1_ci": {}, "macro/recall": 0.605166519640185, "macro/precision": 0.6118349239758869, "per_entity_metric": {"corporation": {"f1": 0.6176470588235294, "f1_ci": {}, "precision": 0.6176470588235294, "recall": 0.6176470588235294}, "creative_work": {"f1": 0.4713375796178344, "f1_ci": {}, "precision": 0.4457831325301205, "recall": 0.5}, "event": {"f1": 0.3951612903225807, "f1_ci": {}, "precision": 0.4188034188034188, "recall": 0.37404580152671757}, "group": {"f1": 0.6267281105990783, "f1_ci": {}, "precision": 0.6570048309178744, "recall": 0.5991189427312775}, "location": {"f1": 0.6233766233766234, "f1_ci": {}, "precision": 0.5853658536585366, "recall": 0.6666666666666666}, "person": {"f1": 0.8304498269896194, "f1_ci": {}, "precision": 0.8135593220338984, "recall": 0.8480565371024735}, "product": {"f1": 0.6829268292682927, "f1_ci": {}, "precision": 0.7446808510638298, "recall": 0.6306306306306306}}}, "2021.test": {"micro/f1": 0.655146764318819, "micro/f1_ci": {"90": [0.646485917836786, 0.6644401423537809], "95": [0.6449507873997479, 0.6659444015725502]}, "micro/recall": 0.6620027752081407, "micro/precision": 0.6484313059236607, "macro/f1": 0.60565538970149, "macro/f1_ci": {"90": [0.5958609226036335, 0.615029496768845], "95": [0.59347853460072, 0.6177128475619766]}, "macro/recall": 0.6152969312272543, "macro/precision": 0.5978135601251405, "per_entity_metric": {"corporation": {"f1": 0.5356371490280778, "f1_ci": {"90": [0.5114094871504585, 0.5608433653038019], "95": [0.5052604332153696, 0.5661445279866333]}, "precision": 0.5210084033613446, "recall": 0.5511111111111111}, "creative_work": {"f1": 0.4529526281635302, "f1_ci": {"90": [0.42236024844720493, 0.48234065608829313], "95": [0.4175525495344849, 0.48726058770701636]}, "precision": 0.4308641975308642, "recall": 0.4774281805745554}, "event": {"f1": 0.4692272096251735, "f1_ci": {"90": [0.44730383541051455, 0.4914571996286822], "95": [0.44300273768043796, 0.497628418609345]}, "precision": 0.4774011299435028, "recall": 0.46132848043676067}, "group": {"f1": 0.610738255033557, "f1_ci": {"90": [0.5911010424446823, 0.6317182638626475], "95": [0.587397323488694, 0.636247821945832]}, "precision": 0.6224350205198358, "recall": 0.5994729907773386}, "location": {"f1": 0.6627831715210356, "f1_ci": {"90": [0.6361094283387652, 0.6906877216895649], "95": [0.6284165623933567, 0.6944596639532455]}, "precision": 0.617611580217129, "recall": 0.7150837988826816}, "person": {"f1": 0.8433472499546196, "f1_ci": {"90": [0.8330629714737499, 0.8537574855967393], "95": [0.8310271369505687, 0.8553120874462692]}, "precision": 0.8305327136217375, "recall": 0.8565634218289085}, "product": {"f1": 0.6649020645844361, "f1_ci": {"90": [0.6436639052703277, 0.6861324260947763], "95": [0.639253505828489, 0.6900270969352551]}, "precision": 0.6848418756815703, "recall": 0.6460905349794238}}}, "2020.test": {"micro/f1": 0.6529060293318849, "micro/f1_ci": {"90": [0.6320560339514061, 0.6714840239575703], "95": [0.6277113779725418, 0.6759792334494775]}, "micro/recall": 0.6237675142708874, "micro/precision": 0.6849002849002849, "macro/f1": 0.6127864056494463, "macro/f1_ci": {"90": [0.5897169937547521, 0.6334131005387055], "95": [0.5857108200385485, 0.6376942274138916]}, "macro/recall": 0.5885664058069695, "macro/precision": 0.6440791059118922, "per_entity_metric": {"corporation": {"f1": 0.5925925925925924, "f1_ci": {"90": [0.533721414937729, 0.6480675262204496], "95": [0.5207716966045063, 0.6541185932818168]}, "precision": 0.5989304812834224, "recall": 0.5863874345549738}, "creative_work": {"f1": 0.5558739255014327, "f1_ci": {"90": [0.4984564943253468, 0.607918557688304], "95": [0.4885970084990079, 0.6177219060891107]}, "precision": 0.5705882352941176, "recall": 0.5418994413407822}, "event": {"f1": 0.4383561643835617, "f1_ci": {"90": [0.3847710023194851, 0.48764285714285716], "95": [0.37720025056234163, 0.49720332993010286]}, "precision": 0.45528455284552843, "recall": 0.4226415094339623}, "group": {"f1": 0.5437616387337058, "f1_ci": {"90": [0.48760765869239764, 0.5993162024857116], "95": [0.47615165631469974, 0.6082547602450746]}, "precision": 0.6460176991150443, "recall": 0.4694533762057878}, "location": {"f1": 0.641399416909621, "f1_ci": {"90": [0.5723443613683027, 0.7030686612965094], "95": [0.5566328196906268, 0.7147551120186363]}, "precision": 0.6179775280898876, "recall": 0.6666666666666666}, "person": {"f1": 0.8407534246575342, "f1_ci": {"90": [0.8133493861413243, 0.8663783854306567], "95": [0.8073137196568275, 0.8716676932880203]}, "precision": 0.8583916083916084, "recall": 0.8238255033557047}, "product": {"f1": 0.6767676767676768, "f1_ci": {"90": [0.6232405642394205, 0.7267706131078224], "95": [0.6133611279563371, 0.7349278036430734]}, "precision": 0.7613636363636364, "recall": 0.6090909090909091}}}, "2021.test (span detection)": {"micro/f1": 0.7802700846875715, "micro/f1_ci": {}, "micro/recall": 0.7884815542962877, "micro/precision": 0.7722278853777325, "macro/f1": 0.7802700846875715, "macro/f1_ci": {}, "macro/recall": 0.7884815542962877, "macro/precision": 0.7722278853777325}, "2020.test (span detection)": {"micro/f1": 0.7588267246061923, "micro/f1_ci": {}, "micro/recall": 0.724961079398028, "micro/precision": 0.796011396011396, "macro/f1": 0.7588267246061923, "macro/f1_ci": {}, "macro/recall": 0.724961079398028, "macro/precision": 0.796011396011396}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6529060293318849, "micro/f1_ci": {"90": [0.6320560339514061, 0.6714840239575703], "95": [0.6277113779725418, 0.6759792334494775]}, "micro/recall": 0.6237675142708874, "micro/precision": 0.6849002849002849, "macro/f1": 0.6127864056494463, "macro/f1_ci": {"90": [0.5897169937547521, 0.6334131005387055], "95": [0.5857108200385485, 0.6376942274138916]}, "macro/recall": 0.5885664058069695, "macro/precision": 0.6440791059118922, "per_entity_metric": {"corporation": {"f1": 0.5925925925925924, "f1_ci": {"90": [0.533721414937729, 0.6480675262204496], "95": [0.5207716966045063, 0.6541185932818168]}, "precision": 0.5989304812834224, "recall": 0.5863874345549738}, "creative_work": {"f1": 0.5558739255014327, "f1_ci": {"90": [0.4984564943253468, 0.607918557688304], "95": [0.4885970084990079, 0.6177219060891107]}, "precision": 0.5705882352941176, "recall": 0.5418994413407822}, "event": {"f1": 0.4383561643835617, "f1_ci": {"90": [0.3847710023194851, 0.48764285714285716], "95": [0.37720025056234163, 0.49720332993010286]}, "precision": 0.45528455284552843, "recall": 0.4226415094339623}, "group": {"f1": 0.5437616387337058, "f1_ci": {"90": [0.48760765869239764, 0.5993162024857116], "95": [0.47615165631469974, 0.6082547602450746]}, "precision": 0.6460176991150443, "recall": 0.4694533762057878}, "location": {"f1": 0.641399416909621, "f1_ci": {"90": [0.5723443613683027, 0.7030686612965094], "95": [0.5566328196906268, 0.7147551120186363]}, "precision": 0.6179775280898876, "recall": 0.6666666666666666}, "person": {"f1": 0.8407534246575342, "f1_ci": {"90": [0.8133493861413243, 0.8663783854306567], "95": [0.8073137196568275, 0.8716676932880203]}, "precision": 0.8583916083916084, "recall": 0.8238255033557047}, "product": {"f1": 0.6767676767676768, "f1_ci": {"90": [0.6232405642394205, 0.7267706131078224], "95": [0.6133611279563371, 0.7349278036430734]}, "precision": 0.7613636363636364, "recall": 0.6090909090909091}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.655146764318819, "micro/f1_ci": {"90": [0.646485917836786, 0.6644401423537809], "95": [0.6449507873997479, 0.6659444015725502]}, "micro/recall": 0.6620027752081407, "micro/precision": 0.6484313059236607, "macro/f1": 0.60565538970149, "macro/f1_ci": {"90": [0.5958609226036335, 0.615029496768845], "95": [0.59347853460072, 0.6177128475619766]}, "macro/recall": 0.6152969312272543, "macro/precision": 0.5978135601251405, "per_entity_metric": {"corporation": {"f1": 0.5356371490280778, "f1_ci": {"90": [0.5114094871504585, 0.5608433653038019], "95": [0.5052604332153696, 0.5661445279866333]}, "precision": 0.5210084033613446, "recall": 0.5511111111111111}, "creative_work": {"f1": 0.4529526281635302, "f1_ci": {"90": [0.42236024844720493, 0.48234065608829313], "95": [0.4175525495344849, 0.48726058770701636]}, "precision": 0.4308641975308642, "recall": 0.4774281805745554}, "event": {"f1": 0.4692272096251735, "f1_ci": {"90": [0.44730383541051455, 0.4914571996286822], "95": [0.44300273768043796, 0.497628418609345]}, "precision": 0.4774011299435028, "recall": 0.46132848043676067}, "group": {"f1": 0.610738255033557, "f1_ci": {"90": [0.5911010424446823, 0.6317182638626475], "95": [0.587397323488694, 0.636247821945832]}, "precision": 0.6224350205198358, "recall": 0.5994729907773386}, "location": {"f1": 0.6627831715210356, "f1_ci": {"90": [0.6361094283387652, 0.6906877216895649], "95": [0.6284165623933567, 0.6944596639532455]}, "precision": 0.617611580217129, "recall": 0.7150837988826816}, "person": {"f1": 0.8433472499546196, "f1_ci": {"90": [0.8330629714737499, 0.8537574855967393], "95": [0.8310271369505687, 0.8553120874462692]}, "precision": 0.8305327136217375, "recall": 0.8565634218289085}, "product": {"f1": 0.6649020645844361, "f1_ci": {"90": [0.6436639052703277, 0.6861324260947763], "95": [0.639253505828489, 0.6900270969352551]}, "precision": 0.6848418756815703, "recall": 0.6460905349794238}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7588267246061923, "micro/f1_ci": {}, "micro/recall": 0.724961079398028, "micro/precision": 0.796011396011396, "macro/f1": 0.7588267246061923, "macro/f1_ci": {}, "macro/recall": 0.724961079398028, "macro/precision": 0.796011396011396}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7802700846875715, "micro/f1_ci": {}, "micro/recall": 0.7884815542962877, "micro/precision": 0.7722278853777325, "macro/f1": 0.7802700846875715, "macro/f1_ci": {}, "macro/recall": 0.7884815542962877, "macro/precision": 0.7722278853777325}
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-dec2020-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.3, "max_grad_norm": 1}
 
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train_2021", "dataset_name": null, "local_dataset": null, "model": "tner/twitter-roberta-base-dec2020-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.3, "max_grad_norm": 1}