Update README.md
Browse files
README.md
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- fr
|
4 |
+
widget:
|
5 |
+
- text: "generate question: Barack Hussein Obama, né le 4 aout 1961, est un homme politique américain et avocat. Il a été élu \<hl> en 2009 \<hl> pour devenir le 44ème président des Etats-Unis d'Amérique. <\s>"
|
6 |
+
- text: "question: Quand Barack Obama a t'il été élu président? context: Barack Hussein Obama, né le 4 aout 1961, est un homme politique américain et avocat. Il a été élu en 2009 pour devenir le 44ème président des Etats-Unis d'Amérique. </s>"
|
7 |
+
tags:
|
8 |
+
- pytorch
|
9 |
+
- t5
|
10 |
+
- question-generation
|
11 |
+
- seq2seq
|
12 |
+
license:
|
13 |
+
datasets:
|
14 |
+
- fquad
|
15 |
+
- piaf
|
16 |
+
---
|
17 |
+
|
18 |
+
# T5 Question Generation and Question Answering
|
19 |
+
|
20 |
+
## Model description
|
21 |
+
|
22 |
+
This model is a T5 Transformers model (airklizz/t5-base-multi-fr-wiki-news) that was fine-tuned in french on 3 different tasks:
|
23 |
+
- question generation
|
24 |
+
- question answering
|
25 |
+
- answer extraction
|
26 |
+
It obtains quite good results on FQuAD validation dataset.
|
27 |
+
|
28 |
+
## Intended uses & limitations
|
29 |
+
|
30 |
+
This model functions for the 3 tasks mentionned earlier and was not tested on other tasks.
|
31 |
+
|
32 |
+
#### How to use
|
33 |
+
|
34 |
+
input_text = "generate question: Barack Hussein Obama, né le 4 aout 1961, est un homme politique américain et avocat. Il a été élu \<hl> en 2009 \<hl> pour devenir le 44ème président des Etats-Unis d'Amérique."
|
35 |
+
|
36 |
+
output_text = "Quand Barack Hussein Obama a-t-il été élu président des États-Unis d'Amérique?"
|
37 |
+
|
38 |
+
```python
|
39 |
+
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
40 |
+
model = T5ForConditionalGeneration.from_pretrained("JDBN/t5-base-fr-qg-fquad")
|
41 |
+
tokenizer = T5Tokenizer.from_pretrained("JDBN/t5-base-fr-qg-fquad")
|
42 |
+
```
|
43 |
+
|
44 |
+
## Training data
|
45 |
+
|
46 |
+
The initial model used was https://huggingface.co/airKlizz/t5-base-multi-fr-wiki-news. This model was finetuned on a dataset composed of FQuAD and PIAF on the 3 tasks mentioned previously.
|
47 |
+
|
48 |
+
The data were preprocessed like this:
|
49 |
+
- question generation: "generate question: Barack Hussein Obama, né le 4 aout 1961, est un homme politique américain et avocat. Il a été élu \<hl> en 2009 \<hl> pour devenir le 44ème président des Etats-Unis d'Amérique."
|
50 |
+
- question answering: "question: Quand Barack Hussein Obamaa-t-il été élu président des Etats-Unis d’Amérique? context: Barack Hussein Obama, né le 4 aout 1961, est un homme politique américain et avocat. Il a été élu en 2009 pour devenir le 44ème président des Etats-Unis d’Amérique."
|
51 |
+
- answer extraction: "extract_answers: Barack Hussein Obama, né le 4 aout 1961, est un homme politique américain et avocat. \<hl> Il a été élu en 2009 pour devenir le 44ème président des Etats-Unis d’Amérique \<hl>."
|
52 |
+
|
53 |
+
The preprocessing we used was implemented in https://github.com/patil-suraj/question_generation
|
54 |
+
|
55 |
+
## Eval results
|
56 |
+
|
57 |
+
On FQuAD validation set:
|
58 |
+
| BLEU_1 | BLEU_2 | BLEU_3 | BLEU_4 | METEOR | ROUGE_L | CIDEr |
|
59 |
+
|--------|--------|--------|--------|--------|---------|-------|
|
60 |
+
| 0.290 | 0.203 | 0.149 | 0.111 | 0.197 | 0.284 | 1.038 |
|
61 |
+
|
62 |
+
Question Answering metrics:
|
63 |
+
For these metrics, the performance of this question answering model (https://huggingface.co/illuin/camembert-base-fquad) on FQuAD original question and on T5 generated questions are compared.
|
64 |
+
|
65 |
+
| Questions | Exact Match | F1 Score |
|
66 |
+
|------------------|--------|--------|
|
67 |
+
|Original FQuAD | 54.015 | 77.466 |
|
68 |
+
|Generated | 45.765 | 67.306 |
|
69 |
+
|
70 |
+
### BibTeX entry and citation info
|
71 |
+
|
72 |
+
```bibtex
|
73 |
+
@misc{githubPatil,
|
74 |
+
author = {Patil Suraj},
|
75 |
+
title = {question generation GitHub repository},
|
76 |
+
year = {2020},
|
77 |
+
howpublished={\url{https://github.com/patil-suraj/question_generation}}
|
78 |
+
}
|
79 |
+
|
80 |
+
@article{T5,
|
81 |
+
title={Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer},
|
82 |
+
author={Colin Raffel and Noam Shazeer and Adam Roberts and Katherine Lee and Sharan Narang and Michael Matena and Yanqi Zhou and Wei Li and Peter J. Liu},
|
83 |
+
year={2019},
|
84 |
+
eprint={1910.10683},
|
85 |
+
archivePrefix={arXiv},
|
86 |
+
primaryClass={cs.LG}
|
87 |
+
}
|
88 |
+
|
89 |
+
@misc{dhoffschmidt2020fquad,
|
90 |
+
title={FQuAD: French Question Answering Dataset},
|
91 |
+
author={Martin d'Hoffschmidt and Wacim Belblidia and Tom Brendlé and Quentin Heinrich and Maxime Vidal},
|
92 |
+
year={2020},
|
93 |
+
eprint={2002.06071},
|
94 |
+
archivePrefix={arXiv},
|
95 |
+
primaryClass={cs.CL}
|
96 |
+
}
|
97 |
+
```
|