asahi417 commited on
Commit
95091cc
·
1 Parent(s): 3b685de

model update

Browse files
README.md ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - fin
4
+ metrics:
5
+ - f1
6
+ - precision
7
+ - recall
8
+ model-index:
9
+ - name: tner/roberta-large-fin
10
+ results:
11
+ - task:
12
+ name: Token Classification
13
+ type: token-classification
14
+ dataset:
15
+ name: fin
16
+ type: fin
17
+ args: fin
18
+ metrics:
19
+ - name: F1
20
+ type: f1
21
+ value: 0.6655896607431341
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.6843853820598007
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.6477987421383647
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.41006873243715347
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.41205729487653564
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.41564916564916565
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.6883116883116883
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7043189368770764
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.6730158730158731
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
+ # tner/roberta-large-fin
53
+
54
+ This model is a fine-tuned version of [roberta-large](https://huggingface.co/roberta-large) on the
55
+ [tner/fin](https://huggingface.co/datasets/tner/fin) 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.6655896607431341
59
+ - Precision (micro): 0.6843853820598007
60
+ - Recall (micro): 0.6477987421383647
61
+ - F1 (macro): 0.41006873243715347
62
+ - Precision (macro): 0.41205729487653564
63
+ - Recall (macro): 0.41564916564916565
64
+
65
+ The per-entity breakdown of the F1 score on the test set are below:
66
+ - LOC: nan
67
+ - MISC: nan
68
+ - ORG: nan
69
+ - PER: nan
70
+
71
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
72
+ - F1 (micro):
73
+ - 90%: [0.5896118118382531, 0.7350473550473551]
74
+ - 95%: [0.5793739107766132, 0.7500251004016066]
75
+ - F1 (macro):
76
+ - 90%: [0.5896118118382531, 0.7350473550473551]
77
+ - 95%: [0.5793739107766132, 0.7500251004016066]
78
+
79
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-fin/raw/main/eval/metric.json)
80
+ and [metric file of entity span](https://huggingface.co/tner/roberta-large-fin/raw/main/eval/metric_span.json).
81
+
82
+ ### Usage
83
+ This model can be used through the [tner library](https://github.com/asahi417/tner). Install the library via pip
84
+ ```shell
85
+ pip install tner
86
+ ```
87
+ and activate model as below.
88
+ ```python
89
+ from tner import TransformersNER
90
+ model = TransformersNER("tner/roberta-large-fin")
91
+ model.predict(["Jacob Collier is a Grammy awarded English artist from London"])
92
+ ```
93
+ It can be used via transformers library but it is not recommended as CRF layer is not supported at the moment.
94
+
95
+ ### Training hyperparameters
96
+
97
+ The following hyperparameters were used during training:
98
+ - dataset: ['tner/fin']
99
+ - dataset_split: train
100
+ - dataset_name: None
101
+ - local_dataset: None
102
+ - model: roberta-large
103
+ - crf: True
104
+ - max_length: 128
105
+ - epoch: 15
106
+ - batch_size: 64
107
+ - lr: 1e-05
108
+ - random_seed: 42
109
+ - gradient_accumulation_steps: 1
110
+ - weight_decay: None
111
+ - lr_warmup_step_ratio: 0.1
112
+ - max_grad_norm: 10.0
113
+
114
+ The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/roberta-large-fin/raw/main/trainer_config.json).
115
+
116
+ ### Reference
117
+ If you use any resource from T-NER, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
118
+
119
+ ```
120
+
121
+ @inproceedings{ushio-camacho-collados-2021-ner,
122
+ title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition",
123
+ author = "Ushio, Asahi and
124
+ Camacho-Collados, Jose",
125
+ booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations",
126
+ month = apr,
127
+ year = "2021",
128
+ address = "Online",
129
+ publisher = "Association for Computational Linguistics",
130
+ url = "https://aclanthology.org/2021.eacl-demos.7",
131
+ doi = "10.18653/v1/2021.eacl-demos.7",
132
+ pages = "53--62",
133
+ 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.",
134
+ }
135
+
136
+ ```
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "tner_ckpt/fin_roberta_large/best_model",
3
  "architectures": [
4
  "RobertaForTokenClassification"
5
  ],
 
1
  {
2
+ "_name_or_path": "tner_ckpt/fin_roberta_large/model_rcsnba/epoch_5",
3
  "architectures": [
4
  "RobertaForTokenClassification"
5
  ],
eval/metric.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6655896607431341, "micro/f1_ci": {"90": [0.5896118118382531, 0.7350473550473551], "95": [0.5793739107766132, 0.7500251004016066]}, "micro/recall": 0.6477987421383647, "micro/precision": 0.6843853820598007, "macro/f1": 0.41006873243715347, "macro/f1_ci": {"90": [0.3622851809142188, 0.47011199188849295], "95": [0.3559337045826972, 0.48143136272532056]}, "macro/recall": 0.41564916564916565, "macro/precision": 0.41205729487653564, "per_entity_metric": {"LOC": {"f1": NaN, "f1_ci": {"90": [NaN, NaN], "95": [NaN, NaN]}, "precision": 0.0, "recall": 0.0}, "MISC": {"f1": NaN, "f1_ci": {"90": [NaN, NaN], "95": [NaN, NaN]}, "precision": 0.0, "recall": 0.0}, "ORG": {"f1": NaN, "f1_ci": {"90": [NaN, NaN], "95": [NaN, NaN]}, "precision": 0.0, "recall": 0.0}, "PER": {"f1": NaN, "f1_ci": {"90": [NaN, NaN], "95": [NaN, NaN]}, "precision": 0.0, "recall": 0.0}}}
eval/metric_span.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.6883116883116883, "micro/f1_ci": {"90": [0.6137984272716044, 0.757765305655086], "95": [0.604156373368873, 0.7718631178707224]}, "micro/recall": 0.6730158730158731, "micro/precision": 0.7043189368770764, "macro/f1": 0.6883116883116883, "macro/f1_ci": {"90": [0.6137984272716044, 0.757765305655086], "95": [0.604156373368873, 0.7718631178707224]}, "macro/recall": 0.6730158730158731, "macro/precision": 0.7043189368770764}
eval/prediction.validation.json ADDED
The diff for this file is too large to render. See raw diff
 
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6933dddd235a966978ebbc5303f25b4df7be75923fe0d0223417c29bd5cc030f
3
- size 1417408561
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:01004508e5577309fd7de726278efa6ad4159b9f586272e1a9a28b8d2799bbc1
3
+ size 1417414001
tokenizer_config.json CHANGED
@@ -6,7 +6,7 @@
6
  "errors": "replace",
7
  "mask_token": "<mask>",
8
  "model_max_length": 512,
9
- "name_or_path": "tner_ckpt/fin_roberta_large/best_model",
10
  "pad_token": "<pad>",
11
  "sep_token": "</s>",
12
  "special_tokens_map_file": "tner_ckpt/fin_roberta_large/model_rcsnba/epoch_5/special_tokens_map.json",
 
6
  "errors": "replace",
7
  "mask_token": "<mask>",
8
  "model_max_length": 512,
9
+ "name_or_path": "tner_ckpt/fin_roberta_large/model_rcsnba/epoch_5",
10
  "pad_token": "<pad>",
11
  "sep_token": "</s>",
12
  "special_tokens_map_file": "tner_ckpt/fin_roberta_large/model_rcsnba/epoch_5/special_tokens_map.json",
trainer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"dataset": ["tner/fin"], "dataset_split": "train", "dataset_name": null, "local_dataset": null, "model": "roberta-large", "crf": true, "max_length": 128, "epoch": 15, "batch_size": 64, "lr": 1e-05, "random_seed": 42, "gradient_accumulation_steps": 1, "weight_decay": null, "lr_warmup_step_ratio": 0.1, "max_grad_norm": 10.0}