asahi417 commited on
Commit
ebe8f9d
1 Parent(s): 768bf9f

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/roberta-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.6476455837280579
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6250403355921265
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6719472710453284
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.5999877200423757
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5763142106730764
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6296258649141258
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7836361609631033
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7563206024744487
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.8129987278825026
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.6566924926529523
57
+ - name: Precision
58
+ type: precision
59
+ value: 0.676762114537445
60
+ - name: Recall
61
+ type: recall
62
+ value: 0.6377789309807992
63
+ - name: F1 (macro)
64
+ type: f1_macro
65
+ value: 0.6188295807291019
66
+ - name: Precision (macro)
67
+ type: precision_macro
68
+ value: 0.6364060811133587
69
+ - name: Recall (macro)
70
+ type: recall_macro
71
+ value: 0.6056612695801465
72
+ - name: F1 (entity span)
73
+ type: f1_entity_span
74
+ value: 0.7610903260288615
75
+ - name: Precision (entity span)
76
+ type: precision_entity_span
77
+ value: 0.7845730027548209
78
+ - name: Recall (entity span)
79
+ type: recall_entity_span
80
+ value: 0.7389724961079398
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/roberta-large-tweetner7-2020
88
+
89
+ This model is a fine-tuned version of [roberta-large](https://huggingface.co/roberta-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.6476455837280579
94
+ - Precision (micro): 0.6250403355921265
95
+ - Recall (micro): 0.6719472710453284
96
+ - F1 (macro): 0.5999877200423757
97
+ - Precision (macro): 0.5763142106730764
98
+ - Recall (macro): 0.6296258649141258
99
+
100
+
101
+
102
+ The per-entity breakdown of the F1 score on the test set are below:
103
+ - corporation: 0.5222786238014665
104
+ - creative_work: 0.45888441633122484
105
+ - event: 0.4850711988975654
106
+ - group: 0.6087811271297511
107
+ - location: 0.6442612555485098
108
+ - person: 0.8331830477908024
109
+ - product: 0.6474543707973103
110
+
111
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
112
+ - F1 (micro):
113
+ - 90%: [0.6385290008161982, 0.6567664564200659]
114
+ - 95%: [0.6363564668769717, 0.658859612510356]
115
+ - F1 (macro):
116
+ - 90%: [0.6385290008161982, 0.6567664564200659]
117
+ - 95%: [0.6363564668769717, 0.658859612510356]
118
+
119
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-tweetner7-2020/raw/main/eval/metric.json)
120
+ and [metric file of entity span](https://huggingface.co/tner/roberta-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/roberta-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: roberta-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/roberta-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.6376109765940274, "micro/f1_ci": {}, "micro/recall": 0.6191222570532915, "micro/precision": 0.6572379367720466, "macro/f1": 0.5786196442940901, "macro/f1_ci": {}, "macro/recall": 0.5654249405318954, "macro/precision": 0.5969422597833425, "per_entity_metric": {"corporation": {"f1": 0.4817927170868347, "f1_ci": {}, "precision": 0.5584415584415584, "recall": 0.4236453201970443}, "creative_work": {"f1": 0.48470588235294115, "f1_ci": {}, "precision": 0.47465437788018433, "recall": 0.4951923076923077}, "event": {"f1": 0.35802469135802467, "f1_ci": {}, "precision": 0.3782608695652174, "recall": 0.33984375}, "group": {"f1": 0.5526932084309134, "f1_ci": {}, "precision": 0.59, "recall": 0.5198237885462555}, "location": {"f1": 0.6326530612244898, "f1_ci": {}, "precision": 0.5876777251184834, "recall": 0.6850828729281768}, "person": {"f1": 0.8824034334763948, "f1_ci": {}, "precision": 0.9065255731922398, "recall": 0.8595317725752508}, "product": {"f1": 0.6580645161290323, "f1_ci": {}, "precision": 0.6830357142857143, "recall": 0.6348547717842323}}}, "2021.test": {"micro/f1": 0.6476455837280579, "micro/f1_ci": {"90": [0.6385290008161982, 0.6567664564200659], "95": [0.6363564668769717, 0.658859612510356]}, "micro/recall": 0.6719472710453284, "micro/precision": 0.6250403355921265, "macro/f1": 0.5999877200423757, "macro/f1_ci": {"90": [0.5903018424752366, 0.6093669000533246], "95": [0.5885086230990764, 0.6110360741859062]}, "macro/recall": 0.6296258649141258, "macro/precision": 0.5763142106730764, "per_entity_metric": {"corporation": {"f1": 0.5222786238014665, "f1_ci": {"90": [0.49611256679291055, 0.5478078174587232], "95": [0.49198763971017245, 0.551254088611594]}, "precision": 0.5303550973654066, "recall": 0.5144444444444445}, "creative_work": {"f1": 0.45888441633122484, "f1_ci": {"90": [0.4285590920305946, 0.4895786422964291], "95": [0.42341279056771075, 0.49464986033814345]}, "precision": 0.3958333333333333, "recall": 0.5458276333789329}, "event": {"f1": 0.4850711988975654, "f1_ci": {"90": [0.4636404229764949, 0.5075191503615117], "95": [0.4590502128752059, 0.5112888082910241]}, "precision": 0.4897959183673469, "recall": 0.48043676069153773}, "group": {"f1": 0.6087811271297511, "f1_ci": {"90": [0.588588460184114, 0.631713867557066], "95": [0.5841833299097599, 0.6362803334551821]}, "precision": 0.605606258148631, "recall": 0.6119894598155468}, "location": {"f1": 0.6442612555485098, "f1_ci": {"90": [0.6152870444442612, 0.6697297364402676], "95": [0.6099008999635852, 0.675286497376312]}, "precision": 0.5900116144018583, "recall": 0.7094972067039106}, "person": {"f1": 0.8331830477908024, "f1_ci": {"90": [0.8225615705647079, 0.844133625930756], "95": [0.8197039814686174, 0.845947550718915]}, "precision": 0.8153900458877515, "recall": 0.8517699115044248}, "product": {"f1": 0.6474543707973103, "f1_ci": {"90": [0.6257727319309722, 0.6675775382388902], "95": [0.622029803965207, 0.67213956503224]}, "precision": 0.6072072072072072, "recall": 0.6934156378600823}}}, "2020.test": {"micro/f1": 0.6566924926529523, "micro/f1_ci": {"90": [0.6350246689469047, 0.6765248249576093], "95": [0.6316046962346025, 0.6805295345579917]}, "micro/recall": 0.6377789309807992, "micro/precision": 0.676762114537445, "macro/f1": 0.6188295807291019, "macro/f1_ci": {"90": [0.5953921344469173, 0.6405648082892781], "95": [0.5922335726371868, 0.6443817552161847]}, "macro/recall": 0.6056612695801465, "macro/precision": 0.6364060811133587, "per_entity_metric": {"corporation": {"f1": 0.5682451253481894, "f1_ci": {"90": [0.5060037904426695, 0.625], "95": [0.49189736477115115, 0.6337646064841335]}, "precision": 0.6071428571428571, "recall": 0.5340314136125655}, "creative_work": {"f1": 0.5185185185185185, "f1_ci": {"90": [0.45801305454143154, 0.5714285714285714], "95": [0.44581622694844525, 0.5760427243614777]}, "precision": 0.49246231155778897, "recall": 0.547486033519553}, "event": {"f1": 0.510556621880998, "f1_ci": {"90": [0.45928583029952497, 0.5623057556814363], "95": [0.449752645158236, 0.5719305087379569]}, "precision": 0.51953125, "recall": 0.5018867924528302}, "group": {"f1": 0.5865209471766849, "f1_ci": {"90": [0.5386134884674908, 0.6372847270723584], "95": [0.5305218757586383, 0.6435007502171682]}, "precision": 0.6764705882352942, "recall": 0.5176848874598071}, "location": {"f1": 0.6706231454005934, "f1_ci": {"90": [0.601123595505618, 0.7353075272662257], "95": [0.5819077650768624, 0.7460839013354039]}, "precision": 0.6569767441860465, "recall": 0.6848484848484848}, "person": {"f1": 0.8258620689655173, "f1_ci": {"90": [0.7986445995487873, 0.8515815085158152], "95": [0.7933880694877764, 0.857588189140286]}, "precision": 0.849290780141844, "recall": 0.8036912751677853}, "product": {"f1": 0.6514806378132119, "f1_ci": {"90": [0.5975530566993981, 0.7013658454834926], "95": [0.5887218923973556, 0.7108215869736922]}, "precision": 0.6529680365296804, "recall": 0.65}}}, "2021.test (span detection)": {"micro/f1": 0.7836361609631033, "micro/f1_ci": {}, "micro/recall": 0.8129987278825026, "micro/precision": 0.7563206024744487, "macro/f1": 0.7836361609631033, "macro/f1_ci": {}, "macro/recall": 0.8129987278825026, "macro/precision": 0.7563206024744487}, "2020.test (span detection)": {"micro/f1": 0.7610903260288615, "micro/f1_ci": {}, "micro/recall": 0.7389724961079398, "micro/precision": 0.7845730027548209, "macro/f1": 0.7610903260288615, "macro/f1_ci": {}, "macro/recall": 0.7389724961079398, "macro/precision": 0.7845730027548209}}
 
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6566924926529523, "micro/f1_ci": {"90": [0.6350246689469047, 0.6765248249576093], "95": [0.6316046962346025, 0.6805295345579917]}, "micro/recall": 0.6377789309807992, "micro/precision": 0.676762114537445, "macro/f1": 0.6188295807291019, "macro/f1_ci": {"90": [0.5953921344469173, 0.6405648082892781], "95": [0.5922335726371868, 0.6443817552161847]}, "macro/recall": 0.6056612695801465, "macro/precision": 0.6364060811133587, "per_entity_metric": {"corporation": {"f1": 0.5682451253481894, "f1_ci": {"90": [0.5060037904426695, 0.625], "95": [0.49189736477115115, 0.6337646064841335]}, "precision": 0.6071428571428571, "recall": 0.5340314136125655}, "creative_work": {"f1": 0.5185185185185185, "f1_ci": {"90": [0.45801305454143154, 0.5714285714285714], "95": [0.44581622694844525, 0.5760427243614777]}, "precision": 0.49246231155778897, "recall": 0.547486033519553}, "event": {"f1": 0.510556621880998, "f1_ci": {"90": [0.45928583029952497, 0.5623057556814363], "95": [0.449752645158236, 0.5719305087379569]}, "precision": 0.51953125, "recall": 0.5018867924528302}, "group": {"f1": 0.5865209471766849, "f1_ci": {"90": [0.5386134884674908, 0.6372847270723584], "95": [0.5305218757586383, 0.6435007502171682]}, "precision": 0.6764705882352942, "recall": 0.5176848874598071}, "location": {"f1": 0.6706231454005934, "f1_ci": {"90": [0.601123595505618, 0.7353075272662257], "95": [0.5819077650768624, 0.7460839013354039]}, "precision": 0.6569767441860465, "recall": 0.6848484848484848}, "person": {"f1": 0.8258620689655173, "f1_ci": {"90": [0.7986445995487873, 0.8515815085158152], "95": [0.7933880694877764, 0.857588189140286]}, "precision": 0.849290780141844, "recall": 0.8036912751677853}, "product": {"f1": 0.6514806378132119, "f1_ci": {"90": [0.5975530566993981, 0.7013658454834926], "95": [0.5887218923973556, 0.7108215869736922]}, "precision": 0.6529680365296804, "recall": 0.65}}}
eval/metric.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.6476455837280579, "micro/f1_ci": {"90": [0.6385290008161982, 0.6567664564200659], "95": [0.6363564668769717, 0.658859612510356]}, "micro/recall": 0.6719472710453284, "micro/precision": 0.6250403355921265, "macro/f1": 0.5999877200423757, "macro/f1_ci": {"90": [0.5903018424752366, 0.6093669000533246], "95": [0.5885086230990764, 0.6110360741859062]}, "macro/recall": 0.6296258649141258, "macro/precision": 0.5763142106730764, "per_entity_metric": {"corporation": {"f1": 0.5222786238014665, "f1_ci": {"90": [0.49611256679291055, 0.5478078174587232], "95": [0.49198763971017245, 0.551254088611594]}, "precision": 0.5303550973654066, "recall": 0.5144444444444445}, "creative_work": {"f1": 0.45888441633122484, "f1_ci": {"90": [0.4285590920305946, 0.4895786422964291], "95": [0.42341279056771075, 0.49464986033814345]}, "precision": 0.3958333333333333, "recall": 0.5458276333789329}, "event": {"f1": 0.4850711988975654, "f1_ci": {"90": [0.4636404229764949, 0.5075191503615117], "95": [0.4590502128752059, 0.5112888082910241]}, "precision": 0.4897959183673469, "recall": 0.48043676069153773}, "group": {"f1": 0.6087811271297511, "f1_ci": {"90": [0.588588460184114, 0.631713867557066], "95": [0.5841833299097599, 0.6362803334551821]}, "precision": 0.605606258148631, "recall": 0.6119894598155468}, "location": {"f1": 0.6442612555485098, "f1_ci": {"90": [0.6152870444442612, 0.6697297364402676], "95": [0.6099008999635852, 0.675286497376312]}, "precision": 0.5900116144018583, "recall": 0.7094972067039106}, "person": {"f1": 0.8331830477908024, "f1_ci": {"90": [0.8225615705647079, 0.844133625930756], "95": [0.8197039814686174, 0.845947550718915]}, "precision": 0.8153900458877515, "recall": 0.8517699115044248}, "product": {"f1": 0.6474543707973103, "f1_ci": {"90": [0.6257727319309722, 0.6675775382388902], "95": [0.622029803965207, 0.67213956503224]}, "precision": 0.6072072072072072, "recall": 0.6934156378600823}}}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7610903260288615, "micro/f1_ci": {}, "micro/recall": 0.7389724961079398, "micro/precision": 0.7845730027548209, "macro/f1": 0.7610903260288615, "macro/f1_ci": {}, "macro/recall": 0.7389724961079398, "macro/precision": 0.7845730027548209}
eval/metric_span.test_2021.json ADDED
@@ -0,0 +1 @@
 
1
+ {"micro/f1": 0.7836361609631033, "micro/f1_ci": {}, "micro/recall": 0.8129987278825026, "micro/precision": 0.7563206024744487, "macro/f1": 0.7836361609631033, "macro/f1_ci": {}, "macro/recall": 0.8129987278825026, "macro/precision": 0.7563206024744487}
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": "roberta-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": "roberta-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}