asahi417 commited on
Commit
950be10
1 Parent(s): 07c93da

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-base-tweetner7-2020
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.6405933917734322
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6230870135548754
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6591119333950046
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5944351160023098
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5741906773305591
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6180335313677364
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7790952514751335
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7577612592916484
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.8016653174511391
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.6638023630504833
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6878130217028381
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6414115204981837
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6240651348448572
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6445261805050383
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.6088211190017436
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7773301101262422
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.8056792873051225
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7509081473793461
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-base-tweetner7-2020
88
+
89
+ This model is a fine-tuned version of [vinai/bertweet-base](https://huggingface.co/vinai/bertweet-base) on the
90
+ [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset (`train_2020` 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.6405933917734322
94
+ - Precision (micro): 0.6230870135548754
95
+ - Recall (micro): 0.6591119333950046
96
+ - F1 (macro): 0.5944351160023098
97
+ - Precision (macro): 0.5741906773305591
98
+ - Recall (macro): 0.6180335313677364
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5161987041036716
104
+ - creative_work: 0.4572468162522741
105
+ - event: 0.4586907449209932
106
+ - group: 0.5974197816738339
107
+ - location: 0.6470211402946828
108
+ - person: 0.8270704122582998
109
+ - product: 0.6573982125124131
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.631778937808505, 0.6496155272705774]
114
+ - 95%: [0.6304400232899813, 0.6514114604724054]
115
+ - F1 (macro):
116
+ - 90%: [0.631778937808505, 0.6496155272705774]
117
+ - 95%: [0.6304400232899813, 0.6514114604724054]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/bertweet-base-tweetner7-2020/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/bertweet-base-tweetner7-2020/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-base-tweetner7-2020")
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_2020
140
+ - dataset_name: None
141
+ - local_dataset: None
142
+ - model: vinai/bertweet-base
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-base-tweetner7-2020/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
- {"2020.dev": {"micro/f1": 0.6461870115871734, "micro/f1_ci": {}, "micro/recall": 0.6264367816091954, "micro/precision": 0.6672231496939344, "macro/f1": 0.5926978856418852, "macro/f1_ci": {}, "macro/recall": 0.5761073706964339, "macro/precision": 0.61172737557305, "per_entity_metric": {"corporation": {"f1": 0.48186528497409326, "f1_ci": {}, "precision": 0.5081967213114754, "recall": 0.458128078817734}, "creative_work": {"f1": 0.5530864197530865, "f1_ci": {}, "precision": 0.5685279187817259, "recall": 0.5384615384615384}, "event": {"f1": 0.40490797546012275, "f1_ci": {}, "precision": 0.4248927038626609, "recall": 0.38671875}, "group": {"f1": 0.5560747663551402, "f1_ci": {}, "precision": 0.5920398009950248, "recall": 0.5242290748898678}, "location": {"f1": 0.6296296296296297, "f1_ci": {}, "precision": 0.6040609137055838, "recall": 0.6574585635359116}, "person": {"f1": 0.8683760683760683, "f1_ci": {}, "precision": 0.8881118881118881, "recall": 0.8494983277591973}, "product": {"f1": 0.654945054945055, "f1_ci": {}, "precision": 0.6962616822429907, "recall": 0.6182572614107884}}}, "2021.test": {"micro/f1": 0.6405933917734322, "micro/f1_ci": {"90": [0.631778937808505, 0.6496155272705774], "95": [0.6304400232899813, 0.6514114604724054]}, "micro/recall": 0.6591119333950046, "micro/precision": 0.6230870135548754, "macro/f1": 0.5944351160023098, "macro/f1_ci": {"90": [0.5847208708923466, 0.603808377698836], "95": [0.5828546488018534, 0.6052274662051181]}, "macro/recall": 0.6180335313677364, "macro/precision": 0.5741906773305591, "per_entity_metric": {"corporation": {"f1": 0.5161987041036716, "f1_ci": {"90": [0.49180141685517725, 0.5412822594794634], "95": [0.4872053907697826, 0.5464205205875101]}, "precision": 0.5021008403361344, "recall": 0.5311111111111111}, "creative_work": {"f1": 0.4572468162522741, "f1_ci": {"90": [0.4263245047046743, 0.48619332184333874], "95": [0.4203299955901526, 0.49227302083088703]}, "precision": 0.4106753812636166, "recall": 0.5157318741450069}, "event": {"f1": 0.4586907449209932, "f1_ci": {"90": [0.4353521868871257, 0.48032375354584356], "95": [0.4313319263983663, 0.4842758616893962]}, "precision": 0.4551971326164875, "recall": 0.462238398544131}, "group": {"f1": 0.5974197816738339, "f1_ci": {"90": [0.5762787240136122, 0.618982083736629], "95": [0.5733679043193478, 0.62334357181611]}, "precision": 0.6, "recall": 0.5948616600790514}, "location": {"f1": 0.6470211402946828, "f1_ci": {"90": [0.6202857142857143, 0.6734338120728754], "95": [0.613022658886491, 0.6770613077175826]}, "precision": 0.5976331360946746, "recall": 0.7053072625698324}, "person": {"f1": 0.8270704122582998, "f1_ci": {"90": [0.8161884707751226, 0.8380467499055994], "95": [0.8142470822597432, 0.8396568324466097]}, "precision": 0.8184115523465704, "recall": 0.8359144542772862}, "product": {"f1": 0.6573982125124131, "f1_ci": {"90": [0.6348520899144029, 0.6785714285714285], "95": [0.6316288989365912, 0.6825163014469338]}, "precision": 0.6353166986564299, "recall": 0.6810699588477366}}}, "2020.test": {"micro/f1": 0.6638023630504833, "micro/f1_ci": {"90": [0.6418572016184402, 0.683072873635275], "95": [0.6397231030341602, 0.6878762682463384]}, "micro/recall": 0.6414115204981837, "micro/precision": 0.6878130217028381, "macro/f1": 0.6240651348448572, "macro/f1_ci": {"90": [0.6000726487941666, 0.6450820854370489], "95": [0.5959923653749377, 0.6483570192589765]}, "macro/recall": 0.6088211190017436, "macro/precision": 0.6445261805050383, "per_entity_metric": {"corporation": {"f1": 0.5804749340369394, "f1_ci": {"90": [0.5186940057264247, 0.634421505376344], "95": [0.511232833957553, 0.6458452608142494]}, "precision": 0.5851063829787234, "recall": 0.5759162303664922}, "creative_work": {"f1": 0.5494505494505495, "f1_ci": {"90": [0.49384915088405895, 0.6042839513427749], "95": [0.48414288370363484, 0.6140688259109314]}, "precision": 0.5405405405405406, "recall": 0.5586592178770949}, "event": {"f1": 0.4990403071017275, "f1_ci": {"90": [0.4465795369678865, 0.545831502200961], "95": [0.43690366732838776, 0.5538938053097346]}, "precision": 0.5078125, "recall": 0.49056603773584906}, "group": {"f1": 0.5617977528089888, "f1_ci": {"90": [0.5054113082467208, 0.6175137833864248], "95": [0.49254370765167715, 0.6298707075842308]}, "precision": 0.672645739910314, "recall": 0.48231511254019294}, "location": {"f1": 0.6744868035190615, "f1_ci": {"90": [0.611976320582878, 0.7320256856279911], "95": [0.5962226896592779, 0.740745899102445]}, "precision": 0.6534090909090909, "recall": 0.696969696969697}, "person": {"f1": 0.847545219638243, "f1_ci": {"90": [0.8229540630381673, 0.8695689462301439], "95": [0.818900462962963, 0.874592017212771]}, "precision": 0.8707964601769912, "recall": 0.825503355704698}, "product": {"f1": 0.6556603773584906, "f1_ci": {"90": [0.6023278867102397, 0.7027096864306166], "95": [0.5898495068901802, 0.7139374819254937]}, "precision": 0.6813725490196079, "recall": 0.6318181818181818}}}, "2021.test (span detection)": {"micro/f1": 0.7790952514751335, "micro/f1_ci": {}, "micro/recall": 0.8016653174511391, "micro/precision": 0.7577612592916484, "macro/f1": 0.7790952514751335, "macro/f1_ci": {}, "macro/recall": 0.8016653174511391, "macro/precision": 0.7577612592916484}, "2020.test (span detection)": {"micro/f1": 0.7773301101262422, "micro/f1_ci": {}, "micro/recall": 0.7509081473793461, "micro/precision": 0.8056792873051225, "macro/f1": 0.7773301101262422, "macro/f1_ci": {}, "macro/recall": 0.7509081473793461, "macro/precision": 0.8056792873051225}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6638023630504833, "micro/f1_ci": {"90": [0.6418572016184402, 0.683072873635275], "95": [0.6397231030341602, 0.6878762682463384]}, "micro/recall": 0.6414115204981837, "micro/precision": 0.6878130217028381, "macro/f1": 0.6240651348448572, "macro/f1_ci": {"90": [0.6000726487941666, 0.6450820854370489], "95": [0.5959923653749377, 0.6483570192589765]}, "macro/recall": 0.6088211190017436, "macro/precision": 0.6445261805050383, "per_entity_metric": {"corporation": {"f1": 0.5804749340369394, "f1_ci": {"90": [0.5186940057264247, 0.634421505376344], "95": [0.511232833957553, 0.6458452608142494]}, "precision": 0.5851063829787234, "recall": 0.5759162303664922}, "creative_work": {"f1": 0.5494505494505495, "f1_ci": {"90": [0.49384915088405895, 0.6042839513427749], "95": [0.48414288370363484, 0.6140688259109314]}, "precision": 0.5405405405405406, "recall": 0.5586592178770949}, "event": {"f1": 0.4990403071017275, "f1_ci": {"90": [0.4465795369678865, 0.545831502200961], "95": [0.43690366732838776, 0.5538938053097346]}, "precision": 0.5078125, "recall": 0.49056603773584906}, "group": {"f1": 0.5617977528089888, "f1_ci": {"90": [0.5054113082467208, 0.6175137833864248], "95": [0.49254370765167715, 0.6298707075842308]}, "precision": 0.672645739910314, "recall": 0.48231511254019294}, "location": {"f1": 0.6744868035190615, "f1_ci": {"90": [0.611976320582878, 0.7320256856279911], "95": [0.5962226896592779, 0.740745899102445]}, "precision": 0.6534090909090909, "recall": 0.696969696969697}, "person": {"f1": 0.847545219638243, "f1_ci": {"90": [0.8229540630381673, 0.8695689462301439], "95": [0.818900462962963, 0.874592017212771]}, "precision": 0.8707964601769912, "recall": 0.825503355704698}, "product": {"f1": 0.6556603773584906, "f1_ci": {"90": [0.6023278867102397, 0.7027096864306166], "95": [0.5898495068901802, 0.7139374819254937]}, "precision": 0.6813725490196079, "recall": 0.6318181818181818}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6405933917734322, "micro/f1_ci": {"90": [0.631778937808505, 0.6496155272705774], "95": [0.6304400232899813, 0.6514114604724054]}, "micro/recall": 0.6591119333950046, "micro/precision": 0.6230870135548754, "macro/f1": 0.5944351160023098, "macro/f1_ci": {"90": [0.5847208708923466, 0.603808377698836], "95": [0.5828546488018534, 0.6052274662051181]}, "macro/recall": 0.6180335313677364, "macro/precision": 0.5741906773305591, "per_entity_metric": {"corporation": {"f1": 0.5161987041036716, "f1_ci": {"90": [0.49180141685517725, 0.5412822594794634], "95": [0.4872053907697826, 0.5464205205875101]}, "precision": 0.5021008403361344, "recall": 0.5311111111111111}, "creative_work": {"f1": 0.4572468162522741, "f1_ci": {"90": [0.4263245047046743, 0.48619332184333874], "95": [0.4203299955901526, 0.49227302083088703]}, "precision": 0.4106753812636166, "recall": 0.5157318741450069}, "event": {"f1": 0.4586907449209932, "f1_ci": {"90": [0.4353521868871257, 0.48032375354584356], "95": [0.4313319263983663, 0.4842758616893962]}, "precision": 0.4551971326164875, "recall": 0.462238398544131}, "group": {"f1": 0.5974197816738339, "f1_ci": {"90": [0.5762787240136122, 0.618982083736629], "95": [0.5733679043193478, 0.62334357181611]}, "precision": 0.6, "recall": 0.5948616600790514}, "location": {"f1": 0.6470211402946828, "f1_ci": {"90": [0.6202857142857143, 0.6734338120728754], "95": [0.613022658886491, 0.6770613077175826]}, "precision": 0.5976331360946746, "recall": 0.7053072625698324}, "person": {"f1": 0.8270704122582998, "f1_ci": {"90": [0.8161884707751226, 0.8380467499055994], "95": [0.8142470822597432, 0.8396568324466097]}, "precision": 0.8184115523465704, "recall": 0.8359144542772862}, "product": {"f1": 0.6573982125124131, "f1_ci": {"90": [0.6348520899144029, 0.6785714285714285], "95": [0.6316288989365912, 0.6825163014469338]}, "precision": 0.6353166986564299, "recall": 0.6810699588477366}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7773301101262422, "micro/f1_ci": {}, "micro/recall": 0.7509081473793461, "micro/precision": 0.8056792873051225, "macro/f1": 0.7773301101262422, "macro/f1_ci": {}, "macro/recall": 0.7509081473793461, "macro/precision": 0.8056792873051225}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7790952514751335, "micro/f1_ci": {}, "micro/recall": 0.8016653174511391, "micro/precision": 0.7577612592916484, "macro/f1": 0.7790952514751335, "macro/f1_ci": {}, "macro/recall": 0.8016653174511391, "macro/precision": 0.7577612592916484}
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.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.train", "model": "vinai/bertweet-base", "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_2020", "dataset_name": null, "local_dataset": null, "model": "vinai/bertweet-base", "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}