model update
Browse files- README.md +160 -0
- config.json +1 -1
- eval/metric.first.answer.paragraph_answer.question.lmqg_qg_dequad.default.json +1 -0
- eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_dequad.default.json +1 -0
- eval/samples.test.hyp.paragraph_answer.question.lmqg_qg_dequad.default.txt +0 -0
- eval/samples.validation.hyp.paragraph_answer.question.lmqg_qg_dequad.default.txt +0 -0
- pytorch_model.bin +2 -2
- tokenizer_config.json +1 -1
- trainer_config.json +1 -0
README.md
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_dequad
|
13 |
+
pipeline_tag: text2text-generation
|
14 |
+
tags:
|
15 |
+
- question generation
|
16 |
+
- answer extraction
|
17 |
+
widget:
|
18 |
+
- text: "generate question: <hl> Beyonce <hl> further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, Cadillac Records."
|
19 |
+
example_title: "Question Generation Example 1"
|
20 |
+
- text: "generate question: Beyonce further expanded her acting career, starring as blues singer <hl> Etta James <hl> in the 2008 musical biopic, Cadillac Records."
|
21 |
+
example_title: "Question Generation Example 2"
|
22 |
+
- text: "generate question: Beyonce further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, <hl> Cadillac Records <hl> ."
|
23 |
+
example_title: "Question Generation Example 3"
|
24 |
+
- text: "<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."
|
25 |
+
example_title: "Answer Extraction Example 1"
|
26 |
+
- text: "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>"
|
27 |
+
example_title: "Answer Extraction Example 2"
|
28 |
+
model-index:
|
29 |
+
- name: lmqg/mt5-base-dequad-multitask
|
30 |
+
results:
|
31 |
+
- task:
|
32 |
+
name: Text2text Generation
|
33 |
+
type: text2text-generation
|
34 |
+
dataset:
|
35 |
+
name: lmqg/qg_dequad
|
36 |
+
type: default
|
37 |
+
args: default
|
38 |
+
metrics:
|
39 |
+
- name: BLEU4
|
40 |
+
type: bleu4
|
41 |
+
value: 0.0037638715919786907
|
42 |
+
- name: ROUGE-L
|
43 |
+
type: rouge-l
|
44 |
+
value: 0.08578655213486944
|
45 |
+
- name: METEOR
|
46 |
+
type: meteor
|
47 |
+
value: 0.1055901831758648
|
48 |
+
- name: BERTScore
|
49 |
+
type: bertscore
|
50 |
+
value: 0.7786051149573353
|
51 |
+
- name: MoverScore
|
52 |
+
type: moverscore
|
53 |
+
value: 0.537714157008381
|
54 |
+
---
|
55 |
+
|
56 |
+
# Model Card of `lmqg/mt5-base-dequad-multitask`
|
57 |
+
This model is fine-tuned version of [google/mt5-base](https://huggingface.co/google/mt5-base) for question generation task on the
|
58 |
+
[lmqg/qg_dequad](https://huggingface.co/datasets/lmqg/qg_dequad) (dataset_name: default) via [`lmqg`](https://github.com/asahi417/lm-question-generation).
|
59 |
+
This model is fine-tuned on the answer extraction task as well as the question generation.
|
60 |
+
|
61 |
+
Please cite our paper if you use the model ([https://arxiv.org/abs/2210.03992](https://arxiv.org/abs/2210.03992)).
|
62 |
+
|
63 |
+
```
|
64 |
+
|
65 |
+
@inproceedings{ushio-etal-2022-generative,
|
66 |
+
title = "{G}enerative {L}anguage {M}odels for {P}aragraph-{L}evel {Q}uestion {G}eneration",
|
67 |
+
author = "Ushio, Asahi and
|
68 |
+
Alva-Manchego, Fernando and
|
69 |
+
Camacho-Collados, Jose",
|
70 |
+
booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
|
71 |
+
month = dec,
|
72 |
+
year = "2022",
|
73 |
+
address = "Abu Dhabi, U.A.E.",
|
74 |
+
publisher = "Association for Computational Linguistics",
|
75 |
+
}
|
76 |
+
|
77 |
+
```
|
78 |
+
|
79 |
+
### Overview
|
80 |
+
- **Language model:** [google/mt5-base](https://huggingface.co/google/mt5-base)
|
81 |
+
- **Language:** en
|
82 |
+
- **Training data:** [lmqg/qg_dequad](https://huggingface.co/datasets/lmqg/qg_dequad) (default)
|
83 |
+
- **Online Demo:** [https://autoqg.net/](https://autoqg.net/)
|
84 |
+
- **Repository:** [https://github.com/asahi417/lm-question-generation](https://github.com/asahi417/lm-question-generation)
|
85 |
+
- **Paper:** [https://arxiv.org/abs/2210.03992](https://arxiv.org/abs/2210.03992)
|
86 |
+
|
87 |
+
### Usage
|
88 |
+
- With [`lmqg`](https://github.com/asahi417/lm-question-generation#lmqg-language-model-for-question-generation-)
|
89 |
+
```python
|
90 |
+
|
91 |
+
from lmqg import TransformersQG
|
92 |
+
# initialize model
|
93 |
+
model = TransformersQG(language='en', model='lmqg/mt5-base-dequad-multitask')
|
94 |
+
# model prediction
|
95 |
+
question_answer = model.generate_qa("William Turner was an English painter who specialised in watercolour landscapes")
|
96 |
+
|
97 |
+
```
|
98 |
+
|
99 |
+
- With `transformers`
|
100 |
+
```python
|
101 |
+
|
102 |
+
from transformers import pipeline
|
103 |
+
# initialize model
|
104 |
+
pipe = pipeline("text2text-generation", 'lmqg/mt5-base-dequad-multitask')
|
105 |
+
# answer extraction
|
106 |
+
answer = 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.')
|
107 |
+
# question generation
|
108 |
+
question = pipe('generate question: <hl> Beyonce <hl> further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, Cadillac Records.')
|
109 |
+
|
110 |
+
```
|
111 |
+
|
112 |
+
## Evaluation Metrics
|
113 |
+
|
114 |
+
|
115 |
+
### Metrics
|
116 |
+
|
117 |
+
| Dataset | Type | BLEU4 | ROUGE-L | METEOR | BERTScore | MoverScore | Link |
|
118 |
+
|:--------|:-----|------:|--------:|-------:|----------:|-----------:|-----:|
|
119 |
+
| [lmqg/qg_dequad](https://huggingface.co/datasets/lmqg/qg_dequad) | default | 0.004 | 0.086 | 0.106 | 0.779 | 0.538 | [link](https://huggingface.co/lmqg/mt5-base-dequad-multitask/raw/main/eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_dequad.default.json) |
|
120 |
+
|
121 |
+
|
122 |
+
|
123 |
+
|
124 |
+
## Training hyperparameters
|
125 |
+
|
126 |
+
The following hyperparameters were used during fine-tuning:
|
127 |
+
- dataset_path: lmqg/qg_dequad
|
128 |
+
- dataset_name: default
|
129 |
+
- input_types: ['paragraph_answer', 'paragraph_sentence']
|
130 |
+
- output_types: ['question', 'answer']
|
131 |
+
- prefix_types: ['qg', 'ae']
|
132 |
+
- model: google/mt5-base
|
133 |
+
- max_length: 512
|
134 |
+
- max_length_output: 32
|
135 |
+
- epoch: 8
|
136 |
+
- batch: 32
|
137 |
+
- lr: 0.0001
|
138 |
+
- fp16: False
|
139 |
+
- random_seed: 1
|
140 |
+
- gradient_accumulation_steps: 2
|
141 |
+
- label_smoothing: 0.15
|
142 |
+
|
143 |
+
The full configuration can be found at [fine-tuning config file](https://huggingface.co/lmqg/mt5-base-dequad-multitask/raw/main/trainer_config.json).
|
144 |
+
|
145 |
+
## Citation
|
146 |
+
```
|
147 |
+
|
148 |
+
@inproceedings{ushio-etal-2022-generative,
|
149 |
+
title = "{G}enerative {L}anguage {M}odels for {P}aragraph-{L}evel {Q}uestion {G}eneration",
|
150 |
+
author = "Ushio, Asahi and
|
151 |
+
Alva-Manchego, Fernando and
|
152 |
+
Camacho-Collados, Jose",
|
153 |
+
booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
|
154 |
+
month = dec,
|
155 |
+
year = "2022",
|
156 |
+
address = "Abu Dhabi, U.A.E.",
|
157 |
+
publisher = "Association for Computational Linguistics",
|
158 |
+
}
|
159 |
+
|
160 |
+
```
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "lmqg_output/mt5_base_dequad_answer/
|
3 |
"add_prefix": true,
|
4 |
"architectures": [
|
5 |
"MT5ForConditionalGeneration"
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "lmqg_output/mt5_base_dequad_answer/model_mntyya/epoch_5",
|
3 |
"add_prefix": true,
|
4 |
"architectures": [
|
5 |
"MT5ForConditionalGeneration"
|
eval/metric.first.answer.paragraph_answer.question.lmqg_qg_dequad.default.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"validation": {"Bleu_1": 0.0952063597848291, "Bleu_2": 0.03818700965134984, "Bleu_3": 0.017108348075766118, "Bleu_4": 0.006107565577034717}, "test": {"Bleu_1": 0.08029642136859996, "Bleu_2": 0.031216356903100213, "Bleu_3": 0.011293038632361377, "Bleu_4": 0.0037405916540954034}}
|
eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_dequad.default.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"validation": {"Bleu_1": 0.09601003521975703, "Bleu_2": 0.03840685869062143, "Bleu_3": 0.01715111846800755, "Bleu_4": 0.006140345879834443, "METEOR": 0.11249452928869386, "ROUGE_L": 0.09916299920547067, "BERTScore": 0.7929441278332354, "MoverScore": 0.5458778771227091}, "test": {"Bleu_1": 0.08190559867232479, "Bleu_2": 0.031672449692541, "Bleu_3": 0.011237859034650867, "Bleu_4": 0.0037638715919786907, "METEOR": 0.1055901831758648, "ROUGE_L": 0.08578655213486944, "BERTScore": 0.7786051149573353, "MoverScore": 0.537714157008381}}
|
eval/samples.test.hyp.paragraph_answer.question.lmqg_qg_dequad.default.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
eval/samples.validation.hyp.paragraph_answer.question.lmqg_qg_dequad.default.txt
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:ebf4b412aefde9950fb88c69434abe7cbb14e59c73dd99f4b7effd8b0d521916
|
3 |
+
size 2329632589
|
tokenizer_config.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
"additional_special_tokens": null,
|
3 |
"eos_token": "</s>",
|
4 |
"extra_ids": 0,
|
5 |
-
"name_or_path": "lmqg_output/mt5_base_dequad_answer/
|
6 |
"pad_token": "<pad>",
|
7 |
"sp_model_kwargs": {},
|
8 |
"special_tokens_map_file": "/home/patrick/.cache/torch/transformers/685ac0ca8568ec593a48b61b0a3c272beee9bc194a3c7241d15dcadb5f875e53.f76030f3ec1b96a8199b2593390c610e76ca8028ef3d24680000619ffb646276",
|
|
|
2 |
"additional_special_tokens": null,
|
3 |
"eos_token": "</s>",
|
4 |
"extra_ids": 0,
|
5 |
+
"name_or_path": "lmqg_output/mt5_base_dequad_answer/model_mntyya/epoch_5",
|
6 |
"pad_token": "<pad>",
|
7 |
"sp_model_kwargs": {},
|
8 |
"special_tokens_map_file": "/home/patrick/.cache/torch/transformers/685ac0ca8568ec593a48b61b0a3c272beee9bc194a3c7241d15dcadb5f875e53.f76030f3ec1b96a8199b2593390c610e76ca8028ef3d24680000619ffb646276",
|
trainer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"dataset_path": "lmqg/qg_dequad", "dataset_name": "default", "input_types": ["paragraph_answer", "paragraph_sentence"], "output_types": ["question", "answer"], "prefix_types": ["qg", "ae"], "model": "google/mt5-base", "max_length": 512, "max_length_output": 32, "epoch": 8, "batch": 32, "lr": 0.0001, "fp16": false, "random_seed": 1, "gradient_accumulation_steps": 2, "label_smoothing": 0.15}
|