model update
Browse files- README.md +150 -0
- config.json +1 -1
- eval/metric.json +1 -0
- eval/metric_span.json +1 -0
- eval/prediction.validation.json +0 -0
- pytorch_model.bin +2 -2
- tokenizer_config.json +1 -1
- trainer_config.json +1 -0
README.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
datasets:
|
| 3 |
+
- ontonotes5
|
| 4 |
+
metrics:
|
| 5 |
+
- f1
|
| 6 |
+
- precision
|
| 7 |
+
- recall
|
| 8 |
+
model-index:
|
| 9 |
+
- name: tner/roberta-large-ontonotes5
|
| 10 |
+
results:
|
| 11 |
+
- task:
|
| 12 |
+
name: Token Classification
|
| 13 |
+
type: token-classification
|
| 14 |
+
dataset:
|
| 15 |
+
name: ontonotes5
|
| 16 |
+
type: ontonotes5
|
| 17 |
+
args: ontonotes5
|
| 18 |
+
metrics:
|
| 19 |
+
- name: F1
|
| 20 |
+
type: f1
|
| 21 |
+
value: 0.908632361399938
|
| 22 |
+
- name: Precision
|
| 23 |
+
type: precision
|
| 24 |
+
value: 0.905148095909732
|
| 25 |
+
- name: Recall
|
| 26 |
+
type: recall
|
| 27 |
+
value: 0.9121435551212579
|
| 28 |
+
- name: F1 (macro)
|
| 29 |
+
type: f1_macro
|
| 30 |
+
value: 0.8265477704565624
|
| 31 |
+
- name: Precision (macro)
|
| 32 |
+
type: precision_macro
|
| 33 |
+
value: 0.8170668848546687
|
| 34 |
+
- name: Recall (macro)
|
| 35 |
+
type: recall_macro
|
| 36 |
+
value: 0.8387672780349001
|
| 37 |
+
- name: F1 (entity span)
|
| 38 |
+
type: f1_entity_span
|
| 39 |
+
value: 0.9284544931640193
|
| 40 |
+
- name: Precision (entity span)
|
| 41 |
+
type: precision_entity_span
|
| 42 |
+
value: 0.9248942172073342
|
| 43 |
+
- name: Recall (entity span)
|
| 44 |
+
type: recall_entity_span
|
| 45 |
+
value: 0.9320422848005685
|
| 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-ontonotes5
|
| 53 |
+
|
| 54 |
+
This model is a fine-tuned version of [roberta-large](https://huggingface.co/roberta-large) on the
|
| 55 |
+
[tner/ontonotes5](https://huggingface.co/datasets/tner/ontonotes5) 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.908632361399938
|
| 59 |
+
- Precision (micro): 0.905148095909732
|
| 60 |
+
- Recall (micro): 0.9121435551212579
|
| 61 |
+
- F1 (macro): 0.8265477704565624
|
| 62 |
+
- Precision (macro): 0.8170668848546687
|
| 63 |
+
- Recall (macro): 0.8387672780349001
|
| 64 |
+
|
| 65 |
+
The per-entity breakdown of the F1 score on the test set are below:
|
| 66 |
+
- cardinal_number: 0.8605277329025309
|
| 67 |
+
- date: 0.872996300863132
|
| 68 |
+
- event: 0.7424242424242424
|
| 69 |
+
- facility: 0.7732342007434945
|
| 70 |
+
- geopolitical_area: 0.9687148323205043
|
| 71 |
+
- group: 0.9470588235294117
|
| 72 |
+
- language: 0.7499999999999999
|
| 73 |
+
- law: 0.6666666666666666
|
| 74 |
+
- location: 0.7593582887700535
|
| 75 |
+
- money: 0.901098901098901
|
| 76 |
+
- ordinal_number: 0.85785536159601
|
| 77 |
+
- organization: 0.9227360841872057
|
| 78 |
+
- percent: 0.9171428571428571
|
| 79 |
+
- person: 0.9556004036326943
|
| 80 |
+
- product: 0.7857142857142858
|
| 81 |
+
- quantity: 0.7945205479452055
|
| 82 |
+
- time: 0.6870588235294116
|
| 83 |
+
- work_of_art: 0.7151515151515151
|
| 84 |
+
|
| 85 |
+
For F1 scores, the confidence interval is obtained by bootstrap as below:
|
| 86 |
+
- F1 (micro):
|
| 87 |
+
- 90%: [0.9039454247544766, 0.9128956119702822]
|
| 88 |
+
- 95%: [0.9030263216115454, 0.9138350859566045]
|
| 89 |
+
- F1 (macro):
|
| 90 |
+
- 90%: [0.9039454247544766, 0.9128956119702822]
|
| 91 |
+
- 95%: [0.9030263216115454, 0.9138350859566045]
|
| 92 |
+
|
| 93 |
+
Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-ontonotes5/raw/main/eval/metric.json)
|
| 94 |
+
and [metric file of entity span](https://huggingface.co/tner/roberta-large-ontonotes5/raw/main/eval/metric_span.json).
|
| 95 |
+
|
| 96 |
+
### Usage
|
| 97 |
+
This model can be used through the [tner library](https://github.com/asahi417/tner). Install the library via pip
|
| 98 |
+
```shell
|
| 99 |
+
pip install tner
|
| 100 |
+
```
|
| 101 |
+
and activate model as below.
|
| 102 |
+
```python
|
| 103 |
+
from tner import TransformersNER
|
| 104 |
+
model = TransformersNER("tner/roberta-large-ontonotes5")
|
| 105 |
+
model.predict(["Jacob Collier is a Grammy awarded English artist from London"])
|
| 106 |
+
```
|
| 107 |
+
It can be used via transformers library but it is not recommended as CRF layer is not supported at the moment.
|
| 108 |
+
|
| 109 |
+
### Training hyperparameters
|
| 110 |
+
|
| 111 |
+
The following hyperparameters were used during training:
|
| 112 |
+
- dataset: ['tner/ontonotes5']
|
| 113 |
+
- dataset_split: train
|
| 114 |
+
- dataset_name: None
|
| 115 |
+
- local_dataset: None
|
| 116 |
+
- model: roberta-large
|
| 117 |
+
- crf: True
|
| 118 |
+
- max_length: 128
|
| 119 |
+
- epoch: 15
|
| 120 |
+
- batch_size: 64
|
| 121 |
+
- lr: 1e-05
|
| 122 |
+
- random_seed: 42
|
| 123 |
+
- gradient_accumulation_steps: 1
|
| 124 |
+
- weight_decay: None
|
| 125 |
+
- lr_warmup_step_ratio: 0.1
|
| 126 |
+
- max_grad_norm: 10.0
|
| 127 |
+
|
| 128 |
+
The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/roberta-large-ontonotes5/raw/main/trainer_config.json).
|
| 129 |
+
|
| 130 |
+
### Reference
|
| 131 |
+
If you use any resource from T-NER, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
|
| 132 |
+
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
@inproceedings{ushio-camacho-collados-2021-ner,
|
| 136 |
+
title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition",
|
| 137 |
+
author = "Ushio, Asahi and
|
| 138 |
+
Camacho-Collados, Jose",
|
| 139 |
+
booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations",
|
| 140 |
+
month = apr,
|
| 141 |
+
year = "2021",
|
| 142 |
+
address = "Online",
|
| 143 |
+
publisher = "Association for Computational Linguistics",
|
| 144 |
+
url = "https://aclanthology.org/2021.eacl-demos.7",
|
| 145 |
+
doi = "10.18653/v1/2021.eacl-demos.7",
|
| 146 |
+
pages = "53--62",
|
| 147 |
+
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.",
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
```
|
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "tner_ckpt/ontonotes5_roberta_large/
|
| 3 |
"architectures": [
|
| 4 |
"RobertaForTokenClassification"
|
| 5 |
],
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "tner_ckpt/ontonotes5_roberta_large/model_rcsnba/epoch_5",
|
| 3 |
"architectures": [
|
| 4 |
"RobertaForTokenClassification"
|
| 5 |
],
|
eval/metric.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"micro/f1": 0.908632361399938, "micro/f1_ci": {"90": [0.9039454247544766, 0.9128956119702822], "95": [0.9030263216115454, 0.9138350859566045]}, "micro/recall": 0.9121435551212579, "micro/precision": 0.905148095909732, "macro/f1": 0.8265477704565624, "macro/f1_ci": {"90": [0.8121417948576588, 0.8385364082840391], "95": [0.8096775897485154, 0.8411472970680649]}, "macro/recall": 0.8387672780349001, "macro/precision": 0.8170668848546687, "per_entity_metric": {"cardinal_number": {"f1": 0.8605277329025309, "f1_ci": {"90": [0.843480407184333, 0.8774608056933718], "95": [0.8404683840749414, 0.8804760960168132]}, "precision": 0.8665943600867679, "recall": 0.8545454545454545}, "date": {"f1": 0.872996300863132, "f1_ci": {"90": [0.8597628567219345, 0.8854157808847528], "95": [0.8568743233248947, 0.887132819190551]}, "precision": 0.8623629719853837, "recall": 0.8838951310861424}, "event": {"f1": 0.7424242424242424, "f1_ci": {"90": [0.6564641221374047, 0.8194444444444444], "95": [0.6382887013939839, 0.8345352064804848]}, "precision": 0.7101449275362319, "recall": 0.7777777777777778}, "facility": {"f1": 0.7732342007434945, "f1_ci": {"90": [0.7127132266874755, 0.8299636133523177], "95": [0.6999887892376682, 0.8435233798195244]}, "precision": 0.7761194029850746, "recall": 0.7703703703703704}, "geopolitical_area": {"f1": 0.9687148323205043, "f1_ci": {"90": [0.963340376224374, 0.973711244759882], "95": [0.9626303980811273, 0.9744505463479681]}, "precision": 0.9768497503404449, "recall": 0.9607142857142857}, "group": {"f1": 0.9470588235294117, "f1_ci": {"90": [0.9351070280371709, 0.9580140382076361], "95": [0.932251234137772, 0.9600983382751339]}, "precision": 0.9371362048894063, "recall": 0.9571938168846611}, "language": {"f1": 0.7499999999999999, "f1_ci": {"90": [0.608695652173913, 0.851103230890465], "95": [0.5853150406504064, 0.8666981132075472]}, "precision": 0.8333333333333334, "recall": 0.6818181818181818}, "law": {"f1": 0.6666666666666666, "f1_ci": {"90": [0.5510204081632654, 0.7715238095238094], "95": [0.5318354120811933, 0.7912915851272019]}, "precision": 0.6170212765957447, "recall": 0.725}, "location": {"f1": 0.7593582887700535, "f1_ci": {"90": [0.7075784227499267, 0.8066365067926441], "95": [0.6966818766818768, 0.8132445889832065]}, "precision": 0.7282051282051282, "recall": 0.7932960893854749}, "money": {"f1": 0.901098901098901, "f1_ci": {"90": [0.8723662818004926, 0.9285766271574131], "95": [0.8651037567084079, 0.9333382570162481]}, "precision": 0.8885448916408669, "recall": 0.9140127388535032}, "ordinal_number": {"f1": 0.85785536159601, "f1_ci": {"90": [0.8256974045428536, 0.8873578751164959], "95": [0.8192771084337349, 0.8941270912034538]}, "precision": 0.8349514563106796, "recall": 0.882051282051282}, "organization": {"f1": 0.9227360841872057, "f1_ci": {"90": [0.9125116290604286, 0.9314409091710344], "95": [0.9105165804108345, 0.9326758594060797]}, "precision": 0.9174008810572687, "recall": 0.928133704735376}, "percent": {"f1": 0.9171428571428571, "f1_ci": {"90": [0.888888888888889, 0.9445316700250458], "95": [0.8843537414965987, 0.9478885648316929]}, "precision": 0.9145299145299145, "recall": 0.9197707736389685}, "person": {"f1": 0.9556004036326943, "f1_ci": {"90": [0.949191731901367, 0.9624522822302698], "95": [0.947759511512266, 0.9635008157600174]}, "precision": 0.958502024291498, "recall": 0.9527162977867203}, "product": {"f1": 0.7857142857142858, "f1_ci": {"90": [0.7074746971959516, 0.8571428571428572], "95": [0.6928086318326213, 0.8679526055705302]}, "precision": 0.717391304347826, "recall": 0.868421052631579}, "quantity": {"f1": 0.7945205479452055, "f1_ci": {"90": [0.7301507936507936, 0.8559019931014562], "95": [0.7156685137823244, 0.8688611053468909]}, "precision": 0.7631578947368421, "recall": 0.8285714285714286}, "time": {"f1": 0.6870588235294116, "f1_ci": {"90": [0.6359639016897082, 0.732240357927006], "95": [0.6260340701377503, 0.7433238443393313]}, "precision": 0.6854460093896714, "recall": 0.6886792452830188}, "work_of_art": {"f1": 0.7151515151515151, "f1_ci": {"90": [0.6579761700668609, 0.7656589673913042], "95": [0.6454941116231439, 0.7744146669002161]}, "precision": 0.7195121951219512, "recall": 0.7108433734939759}}}
|
eval/metric_span.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"micro/f1": 0.9284544931640193, "micro/f1_ci": {"90": [0.9241692474050558, 0.9323166980487259], "95": [0.9234176178451158, 0.933219334035083]}, "micro/recall": 0.9320422848005685, "micro/precision": 0.9248942172073342, "macro/f1": 0.9284544931640193, "macro/f1_ci": {"90": [0.9241692474050558, 0.9323166980487259], "95": [0.9234176178451158, 0.933219334035083]}, "macro/recall": 0.9320422848005685, "macro/precision": 0.9248942172073342}
|
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:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ede8a820e2f09bc0ace94429dd2196a764fa7913196ff27650aa1194c7086131
|
| 3 |
+
size 1417528817
|
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/ontonotes5_roberta_large/
|
| 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": "tner_ckpt/ontonotes5_roberta_large/model_rcsnba/epoch_5",
|
| 10 |
"pad_token": "<pad>",
|
| 11 |
"sep_token": "</s>",
|
| 12 |
"special_tokens_map_file": null,
|
trainer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"dataset": ["tner/ontonotes5"], "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}
|