asahi417 commited on
Commit
bfb0923
1 Parent(s): cccef39

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
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.6008989019741707
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.591443610706686
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6106614246068455
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5467450408285621
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.537717358363018
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.5582367980568581
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7560892328704758
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.744313725490196
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.7682433213831387
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.6087425796006476
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6340640809443507
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.5853658536585366
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.5648877924450979
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.5930039411771633
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.5426595099078766
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7242309767943875
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7543563799887577
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.6964193046185781
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
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_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.6008989019741707
94
+ - Precision (micro): 0.591443610706686
95
+ - Recall (micro): 0.6106614246068455
96
+ - F1 (macro): 0.5467450408285621
97
+ - Precision (macro): 0.537717358363018
98
+ - Recall (macro): 0.5582367980568581
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.4411294619072989
104
+ - creative_work: 0.3751552795031057
105
+ - event: 0.40279069767441866
106
+ - group: 0.5576791808873721
107
+ - location: 0.6179921773142112
108
+ - person: 0.8051622154507977
109
+ - product: 0.6273062730627307
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.5924664556782363, 0.6106294776916564]
114
+ - 95%: [0.5905572257793882, 0.6119935888266077]
115
+ - F1 (macro):
116
+ - 90%: [0.5924664556782363, 0.6106294776916564]
117
+ - 95%: [0.5905572257793882, 0.6119935888266077]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/bert-base-tweetner7-2020/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/bert-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/bert-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: bert-base-cased
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/bert-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.6070060207991242, "micro/f1_ci": {}, "micro/recall": 0.5794148380355277, "micro/precision": 0.6373563218390804, "macro/f1": 0.5467850521523531, "macro/f1_ci": {}, "macro/recall": 0.5207678704660276, "macro/precision": 0.5797488300321645, "per_entity_metric": {"corporation": {"f1": 0.448, "f1_ci": {}, "precision": 0.4883720930232558, "recall": 0.41379310344827586}, "creative_work": {"f1": 0.4136125654450261, "f1_ci": {}, "precision": 0.4540229885057471, "recall": 0.3798076923076923}, "event": {"f1": 0.3472803347280335, "f1_ci": {}, "precision": 0.3738738738738739, "recall": 0.32421875}, "group": {"f1": 0.5349397590361447, "f1_ci": {}, "precision": 0.5904255319148937, "recall": 0.4889867841409692}, "location": {"f1": 0.6047745358090184, "f1_ci": {}, "precision": 0.5816326530612245, "recall": 0.6298342541436464}, "person": {"f1": 0.8340283569641368, "f1_ci": {}, "precision": 0.831946755407654, "recall": 0.8361204013377926}, "product": {"f1": 0.644859813084112, "f1_ci": {}, "precision": 0.7379679144385026, "recall": 0.5726141078838174}}}, "2021.test": {"micro/f1": 0.6008989019741707, "micro/f1_ci": {"90": [0.5924664556782363, 0.6106294776916564], "95": [0.5905572257793882, 0.6119935888266077]}, "micro/recall": 0.6106614246068455, "micro/precision": 0.591443610706686, "macro/f1": 0.5467450408285621, "macro/f1_ci": {"90": [0.537317329281437, 0.5560337192806812], "95": [0.5354694155361338, 0.5580169049677575]}, "macro/recall": 0.5582367980568581, "macro/precision": 0.537717358363018, "per_entity_metric": {"corporation": {"f1": 0.4411294619072989, "f1_ci": {"90": [0.4151031001476261, 0.4668282751041523], "95": [0.4105067256738155, 0.47152140567132833]}, "precision": 0.42374616171954965, "recall": 0.46}, "creative_work": {"f1": 0.3751552795031057, "f1_ci": {"90": [0.3457281280218126, 0.405156902550491], "95": [0.34063869755792114, 0.41240861376957344]}, "precision": 0.3435722411831627, "recall": 0.4131326949384405}, "event": {"f1": 0.40279069767441866, "f1_ci": {"90": [0.3787119736963134, 0.4261736127060404], "95": [0.3742672669780581, 0.43103672973184526]}, "precision": 0.41198858230256896, "recall": 0.3939945404913558}, "group": {"f1": 0.5576791808873721, "f1_ci": {"90": [0.5357206877355878, 0.5791400107976302], "95": [0.5319548928759554, 0.5857991484361441]}, "precision": 0.5786118980169972, "recall": 0.5382081686429513}, "location": {"f1": 0.6179921773142112, "f1_ci": {"90": [0.5907379257184063, 0.6452965887051165], "95": [0.5849555120039597, 0.6503756726024427]}, "precision": 0.5794621026894865, "recall": 0.6620111731843575}, "person": {"f1": 0.8051622154507977, "f1_ci": {"90": [0.7940780338055736, 0.8169159097793982], "95": [0.7911344383076124, 0.8199079325067802]}, "precision": 0.7833972793861179, "recall": 0.8281710914454278}, "product": {"f1": 0.6273062730627307, "f1_ci": {"90": [0.6036743989614689, 0.6494340793310508], "95": [0.600650185458071, 0.6527402503143698]}, "precision": 0.6432432432432432, "recall": 0.6121399176954733}}}, "2020.test": {"micro/f1": 0.6087425796006476, "micro/f1_ci": {"90": [0.5869140222403038, 0.6303137007490964], "95": [0.583969030579955, 0.6335264711755912]}, "micro/recall": 0.5853658536585366, "micro/precision": 0.6340640809443507, "macro/f1": 0.5648877924450979, "macro/f1_ci": {"90": [0.541183700525316, 0.585728250601802], "95": [0.5380102168624624, 0.591001416229615]}, "macro/recall": 0.5426595099078766, "macro/precision": 0.5930039411771633, "per_entity_metric": {"corporation": {"f1": 0.5076923076923078, "f1_ci": {"90": [0.4456521739130435, 0.5648113256921546], "95": [0.4376895486195893, 0.5757609577922077]}, "precision": 0.49748743718592964, "recall": 0.518324607329843}, "creative_work": {"f1": 0.4406779661016949, "f1_ci": {"90": [0.3846046710949218, 0.5], "95": [0.3716590434523217, 0.5099408614379356]}, "precision": 0.44571428571428573, "recall": 0.43575418994413406}, "event": {"f1": 0.3834586466165414, "f1_ci": {"90": [0.3339654883922945, 0.4358004007303413], "95": [0.32399628008752734, 0.446370839473633]}, "precision": 0.38202247191011235, "recall": 0.3849056603773585}, "group": {"f1": 0.5318352059925093, "f1_ci": {"90": [0.47824719715613895, 0.5828882751694703], "95": [0.4639112831305961, 0.5931040718338841]}, "precision": 0.6367713004484304, "recall": 0.4565916398713826}, "location": {"f1": 0.6329113924050632, "f1_ci": {"90": [0.5619170872324033, 0.6942846790495442], "95": [0.5498484235005866, 0.7070288046928012]}, "precision": 0.6622516556291391, "recall": 0.6060606060606061}, "person": {"f1": 0.810580204778157, "f1_ci": {"90": [0.7831524826802577, 0.8346320308628404], "95": [0.7777679623085985, 0.8402630660959797]}, "precision": 0.8246527777777778, "recall": 0.7969798657718121}, "product": {"f1": 0.6470588235294118, "f1_ci": {"90": [0.591608369865995, 0.6975540206577531], "95": [0.5796820837872635, 0.711355295878703]}, "precision": 0.7021276595744681, "recall": 0.6}}}, "2021.test (span detection)": {"micro/f1": 0.7560892328704758, "micro/f1_ci": {}, "micro/recall": 0.7682433213831387, "micro/precision": 0.744313725490196, "macro/f1": 0.7560892328704758, "macro/f1_ci": {}, "macro/recall": 0.7682433213831387, "macro/precision": 0.744313725490196}, "2020.test (span detection)": {"micro/f1": 0.7242309767943875, "micro/f1_ci": {}, "micro/recall": 0.6964193046185781, "micro/precision": 0.7543563799887577, "macro/f1": 0.7242309767943875, "macro/f1_ci": {}, "macro/recall": 0.6964193046185781, "macro/precision": 0.7543563799887577}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6087425796006476, "micro/f1_ci": {"90": [0.5869140222403038, 0.6303137007490964], "95": [0.583969030579955, 0.6335264711755912]}, "micro/recall": 0.5853658536585366, "micro/precision": 0.6340640809443507, "macro/f1": 0.5648877924450979, "macro/f1_ci": {"90": [0.541183700525316, 0.585728250601802], "95": [0.5380102168624624, 0.591001416229615]}, "macro/recall": 0.5426595099078766, "macro/precision": 0.5930039411771633, "per_entity_metric": {"corporation": {"f1": 0.5076923076923078, "f1_ci": {"90": [0.4456521739130435, 0.5648113256921546], "95": [0.4376895486195893, 0.5757609577922077]}, "precision": 0.49748743718592964, "recall": 0.518324607329843}, "creative_work": {"f1": 0.4406779661016949, "f1_ci": {"90": [0.3846046710949218, 0.5], "95": [0.3716590434523217, 0.5099408614379356]}, "precision": 0.44571428571428573, "recall": 0.43575418994413406}, "event": {"f1": 0.3834586466165414, "f1_ci": {"90": [0.3339654883922945, 0.4358004007303413], "95": [0.32399628008752734, 0.446370839473633]}, "precision": 0.38202247191011235, "recall": 0.3849056603773585}, "group": {"f1": 0.5318352059925093, "f1_ci": {"90": [0.47824719715613895, 0.5828882751694703], "95": [0.4639112831305961, 0.5931040718338841]}, "precision": 0.6367713004484304, "recall": 0.4565916398713826}, "location": {"f1": 0.6329113924050632, "f1_ci": {"90": [0.5619170872324033, 0.6942846790495442], "95": [0.5498484235005866, 0.7070288046928012]}, "precision": 0.6622516556291391, "recall": 0.6060606060606061}, "person": {"f1": 0.810580204778157, "f1_ci": {"90": [0.7831524826802577, 0.8346320308628404], "95": [0.7777679623085985, 0.8402630660959797]}, "precision": 0.8246527777777778, "recall": 0.7969798657718121}, "product": {"f1": 0.6470588235294118, "f1_ci": {"90": [0.591608369865995, 0.6975540206577531], "95": [0.5796820837872635, 0.711355295878703]}, "precision": 0.7021276595744681, "recall": 0.6}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6008989019741707, "micro/f1_ci": {"90": [0.5924664556782363, 0.6106294776916564], "95": [0.5905572257793882, 0.6119935888266077]}, "micro/recall": 0.6106614246068455, "micro/precision": 0.591443610706686, "macro/f1": 0.5467450408285621, "macro/f1_ci": {"90": [0.537317329281437, 0.5560337192806812], "95": [0.5354694155361338, 0.5580169049677575]}, "macro/recall": 0.5582367980568581, "macro/precision": 0.537717358363018, "per_entity_metric": {"corporation": {"f1": 0.4411294619072989, "f1_ci": {"90": [0.4151031001476261, 0.4668282751041523], "95": [0.4105067256738155, 0.47152140567132833]}, "precision": 0.42374616171954965, "recall": 0.46}, "creative_work": {"f1": 0.3751552795031057, "f1_ci": {"90": [0.3457281280218126, 0.405156902550491], "95": [0.34063869755792114, 0.41240861376957344]}, "precision": 0.3435722411831627, "recall": 0.4131326949384405}, "event": {"f1": 0.40279069767441866, "f1_ci": {"90": [0.3787119736963134, 0.4261736127060404], "95": [0.3742672669780581, 0.43103672973184526]}, "precision": 0.41198858230256896, "recall": 0.3939945404913558}, "group": {"f1": 0.5576791808873721, "f1_ci": {"90": [0.5357206877355878, 0.5791400107976302], "95": [0.5319548928759554, 0.5857991484361441]}, "precision": 0.5786118980169972, "recall": 0.5382081686429513}, "location": {"f1": 0.6179921773142112, "f1_ci": {"90": [0.5907379257184063, 0.6452965887051165], "95": [0.5849555120039597, 0.6503756726024427]}, "precision": 0.5794621026894865, "recall": 0.6620111731843575}, "person": {"f1": 0.8051622154507977, "f1_ci": {"90": [0.7940780338055736, 0.8169159097793982], "95": [0.7911344383076124, 0.8199079325067802]}, "precision": 0.7833972793861179, "recall": 0.8281710914454278}, "product": {"f1": 0.6273062730627307, "f1_ci": {"90": [0.6036743989614689, 0.6494340793310508], "95": [0.600650185458071, 0.6527402503143698]}, "precision": 0.6432432432432432, "recall": 0.6121399176954733}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7242309767943875, "micro/f1_ci": {}, "micro/recall": 0.6964193046185781, "micro/precision": 0.7543563799887577, "macro/f1": 0.7242309767943875, "macro/f1_ci": {}, "macro/recall": 0.6964193046185781, "macro/precision": 0.7543563799887577}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7560892328704758, "micro/f1_ci": {}, "micro/recall": 0.7682433213831387, "micro/precision": 0.744313725490196, "macro/f1": 0.7560892328704758, "macro/f1_ci": {}, "macro/recall": 0.7682433213831387, "macro/precision": 0.744313725490196}
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": "bert-base-cased", "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": "bert-base-cased", "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}