asahi417 commited on
Commit
bc66b6a
1 Parent(s): f92ec91

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-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.6230258640421148
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6166742183960127
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6295097132284921
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5758556427048315
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5715554663683273
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.5821234872899773
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7661839619941617
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7584995466908432
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7740256736440384
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.6210070384407147
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6491228070175439
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.5952257394914374
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.577436139660066
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6119340101835135
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.549500601374034
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7298321602598808
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7628749292586304
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.6995329527763363
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-2020-2021-concat
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_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.6230258640421148
94
+ - Precision (micro): 0.6166742183960127
95
+ - Recall (micro): 0.6295097132284921
96
+ - F1 (macro): 0.5758556427048315
97
+ - Precision (macro): 0.5715554663683273
98
+ - Recall (macro): 0.5821234872899773
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5141176470588235
104
+ - creative_work: 0.3886075949367089
105
+ - event: 0.4580617122990004
106
+ - group: 0.5660613650594865
107
+ - location: 0.6264564770390679
108
+ - person: 0.8196536144578314
109
+ - product: 0.6580310880829014
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6139925448708724, 0.632549139769655]
114
+ - 95%: [0.612303125388328, 0.6336744975616968]
115
+ - F1 (macro):
116
+ - 90%: [0.6139925448708724, 0.632549139769655]
117
+ - 95%: [0.612303125388328, 0.6336744975616968]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/bert-base-tweetner7-2020-2021-concat/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/bert-base-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/bert-base-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: 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.3
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-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.6272365805168986, "micro/f1_ci": {}, "micro/recall": 0.631, "micro/precision": 0.6235177865612648, "macro/f1": 0.578141938973107, "macro/f1_ci": {}, "macro/recall": 0.577392851398218, "macro/precision": 0.5799685464596722, "per_entity_metric": {"corporation": {"f1": 0.5918367346938775, "f1_ci": {}, "precision": 0.6170212765957447, "recall": 0.5686274509803921}, "creative_work": {"f1": 0.3815789473684211, "f1_ci": {}, "precision": 0.3717948717948718, "recall": 0.3918918918918919}, "event": {"f1": 0.41947565543071164, "f1_ci": {}, "precision": 0.4117647058823529, "recall": 0.42748091603053434}, "group": {"f1": 0.6105263157894737, "f1_ci": {}, "precision": 0.5846774193548387, "recall": 0.6387665198237885}, "location": {"f1": 0.5797101449275361, "f1_ci": {}, "precision": 0.6060606060606061, "recall": 0.5555555555555556}, "person": {"f1": 0.8270944741532976, "f1_ci": {}, "precision": 0.8345323741007195, "recall": 0.8197879858657244}, "product": {"f1": 0.6367713004484306, "f1_ci": {}, "precision": 0.6339285714285714, "recall": 0.6396396396396397}}}, "2021.test": {"micro/f1": 0.6230258640421148, "micro/f1_ci": {"90": [0.6139925448708724, 0.632549139769655], "95": [0.612303125388328, 0.6336744975616968]}, "micro/recall": 0.6295097132284921, "micro/precision": 0.6166742183960127, "macro/f1": 0.5758556427048315, "macro/f1_ci": {"90": [0.5656519179998177, 0.585371041220358], "95": [0.5639180067469939, 0.586921603961901]}, "macro/recall": 0.5821234872899773, "macro/precision": 0.5715554663683273, "per_entity_metric": {"corporation": {"f1": 0.5141176470588235, "f1_ci": {"90": [0.4878216484874022, 0.5397454481031415], "95": [0.48169465214919754, 0.5451600061071579]}, "precision": 0.54625, "recall": 0.4855555555555556}, "creative_work": {"f1": 0.3886075949367089, "f1_ci": {"90": [0.3597256986658403, 0.4188124874941639], "95": [0.3535082020207142, 0.42354681306371]}, "precision": 0.36160188457008247, "recall": 0.41997264021887826}, "event": {"f1": 0.4580617122990004, "f1_ci": {"90": [0.4348966918412935, 0.4793315743183817], "95": [0.43126880173262044, 0.48449054654247115]}, "precision": 0.4384359400998336, "recall": 0.47952684258416745}, "group": {"f1": 0.5660613650594865, "f1_ci": {"90": [0.5454485939592322, 0.5872104279571561], "95": [0.5417478676490005, 0.5923902852388108]}, "precision": 0.5393794749403341, "recall": 0.5955204216073782}, "location": {"f1": 0.6264564770390679, "f1_ci": {"90": [0.597997138769671, 0.6547394206191423], "95": [0.5912249546857395, 0.6582113395040892]}, "precision": 0.6150740242261103, "recall": 0.638268156424581}, "person": {"f1": 0.8196536144578314, "f1_ci": {"90": [0.8086892670302934, 0.8320832481435211], "95": [0.8064352860749925, 0.8343931055298054]}, "precision": 0.8373076923076923, "recall": 0.8027286135693216}, "product": {"f1": 0.6580310880829014, "f1_ci": {"90": [0.6350598078981826, 0.6793531734242207], "95": [0.6308296803788606, 0.6823582405935348]}, "precision": 0.662839248434238, "recall": 0.6532921810699589}}}, "2020.test": {"micro/f1": 0.6210070384407147, "micro/f1_ci": {"90": [0.598677414852038, 0.6408161660194358], "95": [0.5946501055829765, 0.6451765433928058]}, "micro/recall": 0.5952257394914374, "micro/precision": 0.6491228070175439, "macro/f1": 0.577436139660066, "macro/f1_ci": {"90": [0.553295935898165, 0.5979250785226665], "95": [0.5491543194937442, 0.6020438981681012]}, "macro/recall": 0.549500601374034, "macro/precision": 0.6119340101835135, "per_entity_metric": {"corporation": {"f1": 0.5654761904761905, "f1_ci": {"90": [0.5016501650165016, 0.616316099488875], "95": [0.4921110450408684, 0.62540329151051]}, "precision": 0.6551724137931034, "recall": 0.4973821989528796}, "creative_work": {"f1": 0.4152046783625731, "f1_ci": {"90": [0.353622668579627, 0.4713502460914881], "95": [0.3405208523037697, 0.4846713528693937]}, "precision": 0.43558282208588955, "recall": 0.39664804469273746}, "event": {"f1": 0.450354609929078, "f1_ci": {"90": [0.40072106996250306, 0.4983622553239021], "95": [0.39129403514561506, 0.5080412036406674]}, "precision": 0.42474916387959866, "recall": 0.47924528301886793}, "group": {"f1": 0.5423143350604491, "f1_ci": {"90": [0.48928618711385696, 0.5931441022144487], "95": [0.47662690763762394, 0.6043063856034276]}, "precision": 0.585820895522388, "recall": 0.5048231511254019}, "location": {"f1": 0.605263157894737, "f1_ci": {"90": [0.5276388094586867, 0.6763224071389902], "95": [0.5114728539985327, 0.6883279763714547]}, "precision": 0.6618705035971223, "recall": 0.5575757575757576}, "person": {"f1": 0.8185801928133217, "f1_ci": {"90": [0.7927262257895654, 0.8431634280358857], "95": [0.7871878287083727, 0.8474604661726711]}, "precision": 0.8568807339449541, "recall": 0.7835570469798657}, "product": {"f1": 0.6448598130841121, "f1_ci": {"90": [0.590887445887446, 0.6986353389977458], "95": [0.5809278885848259, 0.7056143195046112]}, "precision": 0.6634615384615384, "recall": 0.6272727272727273}}}, "2021.test (span detection)": {"micro/f1": 0.7661839619941617, "micro/f1_ci": {}, "micro/recall": 0.7740256736440384, "micro/precision": 0.7584995466908432, "macro/f1": 0.7661839619941617, "macro/f1_ci": {}, "macro/recall": 0.7740256736440384, "macro/precision": 0.7584995466908432}, "2020.test (span detection)": {"micro/f1": 0.7298321602598808, "micro/f1_ci": {}, "micro/recall": 0.6995329527763363, "micro/precision": 0.7628749292586304, "macro/f1": 0.7298321602598808, "macro/f1_ci": {}, "macro/recall": 0.6995329527763363, "macro/precision": 0.7628749292586304}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6210070384407147, "micro/f1_ci": {"90": [0.598677414852038, 0.6408161660194358], "95": [0.5946501055829765, 0.6451765433928058]}, "micro/recall": 0.5952257394914374, "micro/precision": 0.6491228070175439, "macro/f1": 0.577436139660066, "macro/f1_ci": {"90": [0.553295935898165, 0.5979250785226665], "95": [0.5491543194937442, 0.6020438981681012]}, "macro/recall": 0.549500601374034, "macro/precision": 0.6119340101835135, "per_entity_metric": {"corporation": {"f1": 0.5654761904761905, "f1_ci": {"90": [0.5016501650165016, 0.616316099488875], "95": [0.4921110450408684, 0.62540329151051]}, "precision": 0.6551724137931034, "recall": 0.4973821989528796}, "creative_work": {"f1": 0.4152046783625731, "f1_ci": {"90": [0.353622668579627, 0.4713502460914881], "95": [0.3405208523037697, 0.4846713528693937]}, "precision": 0.43558282208588955, "recall": 0.39664804469273746}, "event": {"f1": 0.450354609929078, "f1_ci": {"90": [0.40072106996250306, 0.4983622553239021], "95": [0.39129403514561506, 0.5080412036406674]}, "precision": 0.42474916387959866, "recall": 0.47924528301886793}, "group": {"f1": 0.5423143350604491, "f1_ci": {"90": [0.48928618711385696, 0.5931441022144487], "95": [0.47662690763762394, 0.6043063856034276]}, "precision": 0.585820895522388, "recall": 0.5048231511254019}, "location": {"f1": 0.605263157894737, "f1_ci": {"90": [0.5276388094586867, 0.6763224071389902], "95": [0.5114728539985327, 0.6883279763714547]}, "precision": 0.6618705035971223, "recall": 0.5575757575757576}, "person": {"f1": 0.8185801928133217, "f1_ci": {"90": [0.7927262257895654, 0.8431634280358857], "95": [0.7871878287083727, 0.8474604661726711]}, "precision": 0.8568807339449541, "recall": 0.7835570469798657}, "product": {"f1": 0.6448598130841121, "f1_ci": {"90": [0.590887445887446, 0.6986353389977458], "95": [0.5809278885848259, 0.7056143195046112]}, "precision": 0.6634615384615384, "recall": 0.6272727272727273}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6230258640421148, "micro/f1_ci": {"90": [0.6139925448708724, 0.632549139769655], "95": [0.612303125388328, 0.6336744975616968]}, "micro/recall": 0.6295097132284921, "micro/precision": 0.6166742183960127, "macro/f1": 0.5758556427048315, "macro/f1_ci": {"90": [0.5656519179998177, 0.585371041220358], "95": [0.5639180067469939, 0.586921603961901]}, "macro/recall": 0.5821234872899773, "macro/precision": 0.5715554663683273, "per_entity_metric": {"corporation": {"f1": 0.5141176470588235, "f1_ci": {"90": [0.4878216484874022, 0.5397454481031415], "95": [0.48169465214919754, 0.5451600061071579]}, "precision": 0.54625, "recall": 0.4855555555555556}, "creative_work": {"f1": 0.3886075949367089, "f1_ci": {"90": [0.3597256986658403, 0.4188124874941639], "95": [0.3535082020207142, 0.42354681306371]}, "precision": 0.36160188457008247, "recall": 0.41997264021887826}, "event": {"f1": 0.4580617122990004, "f1_ci": {"90": [0.4348966918412935, 0.4793315743183817], "95": [0.43126880173262044, 0.48449054654247115]}, "precision": 0.4384359400998336, "recall": 0.47952684258416745}, "group": {"f1": 0.5660613650594865, "f1_ci": {"90": [0.5454485939592322, 0.5872104279571561], "95": [0.5417478676490005, 0.5923902852388108]}, "precision": 0.5393794749403341, "recall": 0.5955204216073782}, "location": {"f1": 0.6264564770390679, "f1_ci": {"90": [0.597997138769671, 0.6547394206191423], "95": [0.5912249546857395, 0.6582113395040892]}, "precision": 0.6150740242261103, "recall": 0.638268156424581}, "person": {"f1": 0.8196536144578314, "f1_ci": {"90": [0.8086892670302934, 0.8320832481435211], "95": [0.8064352860749925, 0.8343931055298054]}, "precision": 0.8373076923076923, "recall": 0.8027286135693216}, "product": {"f1": 0.6580310880829014, "f1_ci": {"90": [0.6350598078981826, 0.6793531734242207], "95": [0.6308296803788606, 0.6823582405935348]}, "precision": 0.662839248434238, "recall": 0.6532921810699589}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7298321602598808, "micro/f1_ci": {}, "micro/recall": 0.6995329527763363, "micro/precision": 0.7628749292586304, "macro/f1": 0.7298321602598808, "macro/f1_ci": {}, "macro/recall": 0.6995329527763363, "macro/precision": 0.7628749292586304}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7661839619941617, "micro/f1_ci": {}, "micro/recall": 0.7740256736440384, "micro/precision": 0.7584995466908432, "macro/f1": 0.7661839619941617, "macro/f1_ci": {}, "macro/recall": 0.7740256736440384, "macro/precision": 0.7584995466908432}
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": "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.3, "max_grad_norm": 1}
 
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train_all", "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.3, "max_grad_norm": 1}