asahi417 commited on
Commit
4446b7b
1 Parent(s): a9d36a5

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/bert-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.6319818203564167
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6544463710676245
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6110083256244219
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5766988664971804
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.601237684920777
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.5559244768648601
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7603780356501973
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7875108412836079
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7350526194055742
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.6247533126585846
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6839506172839506
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.5749870264660093
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.578717595313749
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6410778727928796
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5301549277792547
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7245559627854524
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7932098765432098
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.6668396471198754
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/bert-large-tweetner7-2020-2021-continuous
88
+
89
+ This model is a fine-tuned version of [tner/bert-large-tweetner-2020](https://huggingface.co/tner/bert-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.6319818203564167
94
+ - Precision (micro): 0.6544463710676245
95
+ - Recall (micro): 0.6110083256244219
96
+ - F1 (macro): 0.5766988664971804
97
+ - Precision (macro): 0.601237684920777
98
+ - Recall (macro): 0.5559244768648601
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.514024041213509
104
+ - creative_work: 0.39736070381231675
105
+ - event: 0.42546740778170794
106
+ - group: 0.5859649122807017
107
+ - location: 0.6335664335664336
108
+ - person: 0.8127490039840638
109
+ - product: 0.6677595628415302
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6231013705127983, 0.6413574593408826]
114
+ - 95%: [0.6217502353949177, 0.6428942705896876]
115
+ - F1 (macro):
116
+ - 90%: [0.6231013705127983, 0.6413574593408826]
117
+ - 95%: [0.6217502353949177, 0.6428942705896876]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/bert-large-tweetner7-2020-2021-continuous/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/bert-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/bert-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/bert-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.3
152
+ - max_grad_norm: 1
153
+
154
+ The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/bert-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.6307053941908715, "micro/f1_ci": {}, "micro/recall": 0.608, "micro/precision": 0.6551724137931034, "macro/f1": 0.5769830109938662, "macro/f1_ci": {}, "macro/recall": 0.5541914611675349, "macro/precision": 0.6061513565180056, "per_entity_metric": {"corporation": {"f1": 0.5797101449275363, "f1_ci": {}, "precision": 0.5714285714285714, "recall": 0.5882352941176471}, "creative_work": {"f1": 0.41428571428571426, "f1_ci": {}, "precision": 0.4393939393939394, "recall": 0.3918918918918919}, "event": {"f1": 0.34632034632034636, "f1_ci": {}, "precision": 0.4, "recall": 0.3053435114503817}, "group": {"f1": 0.6273584905660378, "f1_ci": {}, "precision": 0.6751269035532995, "recall": 0.5859030837004405}, "location": {"f1": 0.6176470588235293, "f1_ci": {}, "precision": 0.65625, "recall": 0.5833333333333334}, "person": {"f1": 0.8135593220338982, "f1_ci": {}, "precision": 0.7817589576547231, "recall": 0.8480565371024735}, "product": {"f1": 0.6400000000000001, "f1_ci": {}, "precision": 0.7191011235955056, "recall": 0.5765765765765766}}}, "2021.test": {"micro/f1": 0.6319818203564167, "micro/f1_ci": {"90": [0.6231013705127983, 0.6413574593408826], "95": [0.6217502353949177, 0.6428942705896876]}, "micro/recall": 0.6110083256244219, "micro/precision": 0.6544463710676245, "macro/f1": 0.5766988664971804, "macro/f1_ci": {"90": [0.5664509989359489, 0.5863507925127135], "95": [0.5648974825471297, 0.5879845963012866]}, "macro/recall": 0.5559244768648601, "macro/precision": 0.601237684920777, "per_entity_metric": {"corporation": {"f1": 0.514024041213509, "f1_ci": {"90": [0.48777635327635327, 0.5386428764634433], "95": [0.48256682507571314, 0.5427950687007129]}, "precision": 0.5301062573789846, "recall": 0.4988888888888889}, "creative_work": {"f1": 0.39736070381231675, "f1_ci": {"90": [0.3673069143565192, 0.4290928789350539], "95": [0.35964709226770636, 0.43496810207336517]}, "precision": 0.42812006319115326, "recall": 0.3707250341997264}, "event": {"f1": 0.42546740778170794, "f1_ci": {"90": [0.40080966868711565, 0.4504934716037546], "95": [0.3947971875592656, 0.45604206362953986]}, "precision": 0.4784090909090909, "recall": 0.3830755232029117}, "group": {"f1": 0.5859649122807017, "f1_ci": {"90": [0.5649910032383042, 0.608005869697348], "95": [0.5609718872903313, 0.6137378755305175]}, "precision": 0.6268768768768769, "recall": 0.5500658761528326}, "location": {"f1": 0.6335664335664336, "f1_ci": {"90": [0.6022469573815304, 0.662564426082152], "95": [0.5972619047619048, 0.6684591503346138]}, "precision": 0.634453781512605, "recall": 0.63268156424581}, "person": {"f1": 0.8127490039840638, "f1_ci": {"90": [0.8007926572866582, 0.8249959351621283], "95": [0.7984037478689154, 0.8268196857132452]}, "precision": 0.798576512455516, "recall": 0.827433628318584}, "product": {"f1": 0.6677595628415302, "f1_ci": {"90": [0.6464189850752727, 0.6878997822678681], "95": [0.6421587454017522, 0.6913517415533396]}, "precision": 0.7121212121212122, "recall": 0.6286008230452675}}}, "2020.test": {"micro/f1": 0.6247533126585846, "micro/f1_ci": {"90": [0.6028688973562135, 0.64588834464267], "95": [0.5994344280959615, 0.649232518476407]}, "micro/recall": 0.5749870264660093, "micro/precision": 0.6839506172839506, "macro/f1": 0.578717595313749, "macro/f1_ci": {"90": [0.5540098280773577, 0.6005537196979407], "95": [0.5512954123930293, 0.6060087044874898]}, "macro/recall": 0.5301549277792547, "macro/precision": 0.6410778727928796, "per_entity_metric": {"corporation": {"f1": 0.565597667638484, "f1_ci": {"90": [0.5050505050505051, 0.6224819178391817], "95": [0.4969315627024349, 0.6306885822510823]}, "precision": 0.6381578947368421, "recall": 0.5078534031413613}, "creative_work": {"f1": 0.4364820846905538, "f1_ci": {"90": [0.3723977546110665, 0.4983818770226537], "95": [0.36299049637405206, 0.515419097575336]}, "precision": 0.5234375, "recall": 0.3743016759776536}, "event": {"f1": 0.45508982035928147, "f1_ci": {"90": [0.4049049185589344, 0.5067778692762893], "95": [0.3923199130398428, 0.5195618366745284]}, "precision": 0.4830508474576271, "recall": 0.43018867924528303}, "group": {"f1": 0.5038167938931298, "f1_ci": {"90": [0.44796125194135145, 0.5607960998607093], "95": [0.4362921406545568, 0.5688220314081427]}, "precision": 0.6197183098591549, "recall": 0.42443729903536975}, "location": {"f1": 0.6026490066225166, "f1_ci": {"90": [0.5320404782483434, 0.6629593282072034], "95": [0.5245744513696118, 0.6756140811769343]}, "precision": 0.6642335766423357, "recall": 0.5515151515151515}, "person": {"f1": 0.8062283737024222, "f1_ci": {"90": [0.7760587632959272, 0.8315361561829818], "95": [0.7698106545550611, 0.8356172784193372]}, "precision": 0.8321428571428572, "recall": 0.7818791946308725}, "product": {"f1": 0.6811594202898551, "f1_ci": {"90": [0.6246480367439654, 0.730964467005076], "95": [0.6142940723633565, 0.7381622865912144]}, "precision": 0.7268041237113402, "recall": 0.6409090909090909}}}, "2021.test (span detection)": {"micro/f1": 0.7603780356501973, "micro/f1_ci": {}, "micro/recall": 0.7350526194055742, "micro/precision": 0.7875108412836079, "macro/f1": 0.7603780356501973, "macro/f1_ci": {}, "macro/recall": 0.7350526194055742, "macro/precision": 0.7875108412836079}, "2020.test (span detection)": {"micro/f1": 0.7245559627854524, "micro/f1_ci": {}, "micro/recall": 0.6668396471198754, "micro/precision": 0.7932098765432098, "macro/f1": 0.7245559627854524, "macro/f1_ci": {}, "macro/recall": 0.6668396471198754, "macro/precision": 0.7932098765432098}}
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6247533126585846, "micro/f1_ci": {"90": [0.6028688973562135, 0.64588834464267], "95": [0.5994344280959615, 0.649232518476407]}, "micro/recall": 0.5749870264660093, "micro/precision": 0.6839506172839506, "macro/f1": 0.578717595313749, "macro/f1_ci": {"90": [0.5540098280773577, 0.6005537196979407], "95": [0.5512954123930293, 0.6060087044874898]}, "macro/recall": 0.5301549277792547, "macro/precision": 0.6410778727928796, "per_entity_metric": {"corporation": {"f1": 0.565597667638484, "f1_ci": {"90": [0.5050505050505051, 0.6224819178391817], "95": [0.4969315627024349, 0.6306885822510823]}, "precision": 0.6381578947368421, "recall": 0.5078534031413613}, "creative_work": {"f1": 0.4364820846905538, "f1_ci": {"90": [0.3723977546110665, 0.4983818770226537], "95": [0.36299049637405206, 0.515419097575336]}, "precision": 0.5234375, "recall": 0.3743016759776536}, "event": {"f1": 0.45508982035928147, "f1_ci": {"90": [0.4049049185589344, 0.5067778692762893], "95": [0.3923199130398428, 0.5195618366745284]}, "precision": 0.4830508474576271, "recall": 0.43018867924528303}, "group": {"f1": 0.5038167938931298, "f1_ci": {"90": [0.44796125194135145, 0.5607960998607093], "95": [0.4362921406545568, 0.5688220314081427]}, "precision": 0.6197183098591549, "recall": 0.42443729903536975}, "location": {"f1": 0.6026490066225166, "f1_ci": {"90": [0.5320404782483434, 0.6629593282072034], "95": [0.5245744513696118, 0.6756140811769343]}, "precision": 0.6642335766423357, "recall": 0.5515151515151515}, "person": {"f1": 0.8062283737024222, "f1_ci": {"90": [0.7760587632959272, 0.8315361561829818], "95": [0.7698106545550611, 0.8356172784193372]}, "precision": 0.8321428571428572, "recall": 0.7818791946308725}, "product": {"f1": 0.6811594202898551, "f1_ci": {"90": [0.6246480367439654, 0.730964467005076], "95": [0.6142940723633565, 0.7381622865912144]}, "precision": 0.7268041237113402, "recall": 0.6409090909090909}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6319818203564167, "micro/f1_ci": {"90": [0.6231013705127983, 0.6413574593408826], "95": [0.6217502353949177, 0.6428942705896876]}, "micro/recall": 0.6110083256244219, "micro/precision": 0.6544463710676245, "macro/f1": 0.5766988664971804, "macro/f1_ci": {"90": [0.5664509989359489, 0.5863507925127135], "95": [0.5648974825471297, 0.5879845963012866]}, "macro/recall": 0.5559244768648601, "macro/precision": 0.601237684920777, "per_entity_metric": {"corporation": {"f1": 0.514024041213509, "f1_ci": {"90": [0.48777635327635327, 0.5386428764634433], "95": [0.48256682507571314, 0.5427950687007129]}, "precision": 0.5301062573789846, "recall": 0.4988888888888889}, "creative_work": {"f1": 0.39736070381231675, "f1_ci": {"90": [0.3673069143565192, 0.4290928789350539], "95": [0.35964709226770636, 0.43496810207336517]}, "precision": 0.42812006319115326, "recall": 0.3707250341997264}, "event": {"f1": 0.42546740778170794, "f1_ci": {"90": [0.40080966868711565, 0.4504934716037546], "95": [0.3947971875592656, 0.45604206362953986]}, "precision": 0.4784090909090909, "recall": 0.3830755232029117}, "group": {"f1": 0.5859649122807017, "f1_ci": {"90": [0.5649910032383042, 0.608005869697348], "95": [0.5609718872903313, 0.6137378755305175]}, "precision": 0.6268768768768769, "recall": 0.5500658761528326}, "location": {"f1": 0.6335664335664336, "f1_ci": {"90": [0.6022469573815304, 0.662564426082152], "95": [0.5972619047619048, 0.6684591503346138]}, "precision": 0.634453781512605, "recall": 0.63268156424581}, "person": {"f1": 0.8127490039840638, "f1_ci": {"90": [0.8007926572866582, 0.8249959351621283], "95": [0.7984037478689154, 0.8268196857132452]}, "precision": 0.798576512455516, "recall": 0.827433628318584}, "product": {"f1": 0.6677595628415302, "f1_ci": {"90": [0.6464189850752727, 0.6878997822678681], "95": [0.6421587454017522, 0.6913517415533396]}, "precision": 0.7121212121212122, "recall": 0.6286008230452675}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7245559627854524, "micro/f1_ci": {}, "micro/recall": 0.6668396471198754, "micro/precision": 0.7932098765432098, "macro/f1": 0.7245559627854524, "macro/f1_ci": {}, "macro/recall": 0.6668396471198754, "macro/precision": 0.7932098765432098}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7603780356501973, "micro/f1_ci": {}, "micro/recall": 0.7350526194055742, "micro/precision": 0.7875108412836079, "macro/f1": 0.7603780356501973, "macro/f1_ci": {}, "macro/recall": 0.7350526194055742, "macro/precision": 0.7875108412836079}
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/bert-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.3, "max_grad_norm": 1}
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train_2021", "dataset_name": null, "local_dataset": null, "model": "tner/bert-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.3, "max_grad_norm": 1}