asahi417 commited on
Commit
fa48eec
1 Parent(s): 4e520fd

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-large-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.6401254269555967
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6205623710780589
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6609620721554117
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5947383155381057
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5738855505495571
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6206178838164583
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7826184343151529
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7586581261535121
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.8081415519833468
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.659346545259775
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.6812396236856668
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6388168137000519
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6261309560026784
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6527657911787169
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.6111694484964181
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7738478027867096
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.8
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.749351323300467
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-large-tweetner7-2020
88
+
89
+ This model is a fine-tuned version of [vinai/bertweet-large](https://huggingface.co/vinai/bertweet-large) 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.6401254269555967
94
+ - Precision (micro): 0.6205623710780589
95
+ - Recall (micro): 0.6609620721554117
96
+ - F1 (macro): 0.5947383155381057
97
+ - Precision (macro): 0.5738855505495571
98
+ - Recall (macro): 0.6206178838164583
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5229357798165137
104
+ - creative_work: 0.4629981024667932
105
+ - event: 0.4499572284003422
106
+ - group: 0.592749032030975
107
+ - location: 0.6553030303030303
108
+ - person: 0.8273135669362084
109
+ - product: 0.6519114688128772
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6315544728348781, 0.6491758274095626]
114
+ - 95%: [0.6294268706225905, 0.6515448119225267]
115
+ - F1 (macro):
116
+ - 90%: [0.6315544728348781, 0.6491758274095626]
117
+ - 95%: [0.6294268706225905, 0.6515448119225267]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/bertweet-large-tweetner7-2020/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/bertweet-large-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-large-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-large
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.3
152
+ - max_grad_norm: 1
153
+
154
+ The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/bertweet-large-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.6437029063509151, "micro/f1_ci": {}, "micro/recall": 0.6248693834900731, "micro/precision": 0.6637069922308546, "macro/f1": 0.591642865243014, "macro/f1_ci": {}, "macro/recall": 0.5755700410698614, "macro/precision": 0.6133965500147562, "per_entity_metric": {"corporation": {"f1": 0.5051546391752577, "f1_ci": {}, "precision": 0.5297297297297298, "recall": 0.4827586206896552}, "creative_work": {"f1": 0.54, "f1_ci": {}, "precision": 0.5625, "recall": 0.5192307692307693}, "event": {"f1": 0.39312977099236646, "f1_ci": {}, "precision": 0.3843283582089552, "recall": 0.40234375}, "group": {"f1": 0.5495049504950495, "f1_ci": {}, "precision": 0.6271186440677966, "recall": 0.4889867841409692}, "location": {"f1": 0.6227848101265823, "f1_ci": {}, "precision": 0.5747663551401869, "recall": 0.6795580110497238}, "person": {"f1": 0.874675885911841, "f1_ci": {}, "precision": 0.9051878354203936, "recall": 0.8461538461538461}, "product": {"f1": 0.6562500000000001, "f1_ci": {}, "precision": 0.7101449275362319, "recall": 0.6099585062240664}}}, "2021.test": {"micro/f1": 0.6401254269555967, "micro/f1_ci": {"90": [0.6315544728348781, 0.6491758274095626], "95": [0.6294268706225905, 0.6515448119225267]}, "micro/recall": 0.6609620721554117, "micro/precision": 0.6205623710780589, "macro/f1": 0.5947383155381057, "macro/f1_ci": {"90": [0.5852724504065837, 0.6043623226898465], "95": [0.5836410112124547, 0.6063768583335745]}, "macro/recall": 0.6206178838164583, "macro/precision": 0.5738855505495571, "per_entity_metric": {"corporation": {"f1": 0.5229357798165137, "f1_ci": {"90": [0.49706039551042225, 0.5489060654201801], "95": [0.49299356150347506, 0.5543603424996233]}, "precision": 0.4830508474576271, "recall": 0.57}, "creative_work": {"f1": 0.4629981024667932, "f1_ci": {"90": [0.43277573053403184, 0.4925610964986595], "95": [0.4272513399167463, 0.49761378932009187]}, "precision": 0.43058823529411766, "recall": 0.5006839945280438}, "event": {"f1": 0.4499572284003422, "f1_ci": {"90": [0.4274287289095753, 0.47154022208242086], "95": [0.4228081863105448, 0.47623473640595676]}, "precision": 0.4245359160613398, "recall": 0.4786169244767971}, "group": {"f1": 0.592749032030975, "f1_ci": {"90": [0.5722540581576642, 0.6147130977130977], "95": [0.5676533946830992, 0.6194597542880659]}, "precision": 0.636432350718065, "recall": 0.5546772068511199}, "location": {"f1": 0.6553030303030303, "f1_ci": {"90": [0.6304163397345088, 0.6817280494561573], "95": [0.6255962515548817, 0.6867043413492904]}, "precision": 0.597926267281106, "recall": 0.7248603351955307}, "person": {"f1": 0.8273135669362084, "f1_ci": {"90": [0.8160811561878993, 0.8380472862595445], "95": [0.814691063129817, 0.8397603550670991]}, "precision": 0.806869961444094, "recall": 0.8488200589970502}, "product": {"f1": 0.6519114688128772, "f1_ci": {"90": [0.6299024970087858, 0.6725193990424303], "95": [0.6268028691225062, 0.6764233561966475]}, "precision": 0.6377952755905512, "recall": 0.6666666666666666}}}, "2020.test": {"micro/f1": 0.659346545259775, "micro/f1_ci": {"90": [0.638530476656731, 0.6770002736609395], "95": [0.6355787571672109, 0.6814383304317009]}, "micro/recall": 0.6388168137000519, "micro/precision": 0.6812396236856668, "macro/f1": 0.6261309560026784, "macro/f1_ci": {"90": [0.6035614787399021, 0.6466837937863731], "95": [0.6008212526260872, 0.6498051149764593]}, "macro/recall": 0.6111694484964181, "macro/precision": 0.6527657911787169, "per_entity_metric": {"corporation": {"f1": 0.5966587112171838, "f1_ci": {"90": [0.5434307846076962, 0.6461646550171141], "95": [0.5326863869413766, 0.6552623249971564]}, "precision": 0.5482456140350878, "recall": 0.6544502617801047}, "creative_work": {"f1": 0.5892351274787537, "f1_ci": {"90": [0.5297221164826799, 0.6412325295653509], "95": [0.5167939021229471, 0.6498711140898077]}, "precision": 0.5977011494252874, "recall": 0.5810055865921788}, "event": {"f1": 0.4500907441016334, "f1_ci": {"90": [0.4, 0.5], "95": [0.3933869964988056, 0.5071014607812004]}, "precision": 0.43356643356643354, "recall": 0.4679245283018868}, "group": {"f1": 0.5454545454545454, "f1_ci": {"90": [0.4908707249478041, 0.5995649027168184], "95": [0.47806491874824353, 0.6098095911901321]}, "precision": 0.7076923076923077, "recall": 0.4437299035369775}, "location": {"f1": 0.6808510638297872, "f1_ci": {"90": [0.6158357771260997, 0.7378894784375705], "95": [0.6056659605996418, 0.7468373964681981]}, "precision": 0.6829268292682927, "recall": 0.6787878787878788}, "person": {"f1": 0.8358974358974359, "f1_ci": {"90": [0.8090079967608057, 0.8589565954118873], "95": [0.802661820512157, 0.864705203631851]}, "precision": 0.8519163763066202, "recall": 0.8204697986577181}, "product": {"f1": 0.6847290640394088, "f1_ci": {"90": [0.6328984758460346, 0.731190820093083], "95": [0.6213509150900847, 0.7403650506863269]}, "precision": 0.7473118279569892, "recall": 0.6318181818181818}}}, "2021.test (span detection)": {"micro/f1": 0.7826184343151529, "micro/f1_ci": {}, "micro/recall": 0.8081415519833468, "micro/precision": 0.7586581261535121, "macro/f1": 0.7826184343151529, "macro/f1_ci": {}, "macro/recall": 0.8081415519833468, "macro/precision": 0.7586581261535121}, "2020.test (span detection)": {"micro/f1": 0.7738478027867096, "micro/f1_ci": {}, "micro/recall": 0.749351323300467, "micro/precision": 0.8, "macro/f1": 0.7738478027867096, "macro/f1_ci": {}, "macro/recall": 0.749351323300467, "macro/precision": 0.8}}
 
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.659346545259775, "micro/f1_ci": {"90": [0.638530476656731, 0.6770002736609395], "95": [0.6355787571672109, 0.6814383304317009]}, "micro/recall": 0.6388168137000519, "micro/precision": 0.6812396236856668, "macro/f1": 0.6261309560026784, "macro/f1_ci": {"90": [0.6035614787399021, 0.6466837937863731], "95": [0.6008212526260872, 0.6498051149764593]}, "macro/recall": 0.6111694484964181, "macro/precision": 0.6527657911787169, "per_entity_metric": {"corporation": {"f1": 0.5966587112171838, "f1_ci": {"90": [0.5434307846076962, 0.6461646550171141], "95": [0.5326863869413766, 0.6552623249971564]}, "precision": 0.5482456140350878, "recall": 0.6544502617801047}, "creative_work": {"f1": 0.5892351274787537, "f1_ci": {"90": [0.5297221164826799, 0.6412325295653509], "95": [0.5167939021229471, 0.6498711140898077]}, "precision": 0.5977011494252874, "recall": 0.5810055865921788}, "event": {"f1": 0.4500907441016334, "f1_ci": {"90": [0.4, 0.5], "95": [0.3933869964988056, 0.5071014607812004]}, "precision": 0.43356643356643354, "recall": 0.4679245283018868}, "group": {"f1": 0.5454545454545454, "f1_ci": {"90": [0.4908707249478041, 0.5995649027168184], "95": [0.47806491874824353, 0.6098095911901321]}, "precision": 0.7076923076923077, "recall": 0.4437299035369775}, "location": {"f1": 0.6808510638297872, "f1_ci": {"90": [0.6158357771260997, 0.7378894784375705], "95": [0.6056659605996418, 0.7468373964681981]}, "precision": 0.6829268292682927, "recall": 0.6787878787878788}, "person": {"f1": 0.8358974358974359, "f1_ci": {"90": [0.8090079967608057, 0.8589565954118873], "95": [0.802661820512157, 0.864705203631851]}, "precision": 0.8519163763066202, "recall": 0.8204697986577181}, "product": {"f1": 0.6847290640394088, "f1_ci": {"90": [0.6328984758460346, 0.731190820093083], "95": [0.6213509150900847, 0.7403650506863269]}, "precision": 0.7473118279569892, "recall": 0.6318181818181818}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6401254269555967, "micro/f1_ci": {"90": [0.6315544728348781, 0.6491758274095626], "95": [0.6294268706225905, 0.6515448119225267]}, "micro/recall": 0.6609620721554117, "micro/precision": 0.6205623710780589, "macro/f1": 0.5947383155381057, "macro/f1_ci": {"90": [0.5852724504065837, 0.6043623226898465], "95": [0.5836410112124547, 0.6063768583335745]}, "macro/recall": 0.6206178838164583, "macro/precision": 0.5738855505495571, "per_entity_metric": {"corporation": {"f1": 0.5229357798165137, "f1_ci": {"90": [0.49706039551042225, 0.5489060654201801], "95": [0.49299356150347506, 0.5543603424996233]}, "precision": 0.4830508474576271, "recall": 0.57}, "creative_work": {"f1": 0.4629981024667932, "f1_ci": {"90": [0.43277573053403184, 0.4925610964986595], "95": [0.4272513399167463, 0.49761378932009187]}, "precision": 0.43058823529411766, "recall": 0.5006839945280438}, "event": {"f1": 0.4499572284003422, "f1_ci": {"90": [0.4274287289095753, 0.47154022208242086], "95": [0.4228081863105448, 0.47623473640595676]}, "precision": 0.4245359160613398, "recall": 0.4786169244767971}, "group": {"f1": 0.592749032030975, "f1_ci": {"90": [0.5722540581576642, 0.6147130977130977], "95": [0.5676533946830992, 0.6194597542880659]}, "precision": 0.636432350718065, "recall": 0.5546772068511199}, "location": {"f1": 0.6553030303030303, "f1_ci": {"90": [0.6304163397345088, 0.6817280494561573], "95": [0.6255962515548817, 0.6867043413492904]}, "precision": 0.597926267281106, "recall": 0.7248603351955307}, "person": {"f1": 0.8273135669362084, "f1_ci": {"90": [0.8160811561878993, 0.8380472862595445], "95": [0.814691063129817, 0.8397603550670991]}, "precision": 0.806869961444094, "recall": 0.8488200589970502}, "product": {"f1": 0.6519114688128772, "f1_ci": {"90": [0.6299024970087858, 0.6725193990424303], "95": [0.6268028691225062, 0.6764233561966475]}, "precision": 0.6377952755905512, "recall": 0.6666666666666666}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7738478027867096, "micro/f1_ci": {}, "micro/recall": 0.749351323300467, "micro/precision": 0.8, "macro/f1": 0.7738478027867096, "macro/f1_ci": {}, "macro/recall": 0.749351323300467, "macro/precision": 0.8}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7826184343151529, "micro/f1_ci": {}, "micro/recall": 0.8081415519833468, "micro/precision": 0.7586581261535121, "macro/f1": 0.7826184343151529, "macro/f1_ci": {}, "macro/recall": 0.8081415519833468, "macro/precision": 0.7586581261535121}
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-large", "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.3, "max_grad_norm": 1}
 
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train_2020", "dataset_name": null, "local_dataset": null, "model": "vinai/bertweet-large", "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.3, "max_grad_norm": 1}