asahi417 commited on
Commit
d7786c0
1 Parent(s): c7ea450

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-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.6646206308610401
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.653515144741254
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6761100832562442
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.6187282305429461
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.6069581336386037
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6359356515638321
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7953163189905075
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7820254862508383
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.8090667283450907
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.6675704989154012
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6990346394094265
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6388168137000519
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6307734401161805
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6616549497337102
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.6085863177550797
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7759088442756376
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.8129619101762365
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.742086144265698
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-concat
88
+
89
+ This model is a fine-tuned version of [vinai/bertweet-large](https://huggingface.co/vinai/bertweet-large) 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.6646206308610401
94
+ - Precision (micro): 0.653515144741254
95
+ - Recall (micro): 0.6761100832562442
96
+ - F1 (macro): 0.6187282305429461
97
+ - Precision (macro): 0.6069581336386037
98
+ - Recall (macro): 0.6359356515638321
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.545042492917847
104
+ - creative_work: 0.47362250879249707
105
+ - event: 0.4915336236090953
106
+ - group: 0.623768877216021
107
+ - location: 0.6754716981132076
108
+ - person: 0.8414922656960875
109
+ - product: 0.6801661474558671
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6554125820888649, 0.6736489128168938]
114
+ - 95%: [0.6533077908395879, 0.675252368755536]
115
+ - F1 (macro):
116
+ - 90%: [0.6554125820888649, 0.6736489128168938]
117
+ - 95%: [0.6533077908395879, 0.675252368755536]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/bertweet-large-tweetner7-2020-2021-concat/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/bertweet-large-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/bertweet-large-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: vinai/bertweet-large
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/bertweet-large-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.6507224713502741, "micro/f1_ci": {}, "micro/recall": 0.653, "micro/precision": 0.6484607745779544, "macro/f1": 0.6103997713771362, "macro/f1_ci": {}, "macro/recall": 0.6181336282143709, "macro/precision": 0.606567588228242, "per_entity_metric": {"corporation": {"f1": 0.5841584158415842, "f1_ci": {}, "precision": 0.59, "recall": 0.5784313725490197}, "creative_work": {"f1": 0.4733727810650888, "f1_ci": {}, "precision": 0.42105263157894735, "recall": 0.5405405405405406}, "event": {"f1": 0.4897959183673469, "f1_ci": {}, "precision": 0.5263157894736842, "recall": 0.4580152671755725}, "group": {"f1": 0.6057906458797327, "f1_ci": {}, "precision": 0.6126126126126126, "recall": 0.5991189427312775}, "location": {"f1": 0.6233766233766234, "f1_ci": {}, "precision": 0.5853658536585366, "recall": 0.6666666666666666}, "person": {"f1": 0.8327526132404182, "f1_ci": {}, "precision": 0.8213058419243986, "recall": 0.8445229681978799}, "product": {"f1": 0.663551401869159, "f1_ci": {}, "precision": 0.6893203883495146, "recall": 0.6396396396396397}}}, "2021.test": {"micro/f1": 0.6646206308610401, "micro/f1_ci": {"90": [0.6554125820888649, 0.6736489128168938], "95": [0.6533077908395879, 0.675252368755536]}, "micro/recall": 0.6761100832562442, "micro/precision": 0.653515144741254, "macro/f1": 0.6187282305429461, "macro/f1_ci": {"90": [0.6086007046046046, 0.6274752439680484], "95": [0.6064349641468447, 0.6292100251466678]}, "macro/recall": 0.6359356515638321, "macro/precision": 0.6069581336386037, "per_entity_metric": {"corporation": {"f1": 0.545042492917847, "f1_ci": {"90": [0.5210565034619189, 0.570455308114704], "95": [0.5163483236977213, 0.5768635272388254]}, "precision": 0.5560693641618497, "recall": 0.5344444444444445}, "creative_work": {"f1": 0.47362250879249707, "f1_ci": {"90": [0.44319138030931055, 0.5049788934117292], "95": [0.4364029194303145, 0.5107778906673237]}, "precision": 0.41435897435897434, "recall": 0.5526675786593708}, "event": {"f1": 0.4915336236090953, "f1_ci": {"90": [0.4684507714181196, 0.5143994098920723], "95": [0.46447741808246684, 0.5187658305407751]}, "precision": 0.5247933884297521, "recall": 0.462238398544131}, "group": {"f1": 0.623768877216021, "f1_ci": {"90": [0.6036063111513918, 0.6459784481752944], "95": [0.5996059953988204, 0.6488495817907584]}, "precision": 0.6217277486910995, "recall": 0.6258234519104084}, "location": {"f1": 0.6754716981132076, "f1_ci": {"90": [0.6502264241541174, 0.7009141138003405], "95": [0.643485938839921, 0.7058891849422697]}, "precision": 0.61441647597254, "recall": 0.75}, "person": {"f1": 0.8414922656960875, "f1_ci": {"90": [0.8306318756851475, 0.8517340317116006], "95": [0.8291240468904854, 0.8531652713056682]}, "precision": 0.8307581746316924, "recall": 0.8525073746312685}, "product": {"f1": 0.6801661474558671, "f1_ci": {"90": [0.6576924955753543, 0.7017577078587071], "95": [0.6537204296451585, 0.7052648077874939]}, "precision": 0.6865828092243187, "recall": 0.6738683127572016}}}, "2020.test": {"micro/f1": 0.6675704989154012, "micro/f1_ci": {"90": [0.6478782487489827, 0.686330134406657], "95": [0.643485580441, 0.689784971727218]}, "micro/recall": 0.6388168137000519, "micro/precision": 0.6990346394094265, "macro/f1": 0.6307734401161805, "macro/f1_ci": {"90": [0.6086331719773058, 0.650352710597749], "95": [0.6044641232125019, 0.6551010145551667]}, "macro/recall": 0.6085863177550797, "macro/precision": 0.6616549497337102, "per_entity_metric": {"corporation": {"f1": 0.5888594164456233, "f1_ci": {"90": [0.5313343849856409, 0.6377922295678834], "95": [0.5233514118457299, 0.6485181964142359]}, "precision": 0.5967741935483871, "recall": 0.581151832460733}, "creative_work": {"f1": 0.5524296675191815, "f1_ci": {"90": [0.49640524689644966, 0.6021000260333806], "95": [0.48969679633867275, 0.610844280240832]}, "precision": 0.5094339622641509, "recall": 0.6033519553072626}, "event": {"f1": 0.4888888888888889, "f1_ci": {"90": [0.43619555287353434, 0.5418402724977951], "95": [0.42727297146820076, 0.5512992831541219]}, "precision": 0.5260869565217391, "recall": 0.45660377358490567}, "group": {"f1": 0.5985130111524165, "f1_ci": {"90": [0.5485224195478304, 0.650063025210084], "95": [0.534749739311783, 0.6577725388960302]}, "precision": 0.7092511013215859, "recall": 0.5176848874598071}, "location": {"f1": 0.6666666666666666, "f1_ci": {"90": [0.598896163716523, 0.7267257383966245], "95": [0.5836553829874008, 0.744198416625433]}, "precision": 0.6607142857142857, "recall": 0.6727272727272727}, "person": {"f1": 0.8349178910976663, "f1_ci": {"90": [0.8089173822232536, 0.8576861436442418], "95": [0.8028489054150965, 0.8630879876393839]}, "precision": 0.8609625668449198, "recall": 0.8104026845637584}, "product": {"f1": 0.6851385390428212, "f1_ci": {"90": [0.6308652472005644, 0.7338255988615702], "95": [0.6200345849802371, 0.7411211707957673]}, "precision": 0.768361581920904, "recall": 0.6181818181818182}}}, "2021.test (span detection)": {"micro/f1": 0.7953163189905075, "micro/f1_ci": {}, "micro/recall": 0.8090667283450907, "micro/precision": 0.7820254862508383, "macro/f1": 0.7953163189905075, "macro/f1_ci": {}, "macro/recall": 0.8090667283450907, "macro/precision": 0.7820254862508383}, "2020.test (span detection)": {"micro/f1": 0.7759088442756376, "micro/f1_ci": {}, "micro/recall": 0.742086144265698, "micro/precision": 0.8129619101762365, "macro/f1": 0.7759088442756376, "macro/f1_ci": {}, "macro/recall": 0.742086144265698, "macro/precision": 0.8129619101762365}}
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6675704989154012, "micro/f1_ci": {"90": [0.6478782487489827, 0.686330134406657], "95": [0.643485580441, 0.689784971727218]}, "micro/recall": 0.6388168137000519, "micro/precision": 0.6990346394094265, "macro/f1": 0.6307734401161805, "macro/f1_ci": {"90": [0.6086331719773058, 0.650352710597749], "95": [0.6044641232125019, 0.6551010145551667]}, "macro/recall": 0.6085863177550797, "macro/precision": 0.6616549497337102, "per_entity_metric": {"corporation": {"f1": 0.5888594164456233, "f1_ci": {"90": [0.5313343849856409, 0.6377922295678834], "95": [0.5233514118457299, 0.6485181964142359]}, "precision": 0.5967741935483871, "recall": 0.581151832460733}, "creative_work": {"f1": 0.5524296675191815, "f1_ci": {"90": [0.49640524689644966, 0.6021000260333806], "95": [0.48969679633867275, 0.610844280240832]}, "precision": 0.5094339622641509, "recall": 0.6033519553072626}, "event": {"f1": 0.4888888888888889, "f1_ci": {"90": [0.43619555287353434, 0.5418402724977951], "95": [0.42727297146820076, 0.5512992831541219]}, "precision": 0.5260869565217391, "recall": 0.45660377358490567}, "group": {"f1": 0.5985130111524165, "f1_ci": {"90": [0.5485224195478304, 0.650063025210084], "95": [0.534749739311783, 0.6577725388960302]}, "precision": 0.7092511013215859, "recall": 0.5176848874598071}, "location": {"f1": 0.6666666666666666, "f1_ci": {"90": [0.598896163716523, 0.7267257383966245], "95": [0.5836553829874008, 0.744198416625433]}, "precision": 0.6607142857142857, "recall": 0.6727272727272727}, "person": {"f1": 0.8349178910976663, "f1_ci": {"90": [0.8089173822232536, 0.8576861436442418], "95": [0.8028489054150965, 0.8630879876393839]}, "precision": 0.8609625668449198, "recall": 0.8104026845637584}, "product": {"f1": 0.6851385390428212, "f1_ci": {"90": [0.6308652472005644, 0.7338255988615702], "95": [0.6200345849802371, 0.7411211707957673]}, "precision": 0.768361581920904, "recall": 0.6181818181818182}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6646206308610401, "micro/f1_ci": {"90": [0.6554125820888649, 0.6736489128168938], "95": [0.6533077908395879, 0.675252368755536]}, "micro/recall": 0.6761100832562442, "micro/precision": 0.653515144741254, "macro/f1": 0.6187282305429461, "macro/f1_ci": {"90": [0.6086007046046046, 0.6274752439680484], "95": [0.6064349641468447, 0.6292100251466678]}, "macro/recall": 0.6359356515638321, "macro/precision": 0.6069581336386037, "per_entity_metric": {"corporation": {"f1": 0.545042492917847, "f1_ci": {"90": [0.5210565034619189, 0.570455308114704], "95": [0.5163483236977213, 0.5768635272388254]}, "precision": 0.5560693641618497, "recall": 0.5344444444444445}, "creative_work": {"f1": 0.47362250879249707, "f1_ci": {"90": [0.44319138030931055, 0.5049788934117292], "95": [0.4364029194303145, 0.5107778906673237]}, "precision": 0.41435897435897434, "recall": 0.5526675786593708}, "event": {"f1": 0.4915336236090953, "f1_ci": {"90": [0.4684507714181196, 0.5143994098920723], "95": [0.46447741808246684, 0.5187658305407751]}, "precision": 0.5247933884297521, "recall": 0.462238398544131}, "group": {"f1": 0.623768877216021, "f1_ci": {"90": [0.6036063111513918, 0.6459784481752944], "95": [0.5996059953988204, 0.6488495817907584]}, "precision": 0.6217277486910995, "recall": 0.6258234519104084}, "location": {"f1": 0.6754716981132076, "f1_ci": {"90": [0.6502264241541174, 0.7009141138003405], "95": [0.643485938839921, 0.7058891849422697]}, "precision": 0.61441647597254, "recall": 0.75}, "person": {"f1": 0.8414922656960875, "f1_ci": {"90": [0.8306318756851475, 0.8517340317116006], "95": [0.8291240468904854, 0.8531652713056682]}, "precision": 0.8307581746316924, "recall": 0.8525073746312685}, "product": {"f1": 0.6801661474558671, "f1_ci": {"90": [0.6576924955753543, 0.7017577078587071], "95": [0.6537204296451585, 0.7052648077874939]}, "precision": 0.6865828092243187, "recall": 0.6738683127572016}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7759088442756376, "micro/f1_ci": {}, "micro/recall": 0.742086144265698, "micro/precision": 0.8129619101762365, "macro/f1": 0.7759088442756376, "macro/f1_ci": {}, "macro/recall": 0.742086144265698, "macro/precision": 0.8129619101762365}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7953163189905075, "micro/f1_ci": {}, "micro/recall": 0.8090667283450907, "micro/precision": 0.7820254862508383, "macro/f1": 0.7953163189905075, "macro/f1_ci": {}, "macro/recall": 0.8090667283450907, "macro/precision": 0.7820254862508383}
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": "vinai/bertweet-large", "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": "vinai/bertweet-large", "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}