model update
Browse files- README.md +160 -0
- config.json +1 -1
- eval/metric.first.answer.paragraph_answer.question.lmqg_qg_frquad.default.json +1 -0
- eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_frquad.default.json +1 -0
- eval/samples.test.hyp.paragraph_answer.question.lmqg_qg_frquad.default.txt +0 -0
- eval/samples.validation.hyp.paragraph_answer.question.lmqg_qg_frquad.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: fr
|
11 |
+
datasets:
|
12 |
+
- lmqg/qg_frquad
|
13 |
+
pipeline_tag: text2text-generation
|
14 |
+
tags:
|
15 |
+
- question generation
|
16 |
+
- answer extraction
|
17 |
+
widget:
|
18 |
+
- text: "generate question: Créateur » (Maker), lui aussi au singulier, « <hl> le Suprême Berger <hl> » (The Great Shepherd) ; de l'autre, des réminiscences de la théologie de l'Antiquité : le tonnerre, voix de Jupiter, « Et souvent ta voix gronde en un tonnerre terrifiant », etc."
|
19 |
+
example_title: "Question Generation Example 1"
|
20 |
+
- text: "generate question: Ce black dog peut être lié à des évènements traumatisants issus du monde extérieur, tels que son renvoi de l'Amirauté après la catastrophe des Dardanelles, lors de la <hl> Grande Guerre <hl> de 14-18, ou son rejet par l'électorat en juillet 1945."
|
21 |
+
example_title: "Question Generation Example 2"
|
22 |
+
- text: "generate question: contre <hl> Normie Smith <hl> et 15 000 dollars le 28 novembre 1938."
|
23 |
+
example_title: "Question Generation Example 3"
|
24 |
+
- text: "Pourtant, la strophe spensérienne, utilisée cinq fois avant que ne commence le chœur, constitue en soi un vecteur dont les répétitions structurelles, selon Ricks, relèvent du pur lyrisme tout en constituant une menace potentielle. Après les huit sages pentamètres iambiques, l'alexandrin final <hl> permet une pause <hl>, « véritable illusion d'optique » qu'accentuent les nombreuses expressions archaïsantes telles que did swoon, did seem, did go, did receive, did make, qui doublent le prétérit en un temps composé et paraissent à la fois « très précautionneuses et très peu pressées »."
|
25 |
+
example_title: "Answer Extraction Example 1"
|
26 |
+
- text: "Néanmoins, une fois encore, l'arithmétique modulaire est insuffisante pour venir à bout du théorème. Dirichlet utilise de nombreuses techniques analytiques, comme les séries entières et l'analyse complexe. Le fruit de ces travaux donne naissance à une nouvelle branche des mathématiques : la théorie analytique des nombres. L'un des points cruciaux de cette théorie provient de l'unique article de <hl> Bernhard Riemann <hl> en théorie des nombres : Sur le nombre de nombres premiers inférieurs à une taille donnée. Il conjecture une localisation des racines de sa fonction ζ. La recherche de la position des racines, initiée par Dirichlet, devient une préoccupation centrale et reste l'une des conjectures pressenties comme les plus difficiles des mathématiques de notre époque."
|
27 |
+
example_title: "Answer Extraction Example 2"
|
28 |
+
model-index:
|
29 |
+
- name: lmqg/mt5-base-frquad-multitask
|
30 |
+
results:
|
31 |
+
- task:
|
32 |
+
name: Text2text Generation
|
33 |
+
type: text2text-generation
|
34 |
+
dataset:
|
35 |
+
name: lmqg/qg_frquad
|
36 |
+
type: default
|
37 |
+
args: default
|
38 |
+
metrics:
|
39 |
+
- name: BLEU4
|
40 |
+
type: bleu4
|
41 |
+
value: 0.0747688439703985
|
42 |
+
- name: ROUGE-L
|
43 |
+
type: rouge-l
|
44 |
+
value: 0.2704818403079258
|
45 |
+
- name: METEOR
|
46 |
+
type: meteor
|
47 |
+
value: 0.16702013121594061
|
48 |
+
- name: BERTScore
|
49 |
+
type: bertscore
|
50 |
+
value: 0.7958431921730535
|
51 |
+
- name: MoverScore
|
52 |
+
type: moverscore
|
53 |
+
value: 0.5590516687507191
|
54 |
+
---
|
55 |
+
|
56 |
+
# Model Card of `lmqg/mt5-base-frquad-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_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) (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:** fr
|
82 |
+
- **Training data:** [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) (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='fr', model='lmqg/mt5-base-frquad-multitask')
|
94 |
+
# model prediction
|
95 |
+
question_answer = model.generate_qa("Créateur » (Maker), lui aussi au singulier, « le Suprême Berger » (The Great Shepherd) ; de l'autre, des réminiscences de la théologie de l'Antiquité : le tonnerre, voix de Jupiter, « Et souvent ta voix gronde en un tonnerre terrifiant », etc.")
|
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-frquad-multitask')
|
105 |
+
# answer extraction
|
106 |
+
answer = pipe('extract answers: Pourtant, la strophe spensérienne, utilisée cinq fois avant que ne commence le chœur, constitue en soi un vecteur dont les répétitions structurelles, selon Ricks, relèvent du pur lyrisme tout en constituant une menace potentielle. Après les huit sages pentamètres iambiques, l'alexandrin final <hl> permet une pause <hl>, « véritable illusion d'optique » qu'accentuent les nombreuses expressions archaïsantes telles que did swoon, did seem, did go, did receive, did make, qui doublent le prétérit en un temps composé et paraissent à la fois « très précautionneuses et très peu pressées ».')
|
107 |
+
# question generation
|
108 |
+
question = pipe('generate question: Créateur » (Maker), lui aussi au singulier, « <hl> le Suprême Berger <hl> » (The Great Shepherd) ; de l'autre, des réminiscences de la théologie de l'Antiquité : le tonnerre, voix de Jupiter, « Et souvent ta voix gronde en un tonnerre terrifiant », etc.')
|
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_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) | default | 0.075 | 0.27 | 0.167 | 0.796 | 0.559 | [link](https://huggingface.co/lmqg/mt5-base-frquad-multitask/raw/main/eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_frquad.default.json) |
|
120 |
+
|
121 |
+
|
122 |
+
|
123 |
+
|
124 |
+
## Training hyperparameters
|
125 |
+
|
126 |
+
The following hyperparameters were used during fine-tuning:
|
127 |
+
- dataset_path: lmqg/qg_frquad
|
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: 15
|
136 |
+
- batch: 32
|
137 |
+
- lr: 0.001
|
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-frquad-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_frquad_answer/
|
3 |
"add_prefix": true,
|
4 |
"architectures": [
|
5 |
"MT5ForConditionalGeneration"
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "lmqg_output/mt5_base_frquad_answer/model_wlcbeh/epoch_5",
|
3 |
"add_prefix": true,
|
4 |
"architectures": [
|
5 |
"MT5ForConditionalGeneration"
|
eval/metric.first.answer.paragraph_answer.question.lmqg_qg_frquad.default.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"validation": {"Bleu_1": 0.2680743951894765, "Bleu_2": 0.15067316854532403, "Bleu_3": 0.09921879975188543, "Bleu_4": 0.06790100004122353}, "test": {"Bleu_1": 0.26973298981144544, "Bleu_2": 0.15636215968273098, "Bleu_3": 0.10472423509423186, "Bleu_4": 0.07422757531954968}}
|
eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_frquad.default.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"validation": {"Bleu_1": 0.2694547227719855, "Bleu_2": 0.15165224416188303, "Bleu_3": 0.0999126496357766, "Bleu_4": 0.06839312052927003, "METEOR": 0.15768852727471924, "ROUGE_L": 0.2872770901710382, "BERTScore": 0.7825376500679625, "MoverScore": 0.5523617333177983}, "test": {"Bleu_1": 0.27101589411977184, "Bleu_2": 0.1572622642192463, "Bleu_3": 0.10539339862811459, "Bleu_4": 0.0747688439703985, "METEOR": 0.16702013121594061, "ROUGE_L": 0.2704818403079258, "BERTScore": 0.7958431921730535, "MoverScore": 0.5590516687507191}}
|
eval/samples.test.hyp.paragraph_answer.question.lmqg_qg_frquad.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_frquad.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:c88b3ca7cb92b3331930d881a73e7efb00a1b2d54aeaaca32dd33325e2438cc9
|
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_frquad_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_frquad_answer/model_wlcbeh/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_frquad", "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": 15, "batch": 32, "lr": 0.001, "fp16": false, "random_seed": 1, "gradient_accumulation_steps": 2, "label_smoothing": 0.15}
|