StellarMilk
commited on
Commit
•
55569bc
1
Parent(s):
b04ddc9
commit files to HF hub
Browse files- README.md +114 -0
- eval/metric.first.answer.paragraph.questions_answers.StellarMilk_newsqa.default.json +1 -0
- eval/samples.test.hyp.paragraph.questions_answers.StellarMilk_newsqa.default.txt +0 -0
- eval/samples.validation.hyp.paragraph.questions_answers.StellarMilk_newsqa.default.txt +0 -0
- trainer_config.json +1 -0
README.md
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
- StellarMilk/newsqa
|
13 |
+
pipeline_tag: text2text-generation
|
14 |
+
tags:
|
15 |
+
- questions and answers generation
|
16 |
+
widget:
|
17 |
+
- text: "generate question and answer: Beyonce further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, Cadillac Records."
|
18 |
+
example_title: "Questions & Answers Generation Example 1"
|
19 |
+
model-index:
|
20 |
+
- name: StellarMilk/t5-base-newsqa-qag-trained
|
21 |
+
results:
|
22 |
+
- task:
|
23 |
+
name: Text2text Generation
|
24 |
+
type: text2text-generation
|
25 |
+
dataset:
|
26 |
+
name: StellarMilk/newsqa
|
27 |
+
type: default
|
28 |
+
args: default
|
29 |
+
metrics:
|
30 |
+
- name: BLEU4 (Question & Answer Generation)
|
31 |
+
type: bleu4_question_answer_generation
|
32 |
+
value: 3.18
|
33 |
+
---
|
34 |
+
|
35 |
+
# Model Card of `StellarMilk/t5-base-newsqa-qag-trained`
|
36 |
+
This model is fine-tuned version of [t5-base](https://huggingface.co/t5-base) for question & answer pair generation task on the [StellarMilk/newsqa](https://huggingface.co/datasets/StellarMilk/newsqa) (dataset_name: default) via [`lmqg`](https://github.com/asahi417/lm-question-generation).
|
37 |
+
|
38 |
+
|
39 |
+
### Overview
|
40 |
+
- **Language model:** [t5-base](https://huggingface.co/t5-base)
|
41 |
+
- **Language:** en
|
42 |
+
- **Training data:** [StellarMilk/newsqa](https://huggingface.co/datasets/StellarMilk/newsqa) (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="en", model="StellarMilk/t5-base-newsqa-qag-trained")
|
54 |
+
|
55 |
+
# model prediction
|
56 |
+
question_answer_pairs = model.generate_qa("William Turner was an English painter who specialised in watercolour landscapes")
|
57 |
+
|
58 |
+
```
|
59 |
+
|
60 |
+
- With `transformers`
|
61 |
+
```python
|
62 |
+
from transformers import pipeline
|
63 |
+
|
64 |
+
pipe = pipeline("text2text-generation", "StellarMilk/t5-base-newsqa-qag-trained")
|
65 |
+
output = pipe("generate question and answer: Beyonce further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, Cadillac Records.")
|
66 |
+
|
67 |
+
```
|
68 |
+
|
69 |
+
## Evaluation
|
70 |
+
|
71 |
+
|
72 |
+
- ***Metric (Question & Answer Generation)***: [raw metric file](https://huggingface.co/StellarMilk/t5-base-newsqa-qag-trained/raw/main/eval/metric.first.answer.paragraph.questions_answers.StellarMilk_newsqa.default.json)
|
73 |
+
|
74 |
+
| Score | Type | Dataset |
|
75 |
+
|---------|--------|-----------|
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
## Training hyperparameters
|
80 |
+
|
81 |
+
The following hyperparameters were used during fine-tuning:
|
82 |
+
- dataset_path: StellarMilk/newsqa
|
83 |
+
- dataset_name: default
|
84 |
+
- input_types: ['paragraph']
|
85 |
+
- output_types: ['questions_answers']
|
86 |
+
- prefix_types: ['qag']
|
87 |
+
- model: t5-base
|
88 |
+
- max_length: 512
|
89 |
+
- max_length_output: 512
|
90 |
+
- epoch: 14
|
91 |
+
- batch: 2
|
92 |
+
- lr: 0.0001
|
93 |
+
- fp16: False
|
94 |
+
- random_seed: 1
|
95 |
+
- gradient_accumulation_steps: 2
|
96 |
+
- label_smoothing: 0.0
|
97 |
+
|
98 |
+
The full configuration can be found at [fine-tuning config file](https://huggingface.co/StellarMilk/t5-base-newsqa-qag-trained/raw/main/trainer_config.json).
|
99 |
+
|
100 |
+
## Citation
|
101 |
+
```
|
102 |
+
@inproceedings{ushio-etal-2022-generative,
|
103 |
+
title = "{G}enerative {L}anguage {M}odels for {P}aragraph-{L}evel {Q}uestion {G}eneration",
|
104 |
+
author = "Ushio, Asahi and
|
105 |
+
Alva-Manchego, Fernando and
|
106 |
+
Camacho-Collados, Jose",
|
107 |
+
booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
|
108 |
+
month = dec,
|
109 |
+
year = "2022",
|
110 |
+
address = "Abu Dhabi, U.A.E.",
|
111 |
+
publisher = "Association for Computational Linguistics",
|
112 |
+
}
|
113 |
+
|
114 |
+
```
|
eval/metric.first.answer.paragraph.questions_answers.StellarMilk_newsqa.default.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"validation": {"Bleu_1": 0.15702426818127532, "Bleu_2": 0.08949673140047287, "Bleu_3": 0.05081984253888556, "Bleu_4": 0.03349692010094845}, "test": {"Bleu_1": 0.1533027226689547, "Bleu_2": 0.08643644704818675, "Bleu_3": 0.04860676852739581, "Bleu_4": 0.031812096301029304}}
|
eval/samples.test.hyp.paragraph.questions_answers.StellarMilk_newsqa.default.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
eval/samples.validation.hyp.paragraph.questions_answers.StellarMilk_newsqa.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": "StellarMilk/newsqa", "dataset_name": "default", "input_types": ["paragraph"], "output_types": ["questions_answers"], "prefix_types": ["qag"], "model": "t5-base", "max_length": 512, "max_length_output": 512, "epoch": 14, "batch": 2, "lr": 0.0001, "fp16": false, "random_seed": 1, "gradient_accumulation_steps": 2, "label_smoothing": 0.0}
|