asahi417 commited on
Commit
fc659a3
1 Parent(s): c3454cb

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-random
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.609117361784675
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6011938281337988
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6172525439407955
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.559165089199025
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5499368578582033
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.5694430718770875
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7572194954913822
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7474929577464788
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7672024979761767
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.6103825136612021
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6445470282746683
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.5796574987026466
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.5675359874657813
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6021803835272678
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5387624182505003
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7273224043715847
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7680323139065205
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.6907109496626881
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-random
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_random` 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.609117361784675
94
+ - Precision (micro): 0.6011938281337988
95
+ - Recall (micro): 0.6172525439407955
96
+ - F1 (macro): 0.559165089199025
97
+ - Precision (macro): 0.5499368578582033
98
+ - Recall (macro): 0.5694430718770875
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.46514047866805414
104
+ - creative_work: 0.3904698874917273
105
+ - event: 0.4183066361556064
106
+ - group: 0.5614035087719299
107
+ - location: 0.6389645776566757
108
+ - person: 0.8044590643274854
109
+ - product: 0.6354114713216957
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6000414265573856, 0.6190415373631918]
114
+ - 95%: [0.5981509067764902, 0.6206829089362571]
115
+ - F1 (macro):
116
+ - 90%: [0.6000414265573856, 0.6190415373631918]
117
+ - 95%: [0.5981509067764902, 0.6206829089362571]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/bert-base-tweetner7-random/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/bert-base-tweetner7-random/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-random")
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_random
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-random/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
- {"random.dev": {"micro/f1": 0.6192560175054704, "micro/f1_ci": {}, "micro/recall": 0.604378003203417, "micro/precision": 0.6348850252383623, "macro/f1": 0.5735999549689017, "macro/f1_ci": {}, "macro/recall": 0.5597621939973553, "macro/precision": 0.5895208320445692, "per_entity_metric": {"corporation": {"f1": 0.5524296675191815, "f1_ci": {}, "precision": 0.5454545454545454, "recall": 0.5595854922279793}, "creative_work": {"f1": 0.445141065830721, "f1_ci": {}, "precision": 0.45222929936305734, "recall": 0.4382716049382716}, "event": {"f1": 0.3439490445859873, "f1_ci": {}, "precision": 0.3584070796460177, "recall": 0.3306122448979592}, "group": {"f1": 0.5902668759811617, "f1_ci": {}, "precision": 0.6460481099656358, "recall": 0.5433526011560693}, "location": {"f1": 0.624203821656051, "f1_ci": {}, "precision": 0.6490066225165563, "recall": 0.6012269938650306}, "person": {"f1": 0.8240740740740741, "f1_ci": {}, "precision": 0.8135283363802559, "recall": 0.8348968105065666}, "product": {"f1": 0.6351351351351351, "f1_ci": {}, "precision": 0.6619718309859155, "recall": 0.6103896103896104}}}, "2021.test": {"micro/f1": 0.609117361784675, "micro/f1_ci": {"90": [0.6000414265573856, 0.6190415373631918], "95": [0.5981509067764902, 0.6206829089362571]}, "micro/recall": 0.6172525439407955, "micro/precision": 0.6011938281337988, "macro/f1": 0.559165089199025, "macro/f1_ci": {"90": [0.5497301707952231, 0.5689166903459428], "95": [0.5476856978181925, 0.5710003811206343]}, "macro/recall": 0.5694430718770875, "macro/precision": 0.5499368578582033, "per_entity_metric": {"corporation": {"f1": 0.46514047866805414, "f1_ci": {"90": [0.4422362753387115, 0.48909159792525936], "95": [0.43623003635525726, 0.49374912858221975]}, "precision": 0.43737769080234834, "recall": 0.49666666666666665}, "creative_work": {"f1": 0.3904698874917273, "f1_ci": {"90": [0.36092434680684116, 0.4211238997968856], "95": [0.35687967318425945, 0.42683661009613894]}, "precision": 0.3782051282051282, "recall": 0.40355677154582764}, "event": {"f1": 0.4183066361556064, "f1_ci": {"90": [0.39546956111373294, 0.4397802739202638], "95": [0.39134522763851565, 0.44413293286890765]}, "precision": 0.4208103130755064, "recall": 0.41583257506824384}, "group": {"f1": 0.5614035087719299, "f1_ci": {"90": [0.5405763591247462, 0.5834728306426968], "95": [0.5359571482288267, 0.5869609145475759]}, "precision": 0.5753803596127247, "recall": 0.5480895915678524}, "location": {"f1": 0.6389645776566757, "f1_ci": {"90": [0.6109104048765331, 0.6688442881364794], "95": [0.605244670105696, 0.6721568117825428]}, "precision": 0.6236702127659575, "recall": 0.6550279329608939}, "person": {"f1": 0.8044590643274854, "f1_ci": {"90": [0.7932438610200235, 0.8160130648695689], "95": [0.7909297225622194, 0.8184663212435235]}, "precision": 0.797463768115942, "recall": 0.8115781710914455}, "product": {"f1": 0.6354114713216957, "f1_ci": {"90": [0.6130714623048149, 0.6565474489604781], "95": [0.6085662982071728, 0.6597266285956008]}, "precision": 0.616650532429816, "recall": 0.6553497942386831}}}, "2020.test": {"micro/f1": 0.6103825136612021, "micro/f1_ci": {"90": [0.5886597809593919, 0.630754232709721], "95": [0.5853510478005706, 0.6344224019458733]}, "micro/recall": 0.5796574987026466, "micro/precision": 0.6445470282746683, "macro/f1": 0.5675359874657813, "macro/f1_ci": {"90": [0.5455416290059489, 0.5872544909762225], "95": [0.5421124912878689, 0.5910870158401571]}, "macro/recall": 0.5387624182505003, "macro/precision": 0.6021803835272678, "per_entity_metric": {"corporation": {"f1": 0.539440203562341, "f1_ci": {"90": [0.48223350253807107, 0.5925925925925926], "95": [0.47027027027027024, 0.6024160642570282]}, "precision": 0.5247524752475248, "recall": 0.5549738219895288}, "creative_work": {"f1": 0.42771084337349397, "f1_ci": {"90": [0.3701389008713657, 0.48001129943502824], "95": [0.35945076955513383, 0.4898017326588755]}, "precision": 0.46405228758169936, "recall": 0.39664804469273746}, "event": {"f1": 0.39147286821705424, "f1_ci": {"90": [0.3423689033075527, 0.4384615384615384], "95": [0.33401924920284043, 0.4479486677526936]}, "precision": 0.40239043824701193, "recall": 0.38113207547169814}, "group": {"f1": 0.5306859205776173, "f1_ci": {"90": [0.4740687545714476, 0.5835123669931646], "95": [0.4626316755585294, 0.5926018983807928]}, "precision": 0.6049382716049383, "recall": 0.47266881028938906}, "location": {"f1": 0.6266666666666666, "f1_ci": {"90": [0.5584730144800351, 0.689055929352397], "95": [0.5435147751150357, 0.7016515521450994]}, "precision": 0.6962962962962963, "recall": 0.5696969696969697}, "person": {"f1": 0.805944055944056, "f1_ci": {"90": [0.7759176252073368, 0.8316523801385778], "95": [0.7702132619352088, 0.8373703976596187]}, "precision": 0.8412408759124088, "recall": 0.7734899328859061}, "product": {"f1": 0.6508313539192399, "f1_ci": {"90": [0.6010349610090543, 0.6958744811793329], "95": [0.5892310901468917, 0.7061625360343002]}, "precision": 0.681592039800995, "recall": 0.6227272727272727}}}, "2021.test (span detection)": {"micro/f1": 0.7572194954913822, "micro/f1_ci": {}, "micro/recall": 0.7672024979761767, "micro/precision": 0.7474929577464788, "macro/f1": 0.7572194954913822, "macro/f1_ci": {}, "macro/recall": 0.7672024979761767, "macro/precision": 0.7474929577464788}, "2020.test (span detection)": {"micro/f1": 0.7273224043715847, "micro/f1_ci": {}, "micro/recall": 0.6907109496626881, "micro/precision": 0.7680323139065205, "macro/f1": 0.7273224043715847, "macro/f1_ci": {}, "macro/recall": 0.6907109496626881, "macro/precision": 0.7680323139065205}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6103825136612021, "micro/f1_ci": {"90": [0.5886597809593919, 0.630754232709721], "95": [0.5853510478005706, 0.6344224019458733]}, "micro/recall": 0.5796574987026466, "micro/precision": 0.6445470282746683, "macro/f1": 0.5675359874657813, "macro/f1_ci": {"90": [0.5455416290059489, 0.5872544909762225], "95": [0.5421124912878689, 0.5910870158401571]}, "macro/recall": 0.5387624182505003, "macro/precision": 0.6021803835272678, "per_entity_metric": {"corporation": {"f1": 0.539440203562341, "f1_ci": {"90": [0.48223350253807107, 0.5925925925925926], "95": [0.47027027027027024, 0.6024160642570282]}, "precision": 0.5247524752475248, "recall": 0.5549738219895288}, "creative_work": {"f1": 0.42771084337349397, "f1_ci": {"90": [0.3701389008713657, 0.48001129943502824], "95": [0.35945076955513383, 0.4898017326588755]}, "precision": 0.46405228758169936, "recall": 0.39664804469273746}, "event": {"f1": 0.39147286821705424, "f1_ci": {"90": [0.3423689033075527, 0.4384615384615384], "95": [0.33401924920284043, 0.4479486677526936]}, "precision": 0.40239043824701193, "recall": 0.38113207547169814}, "group": {"f1": 0.5306859205776173, "f1_ci": {"90": [0.4740687545714476, 0.5835123669931646], "95": [0.4626316755585294, 0.5926018983807928]}, "precision": 0.6049382716049383, "recall": 0.47266881028938906}, "location": {"f1": 0.6266666666666666, "f1_ci": {"90": [0.5584730144800351, 0.689055929352397], "95": [0.5435147751150357, 0.7016515521450994]}, "precision": 0.6962962962962963, "recall": 0.5696969696969697}, "person": {"f1": 0.805944055944056, "f1_ci": {"90": [0.7759176252073368, 0.8316523801385778], "95": [0.7702132619352088, 0.8373703976596187]}, "precision": 0.8412408759124088, "recall": 0.7734899328859061}, "product": {"f1": 0.6508313539192399, "f1_ci": {"90": [0.6010349610090543, 0.6958744811793329], "95": [0.5892310901468917, 0.7061625360343002]}, "precision": 0.681592039800995, "recall": 0.6227272727272727}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.609117361784675, "micro/f1_ci": {"90": [0.6000414265573856, 0.6190415373631918], "95": [0.5981509067764902, 0.6206829089362571]}, "micro/recall": 0.6172525439407955, "micro/precision": 0.6011938281337988, "macro/f1": 0.559165089199025, "macro/f1_ci": {"90": [0.5497301707952231, 0.5689166903459428], "95": [0.5476856978181925, 0.5710003811206343]}, "macro/recall": 0.5694430718770875, "macro/precision": 0.5499368578582033, "per_entity_metric": {"corporation": {"f1": 0.46514047866805414, "f1_ci": {"90": [0.4422362753387115, 0.48909159792525936], "95": [0.43623003635525726, 0.49374912858221975]}, "precision": 0.43737769080234834, "recall": 0.49666666666666665}, "creative_work": {"f1": 0.3904698874917273, "f1_ci": {"90": [0.36092434680684116, 0.4211238997968856], "95": [0.35687967318425945, 0.42683661009613894]}, "precision": 0.3782051282051282, "recall": 0.40355677154582764}, "event": {"f1": 0.4183066361556064, "f1_ci": {"90": [0.39546956111373294, 0.4397802739202638], "95": [0.39134522763851565, 0.44413293286890765]}, "precision": 0.4208103130755064, "recall": 0.41583257506824384}, "group": {"f1": 0.5614035087719299, "f1_ci": {"90": [0.5405763591247462, 0.5834728306426968], "95": [0.5359571482288267, 0.5869609145475759]}, "precision": 0.5753803596127247, "recall": 0.5480895915678524}, "location": {"f1": 0.6389645776566757, "f1_ci": {"90": [0.6109104048765331, 0.6688442881364794], "95": [0.605244670105696, 0.6721568117825428]}, "precision": 0.6236702127659575, "recall": 0.6550279329608939}, "person": {"f1": 0.8044590643274854, "f1_ci": {"90": [0.7932438610200235, 0.8160130648695689], "95": [0.7909297225622194, 0.8184663212435235]}, "precision": 0.797463768115942, "recall": 0.8115781710914455}, "product": {"f1": 0.6354114713216957, "f1_ci": {"90": [0.6130714623048149, 0.6565474489604781], "95": [0.6085662982071728, 0.6597266285956008]}, "precision": 0.616650532429816, "recall": 0.6553497942386831}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7273224043715847, "micro/f1_ci": {}, "micro/recall": 0.6907109496626881, "micro/precision": 0.7680323139065205, "macro/f1": 0.7273224043715847, "macro/f1_ci": {}, "macro/recall": 0.6907109496626881, "macro/precision": 0.7680323139065205}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7572194954913822, "micro/f1_ci": {}, "micro/recall": 0.7672024979761767, "micro/precision": 0.7474929577464788, "macro/f1": 0.7572194954913822, "macro/f1_ci": {}, "macro/recall": 0.7672024979761767, "macro/precision": 0.7474929577464788}
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
 
eval/prediction.random.dev.json DELETED
The diff for this file is too large to render. See raw diff
 
trainer_config.json CHANGED
@@ -1 +1 @@
1
- {"data_split": "random.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_random", "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}