asahi417 commited on
Commit
a1b9bf3
1 Parent(s): 3b2c9c4

model update

Browse files
README.md ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+ license: cc-by-4.0
4
+ metrics:
5
+ - bleu4
6
+ - meteor
7
+ - rouge-l
8
+ - bertscore
9
+ - moverscore
10
+ language: ko
11
+ datasets:
12
+ - lmqg/qag_koquad
13
+ pipeline_tag: text2text-generation
14
+ tags:
15
+ - questions and answers generation
16
+ widget:
17
+ - text: "1990년 영화 《 남부군 》에서 단역으로 영화배우 첫 데뷔에 이어 같은 해 KBS 드라마 《지구인》에서 단역으로 출연하였고 이듬해 MBC 《여명의 눈동자》를 통해 단역으로 출연하였다."
18
+ example_title: "Questions & Answers Generation Example 1"
19
+ model-index:
20
+ - name: lmqg/mt5-base-koquad-qag
21
+ results:
22
+ - task:
23
+ name: Text2text Generation
24
+ type: text2text-generation
25
+ dataset:
26
+ name: lmqg/qag_koquad
27
+ type: default
28
+ args: default
29
+ metrics:
30
+ - name: BLEU4 (Question & Answer Generation)
31
+ type: bleu4_question_answer_generation
32
+ value: 0.87
33
+ ---
34
+
35
+ # Model Card of `lmqg/mt5-base-koquad-qag`
36
+ This model is fine-tuned version of [google/mt5-base](https://huggingface.co/google/mt5-base) for question & answer pair generation task on the [lmqg/qag_koquad](https://huggingface.co/datasets/lmqg/qag_koquad) (dataset_name: default) via [`lmqg`](https://github.com/asahi417/lm-question-generation).
37
+
38
+
39
+ ### Overview
40
+ - **Language model:** [google/mt5-base](https://huggingface.co/google/mt5-base)
41
+ - **Language:** ko
42
+ - **Training data:** [lmqg/qag_koquad](https://huggingface.co/datasets/lmqg/qag_koquad) (default)
43
+ - **Online Demo:** [https://autoqg.net/](https://autoqg.net/)
44
+ - **Repository:** [https://github.com/asahi417/lm-question-generation](https://github.com/asahi417/lm-question-generation)
45
+ - **Paper:** [https://arxiv.org/abs/2210.03992](https://arxiv.org/abs/2210.03992)
46
+
47
+ ### Usage
48
+ - With [`lmqg`](https://github.com/asahi417/lm-question-generation#lmqg-language-model-for-question-generation-)
49
+ ```python
50
+ from lmqg import TransformersQG
51
+
52
+ # initialize model
53
+ model = TransformersQG(language="ko", model="lmqg/mt5-base-koquad-qag")
54
+
55
+ # model prediction
56
+ question_answer_pairs = model.generate_qa("1990년 영화 《 남부군 》에서 단역으로 영화배우 첫 데뷔에 이어 같은 해 KBS 드라마 《지구인》에서 단역으로 출연하였고 이듬해 MBC 《여명의 눈동자》를 통해 단역으로 출연하였다.")
57
+
58
+ ```
59
+
60
+ - With `transformers`
61
+ ```python
62
+ from transformers import pipeline
63
+
64
+ pipe = pipeline("text2text-generation", "lmqg/mt5-base-koquad-qag")
65
+ output = pipe("1990년 영화 《 남부군 》에서 단역으로 영화배우 첫 데뷔에 이어 같은 해 KBS 드라마 《지구인》에서 단역으로 출연하였고 이듬해 MBC 《여명의 눈동자》를 통해 단역으로 출연하였다.")
66
+
67
+ ```
68
+
69
+ ## Evaluation
70
+
71
+
72
+ - ***Metric (Question & Answer Generation)***: [raw metric file](https://huggingface.co/lmqg/mt5-base-koquad-qag/raw/main/eval/metric.first.answer.paragraph.questions_answers.lmqg_qag_koquad.default.json)
73
+
74
+ | | Score | Type | Dataset |
75
+ |:-------|--------:|:--------|:-------------------------------------------------------------------|
76
+ | Bleu_1 | 4.66 | default | [lmqg/qag_koquad](https://huggingface.co/datasets/lmqg/qag_koquad) |
77
+ | Bleu_2 | 2.43 | default | [lmqg/qag_koquad](https://huggingface.co/datasets/lmqg/qag_koquad) |
78
+ | Bleu_3 | 1.4 | default | [lmqg/qag_koquad](https://huggingface.co/datasets/lmqg/qag_koquad) |
79
+ | Bleu_4 | 0.87 | default | [lmqg/qag_koquad](https://huggingface.co/datasets/lmqg/qag_koquad) |
80
+
81
+
82
+
83
+ ## Training hyperparameters
84
+
85
+ The following hyperparameters were used during fine-tuning:
86
+ - dataset_path: lmqg/qag_koquad
87
+ - dataset_name: default
88
+ - input_types: ['paragraph']
89
+ - output_types: ['questions_answers']
90
+ - prefix_types: None
91
+ - model: google/mt5-base
92
+ - max_length: 512
93
+ - max_length_output: 256
94
+ - epoch: 18
95
+ - batch: 2
96
+ - lr: 0.001
97
+ - fp16: False
98
+ - random_seed: 1
99
+ - gradient_accumulation_steps: 64
100
+ - label_smoothing: 0.15
101
+
102
+ The full configuration can be found at [fine-tuning config file](https://huggingface.co/lmqg/mt5-base-koquad-qag/raw/main/trainer_config.json).
103
+
104
+ ## Citation
105
+ ```
106
+ @inproceedings{ushio-etal-2022-generative,
107
+ title = "{G}enerative {L}anguage {M}odels for {P}aragraph-{L}evel {Q}uestion {G}eneration",
108
+ author = "Ushio, Asahi and
109
+ Alva-Manchego, Fernando and
110
+ Camacho-Collados, Jose",
111
+ booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
112
+ month = dec,
113
+ year = "2022",
114
+ address = "Abu Dhabi, U.A.E.",
115
+ publisher = "Association for Computational Linguistics",
116
+ }
117
+
118
+ ```
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "lmqg_output/mt5-base-koquad-qag/best_model",
3
  "add_prefix": false,
4
  "architectures": [
5
  "MT5ForConditionalGeneration"
 
1
  {
2
+ "_name_or_path": "lmqg_output/mt5-base-koquad-qag/model_umlauj/epoch_17",
3
  "add_prefix": false,
4
  "architectures": [
5
  "MT5ForConditionalGeneration"
eval/metric.first.answer.paragraph.questions_answers.lmqg_qag_koquad.default.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"validation": {"Bleu_1": 0.22944459267164455, "Bleu_2": 0.14581809736110674, "Bleu_3": 0.09073762379558614, "Bleu_4": 0.060320148625246546}, "test": {"Bleu_1": 0.046633951117251785, "Bleu_2": 0.024267387176477355, "Bleu_3": 0.013983981210269144, "Bleu_4": 0.00865229909206871}}
eval/samples.test.hyp.paragraph.questions_answers.lmqg_qag_koquad.default.txt ADDED
The diff for this file is too large to render. See raw diff
 
eval/samples.validation.hyp.paragraph.questions_answers.lmqg_qag_koquad.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:46a4890a9a91302704ead27a34485781d792e07002252d411dfbecbfa2651a5e
3
- size 2329630901
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c2530294b7f85ad1e4245396fa49b1484ecf584ccf9c1f971b983f3dad9c522
3
+ size 2329634869
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-koquad-qag/best_model",
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-koquad-qag/model_umlauj/epoch_17",
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/qag_koquad", "dataset_name": "default", "input_types": ["paragraph"], "output_types": ["questions_answers"], "prefix_types": null, "model": "google/mt5-base", "max_length": 512, "max_length_output": 256, "epoch": 18, "batch": 2, "lr": 0.001, "fp16": false, "random_seed": 1, "gradient_accumulation_steps": 64, "label_smoothing": 0.15}