asahi417 commited on
Commit
1c039a8
1 Parent(s): 3b49694

commit files to HF hub

Browse files
README.md ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+ license: cc-by-4.0
4
+ metrics:
5
+ - bleu4
6
+ - meteor
7
+ - rouge-l
8
+ - bertscore
9
+ - moverscore
10
+ language: zh
11
+ datasets:
12
+ - lmqg/qag_zhquad
13
+ pipeline_tag: text2text-generation
14
+ tags:
15
+ - questions and answers generation
16
+ widget:
17
+ - text: "南安普敦的警察服务由汉普郡警察提供。南安普敦行动的主要基地是一座新的八层专用建筑,造价3000万英镑。该建筑位于南路,2011年启用,靠近 南安普敦中央 火车站。此前,南安普顿市中心的行动位于市民中心西翼,但由于设施老化,加上计划在旧警察局和地方法院建造一座新博物馆,因此必须搬迁。在Portswood、Banister Park、Hille和Shirley还有其他警察局,在南安普顿中央火车站还有一个英国交通警察局。"
18
+ example_title: "Questions & Answers Generation Example 1"
19
+ model-index:
20
+ - name: lmqg/mt5-small-zhquad-qag
21
+ results:
22
+ - task:
23
+ name: Text2text Generation
24
+ type: text2text-generation
25
+ dataset:
26
+ name: lmqg/qag_zhquad
27
+ type: default
28
+ args: default
29
+ metrics:
30
+ - name: QAAlignedF1Score-BERTScore (Question & Answer Generation)
31
+ type: qa_aligned_f1_score_bertscore_question_answer_generation
32
+ value: 75.47
33
+ - name: QAAlignedRecall-BERTScore (Question & Answer Generation)
34
+ type: qa_aligned_recall_bertscore_question_answer_generation
35
+ value: 75.41
36
+ - name: QAAlignedPrecision-BERTScore (Question & Answer Generation)
37
+ type: qa_aligned_precision_bertscore_question_answer_generation
38
+ value: 75.56
39
+ - name: QAAlignedF1Score-MoverScore (Question & Answer Generation)
40
+ type: qa_aligned_f1_score_moverscore_question_answer_generation
41
+ value: 52.42
42
+ - name: QAAlignedRecall-MoverScore (Question & Answer Generation)
43
+ type: qa_aligned_recall_moverscore_question_answer_generation
44
+ value: 52.33
45
+ - name: QAAlignedPrecision-MoverScore (Question & Answer Generation)
46
+ type: qa_aligned_precision_moverscore_question_answer_generation
47
+ value: 52.53
48
+ ---
49
+
50
+ # Model Card of `lmqg/mt5-small-zhquad-qag`
51
+ This model is fine-tuned version of [google/mt5-small](https://huggingface.co/google/mt5-small) for question & answer pair generation task on the [lmqg/qag_zhquad](https://huggingface.co/datasets/lmqg/qag_zhquad) (dataset_name: default) via [`lmqg`](https://github.com/asahi417/lm-question-generation).
52
+
53
+
54
+ ### Overview
55
+ - **Language model:** [google/mt5-small](https://huggingface.co/google/mt5-small)
56
+ - **Language:** zh
57
+ - **Training data:** [lmqg/qag_zhquad](https://huggingface.co/datasets/lmqg/qag_zhquad) (default)
58
+ - **Online Demo:** [https://autoqg.net/](https://autoqg.net/)
59
+ - **Repository:** [https://github.com/asahi417/lm-question-generation](https://github.com/asahi417/lm-question-generation)
60
+ - **Paper:** [https://arxiv.org/abs/2210.03992](https://arxiv.org/abs/2210.03992)
61
+
62
+ ### Usage
63
+ - With [`lmqg`](https://github.com/asahi417/lm-question-generation#lmqg-language-model-for-question-generation-)
64
+ ```python
65
+ from lmqg import TransformersQG
66
+
67
+ # initialize model
68
+ model = TransformersQG(language="zh", model="lmqg/mt5-small-zhquad-qag")
69
+
70
+ # model prediction
71
+ question_answer_pairs = model.generate_qa("南安普敦的警察服务由汉普郡警察提供。南安普敦行动的主要基地是一座新的八层专用建筑,造价3000万英镑。该建筑位于南路,2011年启用,靠近南安普敦中央火车站。此前,南安普顿市中心的行动位于市民中心西翼,但由于设施老化,加上计划在旧警察局和地方法院建造一座新博物馆,因此必须搬迁。在Portswood、Banister Park、Hille和Shirley还有其他警察局,在南安普顿中央火车站还有一个英国交通警察局。")
72
+
73
+ ```
74
+
75
+ - With `transformers`
76
+ ```python
77
+ from transformers import pipeline
78
+
79
+ pipe = pipeline("text2text-generation", "lmqg/mt5-small-zhquad-qag")
80
+ output = pipe("南安普敦的警察服务由汉普郡警察提供。南安普敦行动的主要基地是一座新的八层专用建筑,造价3000万英镑。该建筑位于南路,2011年启用,靠近 南安普敦中央 火车站。此前,南安普顿市中心的行动位于市民中心西翼,但由于设施老化,加上计划在旧警察局和地方法院建造一座新博物馆,因此必须搬迁。在Portswood、Banister Park、Hille和Shirley还有其他警察局,在南安普顿中央火车站还有一个英国交通警察局。")
81
+
82
+ ```
83
+
84
+ ## Evaluation
85
+
86
+
87
+ - ***Metric (Question & Answer Generation)***: [raw metric file](https://huggingface.co/lmqg/mt5-small-zhquad-qag/raw/main/eval/metric.first.answer.paragraph.questions_answers.lmqg_qag_zhquad.default.json)
88
+
89
+ | | Score | Type | Dataset |
90
+ |:--------------------------------|--------:|:--------|:-------------------------------------------------------------------|
91
+ | QAAlignedF1Score (BERTScore) | 75.47 | default | [lmqg/qag_zhquad](https://huggingface.co/datasets/lmqg/qag_zhquad) |
92
+ | QAAlignedF1Score (MoverScore) | 52.42 | default | [lmqg/qag_zhquad](https://huggingface.co/datasets/lmqg/qag_zhquad) |
93
+ | QAAlignedPrecision (BERTScore) | 75.56 | default | [lmqg/qag_zhquad](https://huggingface.co/datasets/lmqg/qag_zhquad) |
94
+ | QAAlignedPrecision (MoverScore) | 52.53 | default | [lmqg/qag_zhquad](https://huggingface.co/datasets/lmqg/qag_zhquad) |
95
+ | QAAlignedRecall (BERTScore) | 75.41 | default | [lmqg/qag_zhquad](https://huggingface.co/datasets/lmqg/qag_zhquad) |
96
+ | QAAlignedRecall (MoverScore) | 52.33 | default | [lmqg/qag_zhquad](https://huggingface.co/datasets/lmqg/qag_zhquad) |
97
+
98
+
99
+
100
+ ## Training hyperparameters
101
+
102
+ The following hyperparameters were used during fine-tuning:
103
+ - dataset_path: lmqg/qag_zhquad
104
+ - dataset_name: default
105
+ - input_types: ['paragraph']
106
+ - output_types: ['questions_answers']
107
+ - prefix_types: None
108
+ - model: google/mt5-small
109
+ - max_length: 512
110
+ - max_length_output: 256
111
+ - epoch: 12
112
+ - batch: 8
113
+ - lr: 0.001
114
+ - fp16: False
115
+ - random_seed: 1
116
+ - gradient_accumulation_steps: 8
117
+ - label_smoothing: 0.15
118
+
119
+ The full configuration can be found at [fine-tuning config file](https://huggingface.co/lmqg/mt5-small-zhquad-qag/raw/main/trainer_config.json).
120
+
121
+ ## Citation
122
+ ```
123
+ @inproceedings{ushio-etal-2022-generative,
124
+ title = "{G}enerative {L}anguage {M}odels for {P}aragraph-{L}evel {Q}uestion {G}eneration",
125
+ author = "Ushio, Asahi and
126
+ Alva-Manchego, Fernando and
127
+ Camacho-Collados, Jose",
128
+ booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
129
+ month = dec,
130
+ year = "2022",
131
+ address = "Abu Dhabi, U.A.E.",
132
+ publisher = "Association for Computational Linguistics",
133
+ }
134
+
135
+ ```
eval/metric.first.answer.paragraph.questions_answers.lmqg_qag_zhquad.default.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"validation": {"Bleu_1": 0.14134835343020602, "Bleu_2": 0.10534816521967788, "Bleu_3": 0.0766084173202246, "Bleu_4": 0.04687224075080508, "METEOR": 0.14697248412164318, "ROUGE_L": 0.21885139820728308, "BERTScore": 0.6995925002748316, "MoverScore": 0.5008344918609549, "QAAlignedF1Score (BERTScore)": 0.7592320980145917, "QAAlignedRecall (BERTScore)": 0.7419003721531561, "QAAlignedPrecision (BERTScore)": 0.7784040149783445, "QAAlignedF1Score (MoverScore)": 0.5269689064434208, "QAAlignedRecall (MoverScore)": 0.5157330420279342, "QAAlignedPrecision (MoverScore)": 0.5393656213706578}, "test": {"Bleu_1": 0.05186334464606799, "Bleu_2": 0.03793786971902631, "Bleu_3": 0.026232797866259774, "Bleu_4": 0.01568589004862248, "METEOR": 0.09359306444063609, "ROUGE_L": 0.10737244587096752, "BERTScore": 0.6015494508939344, "MoverScore": 0.4916226730806146, "QAAlignedF1Score (BERTScore)": 0.7547118486424483, "QAAlignedRecall (BERTScore)": 0.7540613106188125, "QAAlignedPrecision (BERTScore)": 0.7556347203918363, "QAAlignedF1Score (MoverScore)": 0.5242262076682067, "QAAlignedRecall (MoverScore)": 0.5232569024808614, "QAAlignedPrecision (MoverScore)": 0.5253399484071091}}
eval/samples.test.hyp.paragraph.questions_answers.lmqg_qag_zhquad.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_zhquad.default.txt ADDED
The diff for this file is too large to render. See raw diff
 
trainer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"dataset_path": "lmqg/qag_zhquad", "dataset_name": "default", "input_types": ["paragraph"], "output_types": ["questions_answers"], "prefix_types": null, "model": "google/mt5-small", "max_length": 512, "max_length_output": 256, "epoch": 12, "batch": 8, "lr": 0.001, "fp16": false, "random_seed": 1, "gradient_accumulation_steps": 8, "label_smoothing": 0.15}