model update
Browse files- README.md +144 -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,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
datasets:
|
3 |
+
- mit_movie_trivia
|
4 |
+
metrics:
|
5 |
+
- f1
|
6 |
+
- precision
|
7 |
+
- recall
|
8 |
+
model-index:
|
9 |
+
- name: tner/roberta-large-mit-movie-trivia
|
10 |
+
results:
|
11 |
+
- task:
|
12 |
+
name: Token Classification
|
13 |
+
type: token-classification
|
14 |
+
dataset:
|
15 |
+
name: mit_movie_trivia
|
16 |
+
type: mit_movie_trivia
|
17 |
+
args: mit_movie_trivia
|
18 |
+
metrics:
|
19 |
+
- name: F1
|
20 |
+
type: f1
|
21 |
+
value: 0.7284025200655909
|
22 |
+
- name: Precision
|
23 |
+
type: precision
|
24 |
+
value: 0.7151330283002881
|
25 |
+
- name: Recall
|
26 |
+
type: recall
|
27 |
+
value: 0.7421737601125572
|
28 |
+
- name: F1 (macro)
|
29 |
+
type: f1_macro
|
30 |
+
value: 0.6502255723148889
|
31 |
+
- name: Precision (macro)
|
32 |
+
type: precision_macro
|
33 |
+
value: 0.6457158565124362
|
34 |
+
- name: Recall (macro)
|
35 |
+
type: recall_macro
|
36 |
+
value: 0.6578012664661943
|
37 |
+
- name: F1 (entity span)
|
38 |
+
type: f1_entity_span
|
39 |
+
value: 0.749525289142068
|
40 |
+
- name: Precision (entity span)
|
41 |
+
type: precision_entity_span
|
42 |
+
value: 0.7359322033898306
|
43 |
+
- name: Recall (entity span)
|
44 |
+
type: recall_entity_span
|
45 |
+
value: 0.7636299683432993
|
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-mit-movie-trivia
|
53 |
+
|
54 |
+
This model is a fine-tuned version of [roberta-large](https://huggingface.co/roberta-large) on the
|
55 |
+
[tner/mit_movie_trivia](https://huggingface.co/datasets/tner/mit_movie_trivia) 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.7284025200655909
|
59 |
+
- Precision (micro): 0.7151330283002881
|
60 |
+
- Recall (micro): 0.7421737601125572
|
61 |
+
- F1 (macro): 0.6502255723148889
|
62 |
+
- Precision (macro): 0.6457158565124362
|
63 |
+
- Recall (macro): 0.6578012664661943
|
64 |
+
|
65 |
+
The per-entity breakdown of the F1 score on the test set are below:
|
66 |
+
- actor: 0.9557453416149068
|
67 |
+
- award: 0.41726618705035967
|
68 |
+
- character_name: 0.7467105263157895
|
69 |
+
- date: 0.9668674698795181
|
70 |
+
- director: 0.9148936170212766
|
71 |
+
- genre: 0.7277079593058049
|
72 |
+
- opinion: 0.43478260869565216
|
73 |
+
- origin: 0.28846153846153844
|
74 |
+
- plot: 0.5132575757575758
|
75 |
+
- quote: 0.8387096774193549
|
76 |
+
- relationship: 0.5697329376854599
|
77 |
+
- soundtrack: 0.42857142857142855
|
78 |
+
|
79 |
+
For F1 scores, the confidence interval is obtained by bootstrap as below:
|
80 |
+
- F1 (micro):
|
81 |
+
- 90%: [0.718570586211627, 0.7387631655667131]
|
82 |
+
- 95%: [0.7170135350354089, 0.7412372838115527]
|
83 |
+
- F1 (macro):
|
84 |
+
- 90%: [0.718570586211627, 0.7387631655667131]
|
85 |
+
- 95%: [0.7170135350354089, 0.7412372838115527]
|
86 |
+
|
87 |
+
Full evaluation can be found at [metric file of NER](https://huggingface.co/tner/roberta-large-mit-movie-trivia/raw/main/eval/metric.json)
|
88 |
+
and [metric file of entity span](https://huggingface.co/tner/roberta-large-mit-movie-trivia/raw/main/eval/metric_span.json).
|
89 |
+
|
90 |
+
### Usage
|
91 |
+
This model can be used through the [tner library](https://github.com/asahi417/tner). Install the library via pip
|
92 |
+
```shell
|
93 |
+
pip install tner
|
94 |
+
```
|
95 |
+
and activate model as below.
|
96 |
+
```python
|
97 |
+
from tner import TransformersNER
|
98 |
+
model = TransformersNER("tner/roberta-large-mit-movie-trivia")
|
99 |
+
model.predict(["Jacob Collier is a Grammy awarded English artist from London"])
|
100 |
+
```
|
101 |
+
It can be used via transformers library but it is not recommended as CRF layer is not supported at the moment.
|
102 |
+
|
103 |
+
### Training hyperparameters
|
104 |
+
|
105 |
+
The following hyperparameters were used during training:
|
106 |
+
- dataset: ['tner/mit_movie_trivia']
|
107 |
+
- dataset_split: train
|
108 |
+
- dataset_name: None
|
109 |
+
- local_dataset: None
|
110 |
+
- model: roberta-large
|
111 |
+
- crf: True
|
112 |
+
- max_length: 128
|
113 |
+
- epoch: 15
|
114 |
+
- batch_size: 64
|
115 |
+
- lr: 1e-05
|
116 |
+
- random_seed: 42
|
117 |
+
- gradient_accumulation_steps: 1
|
118 |
+
- weight_decay: 1e-07
|
119 |
+
- lr_warmup_step_ratio: 0.1
|
120 |
+
- max_grad_norm: 10.0
|
121 |
+
|
122 |
+
The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/tner/roberta-large-mit-movie-trivia/raw/main/trainer_config.json).
|
123 |
+
|
124 |
+
### Reference
|
125 |
+
If you use any resource from T-NER, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
|
126 |
+
|
127 |
+
```
|
128 |
+
|
129 |
+
@inproceedings{ushio-camacho-collados-2021-ner,
|
130 |
+
title = "{T}-{NER}: An All-Round Python Library for Transformer-based Named Entity Recognition",
|
131 |
+
author = "Ushio, Asahi and
|
132 |
+
Camacho-Collados, Jose",
|
133 |
+
booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations",
|
134 |
+
month = apr,
|
135 |
+
year = "2021",
|
136 |
+
address = "Online",
|
137 |
+
publisher = "Association for Computational Linguistics",
|
138 |
+
url = "https://aclanthology.org/2021.eacl-demos.7",
|
139 |
+
doi = "10.18653/v1/2021.eacl-demos.7",
|
140 |
+
pages = "53--62",
|
141 |
+
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.",
|
142 |
+
}
|
143 |
+
|
144 |
+
```
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "tner_ckpt/mit_movie_trivia_roberta_large/
|
3 |
"architectures": [
|
4 |
"RobertaForTokenClassification"
|
5 |
],
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "tner_ckpt/mit_movie_trivia_roberta_large/model_ayzfwn/epoch_5",
|
3 |
"architectures": [
|
4 |
"RobertaForTokenClassification"
|
5 |
],
|
eval/metric.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"micro/f1": 0.7284025200655909, "micro/f1_ci": {"90": [0.718570586211627, 0.7387631655667131], "95": [0.7170135350354089, 0.7412372838115527]}, "micro/recall": 0.7421737601125572, "micro/precision": 0.7151330283002881, "macro/f1": 0.6502255723148889, "macro/f1_ci": {"90": [0.6187041261525986, 0.6787182709337801], "95": [0.6109966715241302, 0.6849815706753698]}, "macro/recall": 0.6578012664661943, "macro/precision": 0.6457158565124362, "per_entity_metric": {"actor": {"f1": 0.9557453416149068, "f1_ci": {"90": [0.9467089142451703, 0.96457832207151], "95": [0.9446998104303214, 0.9663849104164107]}, "precision": 0.945468509984639, "recall": 0.966248037676609}, "award": {"f1": 0.41726618705035967, "f1_ci": {"90": [0.3174100863974281, 0.5303072158044535], "95": [0.3039128151260504, 0.5454545454545454]}, "precision": 0.3972602739726027, "recall": 0.4393939393939394}, "character_name": {"f1": 0.7467105263157895, "f1_ci": {"90": [0.7048839637035254, 0.7844453199853147], "95": [0.6974255691768825, 0.7915889898024219]}, "precision": 0.6984615384615385, "recall": 0.8021201413427562}, "date": {"f1": 0.9668674698795181, "f1_ci": {"90": [0.9560524286815729, 0.9766113703127701], "95": [0.9539611338144509, 0.978115674127837]}, "precision": 0.9625187406296851, "recall": 0.9712556732223904}, "director": {"f1": 0.9148936170212766, "f1_ci": {"90": [0.8969187934915231, 0.9319515648084927], "95": [0.8928550616050616, 0.9344502419864533]}, "precision": 0.9192399049881235, "recall": 0.9105882352941177}, "genre": {"f1": 0.7277079593058049, "f1_ci": {"90": [0.7030853825730076, 0.7531861349576963], "95": [0.6999361091231079, 0.7563387936006287]}, "precision": 0.6893424036281179, "recall": 0.770595690747782}, "opinion": {"f1": 0.43478260869565216, "f1_ci": {"90": [0.3816325514218835, 0.4874672405087639], "95": [0.37323313215722687, 0.4961574784559085]}, "precision": 0.4336734693877551, "recall": 0.4358974358974359}, "origin": {"f1": 0.28846153846153844, "f1_ci": {"90": [0.23671497584541065, 0.3412573724871241], "95": [0.22724880382775117, 0.3492127496159754]}, "precision": 0.26548672566371684, "recall": 0.3157894736842105}, "plot": {"f1": 0.5132575757575758, "f1_ci": {"90": [0.49135588028061145, 0.5333437337493498], "95": [0.48749443384223917, 0.5387301802457543]}, "precision": 0.5109993714644877, "recall": 0.5155358275206088}, "quote": {"f1": 0.8387096774193549, "f1_ci": {"90": [0.7469519870526883, 0.9213483146067417], "95": [0.7272727272727273, 0.9334042553191492]}, "precision": 0.8478260869565217, "recall": 0.8297872340425532}, "relationship": {"f1": 0.5697329376854599, "f1_ci": {"90": [0.5093859929645027, 0.6280584452098124], "95": [0.49858144263243415, 0.6380924033610567]}, "precision": 0.5783132530120482, "recall": 0.5614035087719298}, "soundtrack": {"f1": 0.42857142857142855, "f1_ci": {"90": [0.1111111111111111, 0.7142857142857143], "95": [0.0, 0.7777777777777777]}, "precision": 0.5, "recall": 0.375}}}
|
eval/metric_span.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"micro/f1": 0.749525289142068, "micro/f1_ci": {"90": [0.7397126154825829, 0.7597425112279943], "95": [0.7379706607775025, 0.7623178184832154]}, "micro/recall": 0.7636299683432993, "micro/precision": 0.7359322033898306, "macro/f1": 0.749525289142068, "macro/f1_ci": {"90": [0.7397126154825829, 0.7597425112279943], "95": [0.7379706607775025, 0.7623178184832154]}, "macro/recall": 0.7636299683432993, "macro/precision": 0.7359322033898306}
|
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:5a2cc41c6f7f179b759608e8acb7bb682e92ee0c5813bed07f3794294ae3e402
|
3 |
+
size 1417479601
|
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/mit_movie_trivia_roberta_large/
|
10 |
"pad_token": "<pad>",
|
11 |
"sep_token": "</s>",
|
12 |
"special_tokens_map_file": "tner_ckpt/mit_movie_trivia_roberta_large/model_ayzfwn/epoch_5/special_tokens_map.json",
|
|
|
6 |
"errors": "replace",
|
7 |
"mask_token": "<mask>",
|
8 |
"model_max_length": 512,
|
9 |
+
"name_or_path": "tner_ckpt/mit_movie_trivia_roberta_large/model_ayzfwn/epoch_5",
|
10 |
"pad_token": "<pad>",
|
11 |
"sep_token": "</s>",
|
12 |
"special_tokens_map_file": "tner_ckpt/mit_movie_trivia_roberta_large/model_ayzfwn/epoch_5/special_tokens_map.json",
|
trainer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"dataset": ["tner/mit_movie_trivia"], "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": 1e-07, "lr_warmup_step_ratio": 0.1, "max_grad_norm": 10.0}
|