asahi417 commited on
Commit
2c5c65e
1 Parent(s): 7879e18

model update

Browse files
README.md ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - tner/tweetner7
4
+ metrics:
5
+ - f1
6
+ - precision
7
+ - recall
8
+ model-index:
9
+ - name: cardiffnlp/twitter-roberta-large-2022-154m-tweetner7-2020
10
+ results:
11
+ - task:
12
+ name: Token Classification
13
+ type: token-classification
14
+ dataset:
15
+ name: tner/tweetner7
16
+ type: tner/tweetner7
17
+ args: tner/tweetner7
18
+ metrics:
19
+ - name: F1
20
+ type: f1
21
+ value: 0.6528115974857014
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6396626345577627
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6665124884366328
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.6049985470954377
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.5897437616700211
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.6233545992999288
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.7878581945860234
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7719454000665853
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.804440846536371
46
+
47
+ pipeline_tag: token-classification
48
+ widget:
49
+ - text: "Jacob Collier is a Grammy awarded artist from England."
50
+ example_title: "NER Example 1"
51
+ ---
52
+ # cardiffnlp/twitter-roberta-large-2022-154m-tweetner7-2020
53
+
54
+ This model is a fine-tuned version of [cardiffnlp/twitter-roberta-large-2022-154m](https://huggingface.co/cardiffnlp/twitter-roberta-large-2022-154m) on the
55
+ [tner/tweetner7](https://huggingface.co/datasets/tner/tweetner7) dataset.
56
+ Model fine-tuning is done via [T-NER](https://github.com/asahi417/tner)'s hyper-parameter search (see the repository
57
+ for more detail). It achieves the following results on the test set:
58
+ - F1 (micro): 0.6528115974857014
59
+ - Precision (micro): 0.6396626345577627
60
+ - Recall (micro): 0.6665124884366328
61
+ - F1 (macro): 0.6049985470954377
62
+ - Precision (macro): 0.5897437616700211
63
+ - Recall (macro): 0.6233545992999288
64
+
65
+ The per-entity breakdown of the F1 score on the test set are below:
66
+ - corporation: 0.5229050279329609
67
+ - event: 0.4694835680751174
68
+ - group: 0.6115595737810786
69
+ - location: 0.651814131126671
70
+ - person: 0.8390510948905111
71
+ - product: 0.6531234128999492
72
+ - work_of_art: 0.4870530209617756
73
+
74
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
75
+ - F1 (micro):
76
+
77
+ - F1 (macro):
78
+
79
+
80
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/cardiffnlp/twitter-roberta-large-2022-154m-tweetner7-2020/raw/main/eval/metric.json)
81
+ and [metric file of entity span](https://huggingface.co/cardiffnlp/twitter-roberta-large-2022-154m-tweetner7-2020/raw/main/eval/metric_span.json).
82
+
83
+ ### Usage
84
+ This model can be used through the [tner library](https://github.com/asahi417/tner). Install the library via pip
85
+ ```shell
86
+ pip install tner
87
+ ```
88
+ and activate model as below.
89
+ ```python
90
+ from tner import TransformersNER
91
+ model = TransformersNER("cardiffnlp/twitter-roberta-large-2022-154m-tweetner7-2020")
92
+ model.predict(["Jacob Collier is a Grammy awarded English artist from London"])
93
+ ```
94
+ It can be used via transformers library but it is not recommended as CRF layer is not supported at the moment.
95
+
96
+ ### Training hyperparameters
97
+
98
+ The following hyperparameters were used during training:
99
+ - dataset: ['tner/tweetner7']
100
+ - dataset_split: train_2020
101
+ - dataset_name: None
102
+ - local_dataset: None
103
+ - model: cardiffnlp/twitter-roberta-large-2022-154m
104
+ - crf: True
105
+ - max_length: 128
106
+ - epoch: 30
107
+ - batch_size: 32
108
+ - lr: 1e-05
109
+ - random_seed: 42
110
+ - gradient_accumulation_steps: 1
111
+ - weight_decay: 1e-07
112
+ - lr_warmup_step_ratio: 0.3
113
+ - max_grad_norm: 10
114
+
115
+ The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/cardiffnlp/twitter-roberta-large-2022-154m-tweetner7-2020/raw/main/trainer_config.json).
116
+
117
+ ### Reference
118
+ If you use any resource from T-NER, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
119
+
120
+ ```
121
+
122
+ @inproceedings{ushio-camacho-collados-2021-ner,
123
+ title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition",
124
+ author = "Ushio, Asahi and
125
+ Camacho-Collados, Jose",
126
+ booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations",
127
+ month = apr,
128
+ year = "2021",
129
+ address = "Online",
130
+ publisher = "Association for Computational Linguistics",
131
+ url = "https://aclanthology.org/2021.eacl-demos.7",
132
+ doi = "10.18653/v1/2021.eacl-demos.7",
133
+ pages = "53--62",
134
+ 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.",
135
+ }
136
+
137
+ ```
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "cner_output/model/baseline/t_roberta_large_2022/best_model",
3
  "architectures": [
4
  "RobertaForTokenClassification"
5
  ],
 
1
  {
2
+ "_name_or_path": "cardiffnlp/twitter-roberta-large-2022-154m",
3
  "architectures": [
4
  "RobertaForTokenClassification"
5
  ],
eval/metric.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6528115974857014, "micro/f1_ci": {}, "micro/recall": 0.6665124884366328, "micro/precision": 0.6396626345577627, "macro/f1": 0.6049985470954377, "macro/f1_ci": {}, "macro/recall": 0.6233545992999288, "macro/precision": 0.5897437616700211, "per_entity_metric": {"corporation": {"f1": 0.5229050279329609, "f1_ci": {}, "precision": 0.5258426966292135, "recall": 0.52}, "event": {"f1": 0.4694835680751174, "f1_ci": {}, "precision": 0.48496605237633367, "recall": 0.4549590536851683}, "group": {"f1": 0.6115595737810786, "f1_ci": {}, "precision": 0.5997466751108297, "recall": 0.6238471673254282}, "location": {"f1": 0.651814131126671, "f1_ci": {}, "precision": 0.5988304093567252, "recall": 0.7150837988826816}, "person": {"f1": 0.8390510948905111, "f1_ci": {}, "precision": 0.8305635838150289, "recall": 0.8477138643067846}, "product": {"f1": 0.6531234128999492, "f1_ci": {}, "precision": 0.6449348044132397, "recall": 0.661522633744856}, "work_of_art": {"f1": 0.4870530209617756, "f1_ci": {}, "precision": 0.44332210998877664, "recall": 0.5403556771545828}}}
eval/metric.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6648604714169603, "micro/f1_ci": {}, "micro/recall": 0.6367410482615464, "micro/precision": 0.6955782312925171, "macro/f1": 0.6275593202037583, "macro/f1_ci": {}, "macro/recall": 0.603965493495998, "macro/precision": 0.6552388888609278, "per_entity_metric": {"corporation": {"f1": 0.5795454545454546, "f1_ci": {}, "precision": 0.6335403726708074, "recall": 0.5340314136125655}, "event": {"f1": 0.4657534246575343, "f1_ci": {}, "precision": 0.483739837398374, "recall": 0.4490566037735849}, "group": {"f1": 0.5968028419182949, "f1_ci": {}, "precision": 0.6666666666666666, "recall": 0.5401929260450161}, "location": {"f1": 0.6948640483383686, "f1_ci": {}, "precision": 0.6927710843373494, "recall": 0.696969696969697}, "person": {"f1": 0.8414634146341463, "f1_ci": {}, "precision": 0.875, "recall": 0.8104026845637584}, "product": {"f1": 0.655581947743468, "f1_ci": {}, "precision": 0.6865671641791045, "recall": 0.6272727272727273}, "work_of_art": {"f1": 0.558904109589041, "f1_ci": {}, "precision": 0.5483870967741935, "recall": 0.5698324022346368}}}
eval/metric_span.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7878581945860234, "micro/f1_ci": {}, "micro/recall": 0.804440846536371, "micro/precision": 0.7719454000665853, "macro/f1": 0.7878581945860234, "macro/f1_ci": {}, "macro/recall": 0.804440846536371, "macro/precision": 0.7719454000665853}
eval/metric_span.test_2020.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7723577235772358, "micro/f1_ci": {}, "micro/recall": 0.7394914374675662, "micro/precision": 0.8082813386273398, "macro/f1": 0.7723577235772358, "macro/f1_ci": {}, "macro/recall": 0.7394914374675662, "macro/precision": 0.8082813386273398}
eval/prediction.validation_2020.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json CHANGED
@@ -6,7 +6,7 @@
6
  "errors": "replace",
7
  "mask_token": "<mask>",
8
  "model_max_length": 512,
9
- "name_or_path": "cner_output/model/baseline/t_roberta_large_2022/best_model",
10
  "pad_token": "<pad>",
11
  "sep_token": "</s>",
12
  "special_tokens_map_file": null,
 
6
  "errors": "replace",
7
  "mask_token": "<mask>",
8
  "model_max_length": 512,
9
+ "name_or_path": "cardiffnlp/twitter-roberta-large-2022-154m",
10
  "pad_token": "<pad>",
11
  "sep_token": "</s>",
12
  "special_tokens_map_file": null,
trainer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"dataset": ["tner/tweetner7"], "dataset_split": "train_2020", "dataset_name": null, "local_dataset": null, "model": "cardiffnlp/twitter-roberta-large-2022-154m", "crf": true, "max_length": 128, "epoch": 30, "batch_size": 32, "lr": 1e-05, "random_seed": 42, "gradient_accumulation_steps": 1, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.3, "max_grad_norm": 10}