asahi417 commited on
Commit
66aba95
1 Parent(s): 0545c01

model update

Browse files
README.md ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - tweebank_ner
4
+ metrics:
5
+ - f1
6
+ - precision
7
+ - recall
8
+ model-index:
9
+ - name: tner/deberta-v3-large-tweebank-ner
10
+ results:
11
+ - task:
12
+ name: Token Classification
13
+ type: token-classification
14
+ dataset:
15
+ name: tweebank_ner
16
+ type: tweebank_ner
17
+ args: tweebank_ner
18
+ metrics:
19
+ - name: F1
20
+ type: f1
21
+ value: 0.7253474520185308
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.7201051248357424
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.7306666666666667
28
+ - name: F1 (macro)
29
+ type: f1_macro
30
+ value: 0.701874697798745
31
+ - name: Precision (macro)
32
+ type: precision_macro
33
+ value: 0.7043005470796733
34
+ - name: Recall (macro)
35
+ type: recall_macro
36
+ value: 0.706915721861374
37
+ - name: F1 (entity span)
38
+ type: f1_entity_span
39
+ value: 0.8178343949044585
40
+ - name: Precision (entity span)
41
+ type: precision_entity_span
42
+ value: 0.7829268292682927
43
+ - name: Recall (entity span)
44
+ type: recall_entity_span
45
+ value: 0.856
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/deberta-v3-large-tweebank-ner
53
+
54
+ This model is a fine-tuned version of [microsoft/deberta-v3-large](https://huggingface.co/microsoft/deberta-v3-large) on the
55
+ [tner/tweebank_ner](https://huggingface.co/datasets/tner/tweebank_ner) 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.7253474520185308
59
+ - Precision (micro): 0.7201051248357424
60
+ - Recall (micro): 0.7306666666666667
61
+ - F1 (macro): 0.701874697798745
62
+ - Precision (macro): 0.7043005470796733
63
+ - Recall (macro): 0.706915721861374
64
+
65
+ The per-entity breakdown of the F1 score on the test set are below:
66
+ - location: 0.7289719626168224
67
+ - organization: 0.7040816326530612
68
+ - other: 0.5182926829268293
69
+ - person: 0.856152512998267
70
+
71
+ For F1 scores, the confidence interval is obtained by bootstrap as below:
72
+ - F1 (micro):
73
+ - 90%: [0.6978100031831928, 0.7529703029130037]
74
+ - 95%: [0.691700704571692, 0.7582901338971108]
75
+ - F1 (macro):
76
+ - 90%: [0.6978100031831928, 0.7529703029130037]
77
+ - 95%: [0.691700704571692, 0.7582901338971108]
78
+
79
+ Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/deberta-v3-large-tweebank-ner/raw/main/eval/metric.json)
80
+ and [metric file of entity span](https://huggingface.co/tner/deberta-v3-large-tweebank-ner/raw/main/eval/metric_span.json).
81
+
82
+ ### Usage
83
+ This model can be used through the transformers library by
84
+ ```python
85
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
86
+ tokenizer = AutoTokenizer.from_pretrained("tner/deberta-v3-large-tweebank-ner")
87
+ model = AutoModelForTokenClassification.from_pretrained("tner/deberta-v3-large-tweebank-ner")
88
+ ```
89
+ but, since transformers do not support CRF layer, it is recommended to use the model via `T-NER` library.
90
+ Install the library via pip
91
+ ```shell
92
+ pip install tner
93
+ ```
94
+ and activate model as below.
95
+ ```python
96
+ from tner import TransformersNER
97
+ model = TransformersNER("tner/deberta-v3-large-tweebank-ner")
98
+ model.predict("Jacob Collier is a Grammy awarded English artist from London".split(" "))
99
+ ```
100
+
101
+ ### Training hyperparameters
102
+
103
+ The following hyperparameters were used during training:
104
+ - dataset: ['tner/tweebank_ner']
105
+ - dataset_split: train
106
+ - dataset_name: None
107
+ - local_dataset: None
108
+ - model: microsoft/deberta-v3-large
109
+ - crf: True
110
+ - max_length: 128
111
+ - epoch: 15
112
+ - batch_size: 16
113
+ - lr: 1e-05
114
+ - random_seed: 42
115
+ - gradient_accumulation_steps: 4
116
+ - weight_decay: 1e-07
117
+ - lr_warmup_step_ratio: 0.1
118
+ - max_grad_norm: 10.0
119
+
120
+ The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/deberta-v3-large-tweebank-ner/raw/main/trainer_config.json).
121
+
122
+ ### Reference
123
+ If you use any resource from T-NER, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
124
+
125
+ ```
126
+
127
+ @inproceedings{ushio-camacho-collados-2021-ner,
128
+ title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition",
129
+ author = "Ushio, Asahi and
130
+ Camacho-Collados, Jose",
131
+ booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations",
132
+ month = apr,
133
+ year = "2021",
134
+ address = "Online",
135
+ publisher = "Association for Computational Linguistics",
136
+ url = "https://aclanthology.org/2021.eacl-demos.7",
137
+ doi = "10.18653/v1/2021.eacl-demos.7",
138
+ pages = "53--62",
139
+ 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.",
140
+ }
141
+
142
+ ```
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "tner_ckpt/tweebank_ner_deberta_v3_large/best_model",
3
  "architectures": [
4
  "DebertaV2ForTokenClassification"
5
  ],
 
1
  {
2
+ "_name_or_path": "tner_ckpt/tweebank_ner_deberta_v3_large/model_ayzfwn/epoch_5",
3
  "architectures": [
4
  "DebertaV2ForTokenClassification"
5
  ],
eval/metric.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.7253474520185308, "micro/f1_ci": {"90": [0.6978100031831928, 0.7529703029130037], "95": [0.691700704571692, 0.7582901338971108]}, "micro/recall": 0.7306666666666667, "micro/precision": 0.7201051248357424, "macro/f1": 0.701874697798745, "macro/f1_ci": {"90": [0.6718178675509049, 0.7319530846059807], "95": [0.6668177051487543, 0.7376052570235649]}, "macro/recall": 0.706915721861374, "macro/precision": 0.7043005470796733, "per_entity_metric": {"location": {"f1": 0.7289719626168224, "f1_ci": {"90": [0.6562417328042328, 0.7966673014663873], "95": [0.641968706674589, 0.8097933196199433]}, "precision": 0.7572815533980582, "recall": 0.7027027027027027}, "organization": {"f1": 0.7040816326530612, "f1_ci": {"90": [0.654310820624546, 0.7532017312488011], "95": [0.6434627329192546, 0.7627998776009792]}, "precision": 0.6571428571428571, "recall": 0.7582417582417582}, "other": {"f1": 0.5182926829268293, "f1_ci": {"90": [0.4594546843663452, 0.5747992256531156], "95": [0.44514336917562725, 0.5848251201251539]}, "precision": 0.5902777777777778, "recall": 0.46195652173913043}, "person": {"f1": 0.856152512998267, "f1_ci": {"90": [0.8253399015339731, 0.8826298839871183], "95": [0.8206082403601488, 0.8872012145386544]}, "precision": 0.8125, "recall": 0.9047619047619048}}}
eval/metric_span.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"micro/f1": 0.8178343949044585, "micro/f1_ci": {"90": [0.7946512020674701, 0.8391476596836752], "95": [0.790463656866032, 0.8430815891456205]}, "micro/recall": 0.856, "micro/precision": 0.7829268292682927, "macro/f1": 0.8178343949044585, "macro/f1_ci": {"90": [0.7946512020674701, 0.8391476596836752], "95": [0.790463656866032, 0.8430815891456205]}, "macro/recall": 0.856, "macro/precision": 0.7829268292682927}
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:8e6734e5a6341e0f6ee6e22d35485a57b83d4461a5bb4bb7f78bd5d8f85bedc9
3
- size 1736217519
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:35f73ab3f2b995a6b0a3d5df48a169408d614a6ed5502fd00ac1ae313ce2faa9
3
+ size 1736223023
tokenizer_config.json CHANGED
@@ -4,7 +4,7 @@
4
  "do_lower_case": false,
5
  "eos_token": "[SEP]",
6
  "mask_token": "[MASK]",
7
- "name_or_path": "tner_ckpt/tweebank_ner_deberta_v3_large/best_model",
8
  "pad_token": "[PAD]",
9
  "sep_token": "[SEP]",
10
  "sp_model_kwargs": {},
 
4
  "do_lower_case": false,
5
  "eos_token": "[SEP]",
6
  "mask_token": "[MASK]",
7
+ "name_or_path": "tner_ckpt/tweebank_ner_deberta_v3_large/model_ayzfwn/epoch_5",
8
  "pad_token": "[PAD]",
9
  "sep_token": "[SEP]",
10
  "sp_model_kwargs": {},
trainer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"dataset": ["tner/tweebank_ner"], "dataset_split": "train", "dataset_name": null, "local_dataset": null, "model": "microsoft/deberta-v3-large", "crf": true, "max_length": 128, "epoch": 15, "batch_size": 16, "lr": 1e-05, "random_seed": 42, "gradient_accumulation_steps": 4, "weight_decay": 1e-07, "lr_warmup_step_ratio": 0.1, "max_grad_norm": 10.0}