model update
Browse files- README.md +144 -0
- config.json +1 -1
- pytorch_model.bin +2 -2
- tokenizer_config.json +1 -1
README.md
ADDED
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
license: cc-by-4.0
|
4 |
+
metrics:
|
5 |
+
- bleu4
|
6 |
+
- meteor
|
7 |
+
- rouge-l
|
8 |
+
- bertscore
|
9 |
+
- moverscore
|
10 |
+
language: en
|
11 |
+
datasets:
|
12 |
+
- lmqg/qg_squad
|
13 |
+
pipeline_tag: text2text-generation
|
14 |
+
tags:
|
15 |
+
- answer extraction
|
16 |
+
widget:
|
17 |
+
- text: "extract answers: <hl> Beyonce further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, Cadillac Records. <hl> Her performance in the film received praise from critics, and she garnered several nominations for her portrayal of James, including a Satellite Award nomination for Best Supporting Actress, and a NAACP Image Award nomination for Outstanding Supporting Actress."
|
18 |
+
example_title: "Answering Extraction Example 1"
|
19 |
+
- text: "extract answers: Beyonce further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, Cadillac Records. <hl> Her performance in the film received praise from critics, and she garnered several nominations for her portrayal of James, including a Satellite Award nomination for Best Supporting Actress, and a NAACP Image Award nomination for Outstanding Supporting Actress. <hl>"
|
20 |
+
example_title: "Answering Extraction Example 2"
|
21 |
+
model-index:
|
22 |
+
- name: lmqg/t5-small-squad-answer-extraction
|
23 |
+
results:
|
24 |
+
- task:
|
25 |
+
name: Text2text Generation
|
26 |
+
type: text2text-generation
|
27 |
+
dataset:
|
28 |
+
name: lmqg/qg_squad
|
29 |
+
type: default
|
30 |
+
args: default
|
31 |
+
metrics:
|
32 |
+
- name: BLEU4
|
33 |
+
type: bleu4
|
34 |
+
value: 39.23
|
35 |
+
- name: ROUGE-L
|
36 |
+
type: rouge-l
|
37 |
+
value: 67.58
|
38 |
+
- name: METEOR
|
39 |
+
type: meteor
|
40 |
+
value: 42.5
|
41 |
+
- name: BERTScore
|
42 |
+
type: bertscore
|
43 |
+
value: 91.2
|
44 |
+
- name: MoverScore
|
45 |
+
type: moverscore
|
46 |
+
value: 80.92
|
47 |
+
- name: AnswerF1Score (Answer Extraction)
|
48 |
+
type: answer_f1_score_answer_extraction
|
49 |
+
value: 68.06
|
50 |
+
- name: AnswerExactMatch (Answer Extraction)
|
51 |
+
type: answer_exact_match_answer_extraction
|
52 |
+
value: 56.15
|
53 |
+
---
|
54 |
+
|
55 |
+
# Model Card of `lmqg/t5-small-squad-answer-extraction`
|
56 |
+
This model is fine-tuned version of [t5-small](https://huggingface.co/t5-small) for answer extraction on the [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) (dataset_name: default) via [`lmqg`](https://github.com/asahi417/lm-question-generation).
|
57 |
+
|
58 |
+
|
59 |
+
### Overview
|
60 |
+
- **Language model:** [t5-small](https://huggingface.co/t5-small)
|
61 |
+
- **Language:** en
|
62 |
+
- **Training data:** [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) (default)
|
63 |
+
- **Online Demo:** [https://autoqg.net/](https://autoqg.net/)
|
64 |
+
- **Repository:** [https://github.com/asahi417/lm-question-generation](https://github.com/asahi417/lm-question-generation)
|
65 |
+
- **Paper:** [https://arxiv.org/abs/2210.03992](https://arxiv.org/abs/2210.03992)
|
66 |
+
|
67 |
+
### Usage
|
68 |
+
- With [`lmqg`](https://github.com/asahi417/lm-question-generation#lmqg-language-model-for-question-generation-)
|
69 |
+
```python
|
70 |
+
from lmqg import TransformersQG
|
71 |
+
|
72 |
+
# initialize model
|
73 |
+
model = TransformersQG(language="en", model="lmqg/t5-small-squad-answer-extraction")
|
74 |
+
|
75 |
+
# model prediction
|
76 |
+
answers = model.generate_a("William Turner was an English painter who specialised in watercolour landscapes")
|
77 |
+
|
78 |
+
```
|
79 |
+
|
80 |
+
- With `transformers`
|
81 |
+
```python
|
82 |
+
from transformers import pipeline
|
83 |
+
|
84 |
+
pipe = pipeline("text2text-generation", "lmqg/t5-small-squad-answer-extraction")
|
85 |
+
output = pipe("extract answers: <hl> Beyonce further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, Cadillac Records. <hl> Her performance in the film received praise from critics, and she garnered several nominations for her portrayal of James, including a Satellite Award nomination for Best Supporting Actress, and a NAACP Image Award nomination for Outstanding Supporting Actress.")
|
86 |
+
|
87 |
+
```
|
88 |
+
|
89 |
+
## Evaluation
|
90 |
+
|
91 |
+
|
92 |
+
- ***Metric (Answer Extraction)***: [raw metric file](https://huggingface.co/lmqg/t5-small-squad-answer-extraction/raw/main/eval/metric.first.answer.paragraph_sentence.answer.lmqg_qg_squad.default.json)
|
93 |
+
|
94 |
+
| | Score | Type | Dataset |
|
95 |
+
|:-----------------|--------:|:--------|:---------------------------------------------------------------|
|
96 |
+
| AnswerExactMatch | 56.15 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
|
97 |
+
| AnswerF1Score | 68.06 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
|
98 |
+
| BERTScore | 91.2 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
|
99 |
+
| Bleu_1 | 52.42 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
|
100 |
+
| Bleu_2 | 47.81 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
|
101 |
+
| Bleu_3 | 43.22 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
|
102 |
+
| Bleu_4 | 39.23 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
|
103 |
+
| METEOR | 42.5 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
|
104 |
+
| MoverScore | 80.92 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
|
105 |
+
| ROUGE_L | 67.58 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
|
106 |
+
|
107 |
+
|
108 |
+
|
109 |
+
## Training hyperparameters
|
110 |
+
|
111 |
+
The following hyperparameters were used during fine-tuning:
|
112 |
+
- dataset_path: lmqg/qg_squad
|
113 |
+
- dataset_name: default
|
114 |
+
- input_types: ['paragraph_sentence']
|
115 |
+
- output_types: ['answer']
|
116 |
+
- prefix_types: ['ae']
|
117 |
+
- model: t5-small
|
118 |
+
- max_length: 512
|
119 |
+
- max_length_output: 32
|
120 |
+
- epoch: 7
|
121 |
+
- batch: 64
|
122 |
+
- lr: 0.0001
|
123 |
+
- fp16: False
|
124 |
+
- random_seed: 1
|
125 |
+
- gradient_accumulation_steps: 1
|
126 |
+
- label_smoothing: 0.15
|
127 |
+
|
128 |
+
The full configuration can be found at [fine-tuning config file](https://huggingface.co/lmqg/t5-small-squad-answer-extraction/raw/main/trainer_config.json).
|
129 |
+
|
130 |
+
## Citation
|
131 |
+
```
|
132 |
+
@inproceedings{ushio-etal-2022-generative,
|
133 |
+
title = "{G}enerative {L}anguage {M}odels for {P}aragraph-{L}evel {Q}uestion {G}eneration",
|
134 |
+
author = "Ushio, Asahi and
|
135 |
+
Alva-Manchego, Fernando and
|
136 |
+
Camacho-Collados, Jose",
|
137 |
+
booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
|
138 |
+
month = dec,
|
139 |
+
year = "2022",
|
140 |
+
address = "Abu Dhabi, U.A.E.",
|
141 |
+
publisher = "Association for Computational Linguistics",
|
142 |
+
}
|
143 |
+
|
144 |
+
```
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "lmqg_output/t5-small-squad-answer-extraction/
|
3 |
"add_prefix": true,
|
4 |
"architectures": [
|
5 |
"T5ForConditionalGeneration"
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "lmqg_output/t5-small-squad-answer-extraction/model_eszyci/epoch_2",
|
3 |
"add_prefix": true,
|
4 |
"architectures": [
|
5 |
"T5ForConditionalGeneration"
|
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:bd3df52549021ffae9da3bb25d309670c6042243be92ded5996971aaf532a4f4
|
3 |
+
size 242016345
|
tokenizer_config.json
CHANGED
@@ -104,7 +104,7 @@
|
|
104 |
"eos_token": "</s>",
|
105 |
"extra_ids": 100,
|
106 |
"model_max_length": 512,
|
107 |
-
"name_or_path": "lmqg_output/t5-small-squad-answer-extraction/
|
108 |
"pad_token": "<pad>",
|
109 |
"special_tokens_map_file": null,
|
110 |
"tokenizer_class": "T5Tokenizer",
|
|
|
104 |
"eos_token": "</s>",
|
105 |
"extra_ids": 100,
|
106 |
"model_max_length": 512,
|
107 |
+
"name_or_path": "lmqg_output/t5-small-squad-answer-extraction/model_eszyci/epoch_2",
|
108 |
"pad_token": "<pad>",
|
109 |
"special_tokens_map_file": null,
|
110 |
"tokenizer_class": "T5Tokenizer",
|