asahi417 commited on
Commit
eb63bc9
1 Parent(s): 9d2adb1

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-base-tweetner7-2021
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.6067163296677308
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6207355431889668
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.5933163737280296
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5550005793330179
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5693376167794506
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.541740961323845
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7572011592831372
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7749394673123486
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7402567364403839
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.5844643372798152
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6588541666666666
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.5251686559418786
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.5421676095032785
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6164636587810847
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.4850420088484678
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7086341322552699
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.798828125
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.6367410482615464
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-base-tweetner7-2021
88
+
89
+ This model is a fine-tuned version of [bert-base-cased](https://huggingface.co/bert-base-cased) on the
90
+ [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset (`train_2021` 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.6067163296677308
94
+ - Precision (micro): 0.6207355431889668
95
+ - Recall (micro): 0.5933163737280296
96
+ - F1 (macro): 0.5550005793330179
97
+ - Precision (macro): 0.5693376167794506
98
+ - Recall (macro): 0.541740961323845
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.46803779877709834
104
+ - creative_work: 0.35353535353535354
105
+ - event: 0.4128014842300557
106
+ - group: 0.5622895622895623
107
+ - location: 0.6477675407512402
108
+ - person: 0.7988785046728971
109
+ - product: 0.6416938110749185
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.5975843576319135, 0.6165630502101772]
114
+ - 95%: [0.5960112385452907, 0.617571609894858]
115
+ - F1 (macro):
116
+ - 90%: [0.5975843576319135, 0.6165630502101772]
117
+ - 95%: [0.5960112385452907, 0.617571609894858]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/bert-base-tweetner7-2021/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/bert-base-tweetner7-2021/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-base-tweetner7-2021")
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: bert-base-cased
143
+ - crf: True
144
+ - max_length: 128
145
+ - epoch: 30
146
+ - batch_size: 32
147
+ - lr: 0.0001
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/bert-base-tweetner7-2021/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.6017607457276023, "micro/f1_ci": {}, "micro/recall": 0.581, "micro/precision": 0.6240601503759399, "macro/f1": 0.5555350315685348, "macro/f1_ci": {}, "macro/recall": 0.533274675470052, "macro/precision": 0.5804101426861542, "per_entity_metric": {"corporation": {"f1": 0.5102040816326531, "f1_ci": {}, "precision": 0.5319148936170213, "recall": 0.49019607843137253}, "creative_work": {"f1": 0.39999999999999997, "f1_ci": {}, "precision": 0.4426229508196721, "recall": 0.36486486486486486}, "event": {"f1": 0.375, "f1_ci": {}, "precision": 0.384, "recall": 0.366412213740458}, "group": {"f1": 0.6009174311926606, "f1_ci": {}, "precision": 0.6267942583732058, "recall": 0.5770925110132159}, "location": {"f1": 0.6029411764705882, "f1_ci": {}, "precision": 0.640625, "recall": 0.5694444444444444}, "person": {"f1": 0.7799642218246868, "f1_ci": {}, "precision": 0.7898550724637681, "recall": 0.7703180212014135}, "product": {"f1": 0.619718309859155, "f1_ci": {}, "precision": 0.6470588235294118, "recall": 0.5945945945945946}}}, "2021.test": {"micro/f1": 0.6067163296677308, "micro/f1_ci": {"90": [0.5975843576319135, 0.6165630502101772], "95": [0.5960112385452907, 0.617571609894858]}, "micro/recall": 0.5933163737280296, "micro/precision": 0.6207355431889668, "macro/f1": 0.5550005793330179, "macro/f1_ci": {"90": [0.5454776939652932, 0.5646936919721942], "95": [0.5432999131038413, 0.5663329297982065]}, "macro/recall": 0.541740961323845, "macro/precision": 0.5693376167794506, "per_entity_metric": {"corporation": {"f1": 0.46803779877709834, "f1_ci": {"90": [0.4436611083218358, 0.49340886719357124], "95": [0.4403605081922379, 0.49785520431348507]}, "precision": 0.4682981090100111, "recall": 0.4677777777777778}, "creative_work": {"f1": 0.35353535353535354, "f1_ci": {"90": [0.32452379690481237, 0.38226572468955217], "95": [0.31762495778453226, 0.38916201657904076]}, "precision": 0.37404580152671757, "recall": 0.33515731874145005}, "event": {"f1": 0.4128014842300557, "f1_ci": {"90": [0.3895090774496654, 0.43329822290179854], "95": [0.3855879213054751, 0.43708841260659903]}, "precision": 0.4210028382213813, "recall": 0.4049135577797998}, "group": {"f1": 0.5622895622895623, "f1_ci": {"90": [0.5412921294490409, 0.58370523185127], "95": [0.5357699488765177, 0.5881970460741816]}, "precision": 0.5750688705234159, "recall": 0.5500658761528326}, "location": {"f1": 0.6477675407512402, "f1_ci": {"90": [0.6194087633767223, 0.6769953899395165], "95": [0.6122619065457905, 0.6810659039168759]}, "precision": 0.6575539568345323, "recall": 0.638268156424581}, "person": {"f1": 0.7988785046728971, "f1_ci": {"90": [0.7872775543579533, 0.8102531748771992], "95": [0.7851677872261382, 0.8117485932784152]}, "precision": 0.8100833965125095, "recall": 0.7879793510324484}, "product": {"f1": 0.6416938110749185, "f1_ci": {"90": [0.6186304045603652, 0.6652321201925173], "95": [0.6149650845890683, 0.6692824465619494]}, "precision": 0.6793103448275862, "recall": 0.6080246913580247}}}, "2020.test": {"micro/f1": 0.5844643372798152, "micro/f1_ci": {"90": [0.563635081420695, 0.6049707267950686], "95": [0.5599700870857128, 0.6090208008473901]}, "micro/recall": 0.5251686559418786, "micro/precision": 0.6588541666666666, "macro/f1": 0.5421676095032785, "macro/f1_ci": {"90": [0.5207339779479219, 0.5627309034099124], "95": [0.5164049065912122, 0.566586222357101]}, "macro/recall": 0.4850420088484678, "macro/precision": 0.6164636587810847, "per_entity_metric": {"corporation": {"f1": 0.48837209302325585, "f1_ci": {"90": [0.4331173898052879, 0.5406831776841848], "95": [0.4240425874275906, 0.5492604072290306]}, "precision": 0.5490196078431373, "recall": 0.4397905759162304}, "creative_work": {"f1": 0.4304635761589404, "f1_ci": {"90": [0.3727598566308244, 0.48666666666666664], "95": [0.3650740025740025, 0.4952410437859355]}, "precision": 0.5284552845528455, "recall": 0.36312849162011174}, "event": {"f1": 0.3227176220806794, "f1_ci": {"90": [0.26938415101139795, 0.3763103665250905], "95": [0.2586177574478067, 0.38613812128642844]}, "precision": 0.36893203883495146, "recall": 0.28679245283018867}, "group": {"f1": 0.5065176908752327, "f1_ci": {"90": [0.4571428571428572, 0.5595023477009111], "95": [0.4444005270092226, 0.5682343778632948]}, "precision": 0.6017699115044248, "recall": 0.43729903536977494}, "location": {"f1": 0.6153846153846153, "f1_ci": {"90": [0.5421016483516483, 0.6753693298105905], "95": [0.5293878527020563, 0.6838247153700189]}, "precision": 0.6865671641791045, "recall": 0.5575757575757576}, "person": {"f1": 0.7667560321715817, "f1_ci": {"90": [0.7357200782476069, 0.7935042398953037], "95": [0.7289370539370538, 0.7984247819667724]}, "precision": 0.8202676864244742, "recall": 0.7197986577181208}, "product": {"f1": 0.6649616368286445, "f1_ci": {"90": [0.6082217918778835, 0.7151641743808846], "95": [0.5989697210174176, 0.7246467391304348]}, "precision": 0.7602339181286549, "recall": 0.5909090909090909}}}, "2021.test (span detection)": {"micro/f1": 0.7572011592831372, "micro/f1_ci": {}, "micro/recall": 0.7402567364403839, "micro/precision": 0.7749394673123486, "macro/f1": 0.7572011592831372, "macro/f1_ci": {}, "macro/recall": 0.7402567364403839, "macro/precision": 0.7749394673123486}, "2020.test (span detection)": {"micro/f1": 0.7086341322552699, "micro/f1_ci": {}, "micro/recall": 0.6367410482615464, "micro/precision": 0.798828125, "macro/f1": 0.7086341322552699, "macro/f1_ci": {}, "macro/recall": 0.6367410482615464, "macro/precision": 0.798828125}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.5844643372798152, "micro/f1_ci": {"90": [0.563635081420695, 0.6049707267950686], "95": [0.5599700870857128, 0.6090208008473901]}, "micro/recall": 0.5251686559418786, "micro/precision": 0.6588541666666666, "macro/f1": 0.5421676095032785, "macro/f1_ci": {"90": [0.5207339779479219, 0.5627309034099124], "95": [0.5164049065912122, 0.566586222357101]}, "macro/recall": 0.4850420088484678, "macro/precision": 0.6164636587810847, "per_entity_metric": {"corporation": {"f1": 0.48837209302325585, "f1_ci": {"90": [0.4331173898052879, 0.5406831776841848], "95": [0.4240425874275906, 0.5492604072290306]}, "precision": 0.5490196078431373, "recall": 0.4397905759162304}, "creative_work": {"f1": 0.4304635761589404, "f1_ci": {"90": [0.3727598566308244, 0.48666666666666664], "95": [0.3650740025740025, 0.4952410437859355]}, "precision": 0.5284552845528455, "recall": 0.36312849162011174}, "event": {"f1": 0.3227176220806794, "f1_ci": {"90": [0.26938415101139795, 0.3763103665250905], "95": [0.2586177574478067, 0.38613812128642844]}, "precision": 0.36893203883495146, "recall": 0.28679245283018867}, "group": {"f1": 0.5065176908752327, "f1_ci": {"90": [0.4571428571428572, 0.5595023477009111], "95": [0.4444005270092226, 0.5682343778632948]}, "precision": 0.6017699115044248, "recall": 0.43729903536977494}, "location": {"f1": 0.6153846153846153, "f1_ci": {"90": [0.5421016483516483, 0.6753693298105905], "95": [0.5293878527020563, 0.6838247153700189]}, "precision": 0.6865671641791045, "recall": 0.5575757575757576}, "person": {"f1": 0.7667560321715817, "f1_ci": {"90": [0.7357200782476069, 0.7935042398953037], "95": [0.7289370539370538, 0.7984247819667724]}, "precision": 0.8202676864244742, "recall": 0.7197986577181208}, "product": {"f1": 0.6649616368286445, "f1_ci": {"90": [0.6082217918778835, 0.7151641743808846], "95": [0.5989697210174176, 0.7246467391304348]}, "precision": 0.7602339181286549, "recall": 0.5909090909090909}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6067163296677308, "micro/f1_ci": {"90": [0.5975843576319135, 0.6165630502101772], "95": [0.5960112385452907, 0.617571609894858]}, "micro/recall": 0.5933163737280296, "micro/precision": 0.6207355431889668, "macro/f1": 0.5550005793330179, "macro/f1_ci": {"90": [0.5454776939652932, 0.5646936919721942], "95": [0.5432999131038413, 0.5663329297982065]}, "macro/recall": 0.541740961323845, "macro/precision": 0.5693376167794506, "per_entity_metric": {"corporation": {"f1": 0.46803779877709834, "f1_ci": {"90": [0.4436611083218358, 0.49340886719357124], "95": [0.4403605081922379, 0.49785520431348507]}, "precision": 0.4682981090100111, "recall": 0.4677777777777778}, "creative_work": {"f1": 0.35353535353535354, "f1_ci": {"90": [0.32452379690481237, 0.38226572468955217], "95": [0.31762495778453226, 0.38916201657904076]}, "precision": 0.37404580152671757, "recall": 0.33515731874145005}, "event": {"f1": 0.4128014842300557, "f1_ci": {"90": [0.3895090774496654, 0.43329822290179854], "95": [0.3855879213054751, 0.43708841260659903]}, "precision": 0.4210028382213813, "recall": 0.4049135577797998}, "group": {"f1": 0.5622895622895623, "f1_ci": {"90": [0.5412921294490409, 0.58370523185127], "95": [0.5357699488765177, 0.5881970460741816]}, "precision": 0.5750688705234159, "recall": 0.5500658761528326}, "location": {"f1": 0.6477675407512402, "f1_ci": {"90": [0.6194087633767223, 0.6769953899395165], "95": [0.6122619065457905, 0.6810659039168759]}, "precision": 0.6575539568345323, "recall": 0.638268156424581}, "person": {"f1": 0.7988785046728971, "f1_ci": {"90": [0.7872775543579533, 0.8102531748771992], "95": [0.7851677872261382, 0.8117485932784152]}, "precision": 0.8100833965125095, "recall": 0.7879793510324484}, "product": {"f1": 0.6416938110749185, "f1_ci": {"90": [0.6186304045603652, 0.6652321201925173], "95": [0.6149650845890683, 0.6692824465619494]}, "precision": 0.6793103448275862, "recall": 0.6080246913580247}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7086341322552699, "micro/f1_ci": {}, "micro/recall": 0.6367410482615464, "micro/precision": 0.798828125, "macro/f1": 0.7086341322552699, "macro/f1_ci": {}, "macro/recall": 0.6367410482615464, "macro/precision": 0.798828125}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7572011592831372, "micro/f1_ci": {}, "micro/recall": 0.7402567364403839, "micro/precision": 0.7749394673123486, "macro/f1": 0.7572011592831372, "macro/f1_ci": {}, "macro/recall": 0.7402567364403839, "macro/precision": 0.7749394673123486}
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": "bert-base-cased", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 0.0001, "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_2021", "dataset_name": null, "local_dataset": null, "model": "bert-base-cased", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 0.0001, "random_seed": 0, "gradient_accumulation_steps": 1, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.15, "max_grad_norm": 1}