From 82ce8488bbccaf7eadc1b659151c52c0b66d4b27 Mon Sep 17 00:00:00 2001 From: Suraj Patil Date: Thu, 9 Jul 2020 01:38:56 +0530 Subject: [PATCH] create model cards for qg models (#5610) --- model_cards/valhalla/t5-base-e2e-qg/README.md | 38 ++++++++++++++ .../valhalla/t5-base-qa-qg-hl/README.md | 50 +++++++++++++++++++ model_cards/valhalla/t5-base-qg-hl/README.md | 33 ++++++++++++ .../valhalla/t5-samll-qg-prepend/README.md | 36 +++++++++++++ .../valhalla/t5-small-e2e-qg/README.md | 38 ++++++++++++++ .../valhalla/t5-small-qa-qg-hl/README.md | 49 ++++++++++++++++++ model_cards/valhalla/t5-small-qg-hl/README.md | 33 ++++++++++++ 7 files changed, 277 insertions(+) create mode 100644 model_cards/valhalla/t5-base-e2e-qg/README.md create mode 100644 model_cards/valhalla/t5-base-qa-qg-hl/README.md create mode 100644 model_cards/valhalla/t5-base-qg-hl/README.md create mode 100644 model_cards/valhalla/t5-samll-qg-prepend/README.md create mode 100644 model_cards/valhalla/t5-small-e2e-qg/README.md create mode 100644 model_cards/valhalla/t5-small-qa-qg-hl/README.md create mode 100644 model_cards/valhalla/t5-small-qg-hl/README.md diff --git a/model_cards/valhalla/t5-base-e2e-qg/README.md b/model_cards/valhalla/t5-base-e2e-qg/README.md new file mode 100644 index 0000000000..be97a8ba29 --- /dev/null +++ b/model_cards/valhalla/t5-base-e2e-qg/README.md @@ -0,0 +1,38 @@ +--- +datasets: +- squad +tags: +- question-generation +widget: +- text: "Python is a programming language. It is developed by Guido Van Rossum and released in 1991. " +license: "MIT" +--- + +## T5 for question-generation +This is [t5-base](https://arxiv.org/abs/1910.10683) model trained for end-to-end question generation task. Simply input the text and the model will generate multile questions. + +You can play with the model using the inference API, just put the text and see the results! + +For more deatils see [this](https://github.com/patil-suraj/question_generation) repo. + +### Model in action 🚀 + +You'll need to clone the [repo](https://github.com/patil-suraj/question_generation). + +[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb) + +```python3 +from pipelines import pipeline + +text = "Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum \ +and first released in 1991, Python's design philosophy emphasizes code \ +readability with its notable use of significant whitespace." + +nlp = pipeline("e2e-qg", model="valhalla/t5-base-e2e-qg") +nlp(text) +=> [ + 'Who created Python?', + 'When was Python first released?', + "What is Python's design philosophy?" +] +``` \ No newline at end of file diff --git a/model_cards/valhalla/t5-base-qa-qg-hl/README.md b/model_cards/valhalla/t5-base-qa-qg-hl/README.md new file mode 100644 index 0000000000..ae0e3fbe5b --- /dev/null +++ b/model_cards/valhalla/t5-base-qa-qg-hl/README.md @@ -0,0 +1,50 @@ +--- +datasets: +- squad +tags: +- question-generation +widget: +- text: "generate question: 42 is the answer to life, the universe and everything. " +- text: "question: What is 42 context: 42 is the answer to life, the universe and everything. " +license: "MIT" +--- + +## T5 for multi-task QA and QG +This is multi-task [t5-base](https://arxiv.org/abs/1910.10683) model trained for question answering and answer aware question generation tasks. + +For question generation the answer spans are highlighted within the text with special highlight tokens (``) and prefixed with 'generate question: '. For QA the input is processed like this `question: question_text context: context_text ` + +You can play with the model using the inference API. Here's how you can use it + +For QG + +`generate question: 42 is the answer to life, the universe and everything. ` + +For QA + +`question: What is 42 context: 42 is the answer to life, the universe and everything. ` + +For more deatils see [this](https://github.com/patil-suraj/question_generation) repo. + + +### Model in action 🚀 + +You'll need to clone the [repo](https://github.com/patil-suraj/question_generation). + +[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb) + +```python3 +from pipelines import pipeline +nlp = pipeline("multitask-qa-qg", model="valhalla/t5-base-qa-qg-hl") + +# to generate questions simply pass the text +nlp("42 is the answer to life, the universe and everything.") +=> [{'answer': '42', 'question': 'What is the answer to life, the universe and everything?'}] + +# for qa pass a dict with "question" and "context" +nlp({ + "question": "What is 42 ?", + "context": "42 is the answer to life, the universe and everything." +}) +=> 'the answer to life, the universe and everything' +``` \ No newline at end of file diff --git a/model_cards/valhalla/t5-base-qg-hl/README.md b/model_cards/valhalla/t5-base-qg-hl/README.md new file mode 100644 index 0000000000..ac7283f652 --- /dev/null +++ b/model_cards/valhalla/t5-base-qg-hl/README.md @@ -0,0 +1,33 @@ +--- +datasets: +- squad +tags: +- question-generation +widget: +- text: " 42 is the answer to life, the universe and everything. " +- text: "Python is a programming language. It is developed by Guido Van Rossum . " +- text: "Although practicality beats purity " +license: "MIT" +--- + +## T5 for question-generation +This is [t5-base](https://arxiv.org/abs/1910.10683) model trained for answer aware question generation task. The answer spans are highlighted within the text with special highlight tokens. + +You can play with the model using the inference API, just highlight the answer spans with `` tokens and end the text with ``. For example + +` 42 is the answer to life, the universe and everything. ` + +For more deatils see [this](https://github.com/patil-suraj/question_generation) repo. + +### Model in action 🚀 + +You'll need to clone the [repo](https://github.com/patil-suraj/question_generation). + +[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb) + +```python3 +from pipelines import pipeline +nlp = pipeline("question-generation", model="valhalla/t5-base-qg-hl") +nlp("42 is the answer to life, universe and everything.") +=> [{'answer': '42', 'question': 'What is the answer to life, universe and everything?'}] +``` \ No newline at end of file diff --git a/model_cards/valhalla/t5-samll-qg-prepend/README.md b/model_cards/valhalla/t5-samll-qg-prepend/README.md new file mode 100644 index 0000000000..5fff240106 --- /dev/null +++ b/model_cards/valhalla/t5-samll-qg-prepend/README.md @@ -0,0 +1,36 @@ +--- +datasets: +- squad +tags: +- question-generation +widget: +- text: "answer: 42 context: 42 is the answer to life, the universe and everything. " +- text: "answer: Guido Van Rossum context: Python is a programming language. It is developed by Guido Van Rossum. " +- text: "answer: Explicit context: Explicit is better than implicit " +license: "MIT" +--- + +## T5 for question-generation +This is [t5-small](https://arxiv.org/abs/1910.10683) model trained for answer aware question generation task. The answer text is prepended before the context text. + +You can play with the model using the inference API, just get the input text in this format and see the results! +`answer: answer_text context: context_text ` + +For example + +`answer: 42 context: 42 is the answer to life, the universe and everything. ` + +For more deatils see [this](https://github.com/patil-suraj/question_generation) repo. + +### Model in action 🚀 + +You'll need to clone the [repo](https://github.com/patil-suraj/question_generation). + +[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb) + +```python3 +from pipelines import pipeline +nlp = pipeline("question-generation", qg_format="prepend") +nlp("42 is the answer to life, universe and everything.") +=> [{'answer': '42', 'question': 'What is the answer to life, universe and everything?'}] +``` \ No newline at end of file diff --git a/model_cards/valhalla/t5-small-e2e-qg/README.md b/model_cards/valhalla/t5-small-e2e-qg/README.md new file mode 100644 index 0000000000..52180369dc --- /dev/null +++ b/model_cards/valhalla/t5-small-e2e-qg/README.md @@ -0,0 +1,38 @@ +--- +datasets: +- squad +tags: +- question-generation +widget: +- text: "Python is developed by Guido Van Rossum and released in 1991. " +license: "MIT" +--- + +## T5 for question-generation +This is [t5-small](https://arxiv.org/abs/1910.10683) model trained for end-to-end question generation task. Simply input the text and the model will generate multile questions. + +You can play with the model using the inference API, just put the text and see the results! + +For more deatils see [this](https://github.com/patil-suraj/question_generation) repo. + +### Model in action 🚀 + +You'll need to clone the [repo](https://github.com/patil-suraj/question_generation). + +[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb) + +```python3 +from pipelines import pipeline + +text = "Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum \ +and first released in 1991, Python's design philosophy emphasizes code \ +readability with its notable use of significant whitespace." + +nlp = pipeline("e2e-qg") +nlp(text) +=> [ + 'Who created Python?', + 'When was Python first released?', + "What is Python's design philosophy?" +] +``` \ No newline at end of file diff --git a/model_cards/valhalla/t5-small-qa-qg-hl/README.md b/model_cards/valhalla/t5-small-qa-qg-hl/README.md new file mode 100644 index 0000000000..68c33e0599 --- /dev/null +++ b/model_cards/valhalla/t5-small-qa-qg-hl/README.md @@ -0,0 +1,49 @@ +--- +datasets: +- squad +tags: +- question-generation +widget: +- text: "generate question: 42 is the answer to life, the universe and everything. " +- text: "question: What is 42 context: 42 is the answer to life, the universe and everything. " +license: "MIT" +--- + +## T5 for multi-task QA and QG +This is multi-task [t5-small](https://arxiv.org/abs/1910.10683) model trained for question answering and answer aware question generation tasks. + +For question generation the answer spans are highlighted within the text with special highlight tokens (``) and prefixed with 'generate question: '. For QA the input is processed like this `question: question_text context: context_text ` + +You can play with the model using the inference API. Here's how you can use it + +For QG + +`generate question: 42 is the answer to life, the universe and everything. ` + +For QA + +`question: What is 42 context: 42 is the answer to life, the universe and everything. ` + +For more deatils see [this](https://github.com/patil-suraj/question_generation) repo. + +### Model in action 🚀 + +You'll need to clone the [repo](https://github.com/patil-suraj/question_generation). + +[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb) + +```python3 +from pipelines import pipeline +nlp = pipeline("multitask-qa-qg") + +# to generate questions simply pass the text +nlp("42 is the answer to life, the universe and everything.") +=> [{'answer': '42', 'question': 'What is the answer to life, the universe and everything?'}] + +# for qa pass a dict with "question" and "context" +nlp({ + "question": "What is 42 ?", + "context": "42 is the answer to life, the universe and everything." +}) +=> 'the answer to life, the universe and everything' +``` \ No newline at end of file diff --git a/model_cards/valhalla/t5-small-qg-hl/README.md b/model_cards/valhalla/t5-small-qg-hl/README.md new file mode 100644 index 0000000000..5c1f0dffab --- /dev/null +++ b/model_cards/valhalla/t5-small-qg-hl/README.md @@ -0,0 +1,33 @@ +--- +datasets: +- squad +tags: +- question-generation +widget: +- text: " 42 is the answer to life, the universe and everything. " +- text: "Python is a programming language. It is developed by Guido Van Rossum . " +- text: "Simple is better than complex . " +license: "MIT" +--- + +## T5 for question-generation +This is [t5-small](https://arxiv.org/abs/1910.10683) model trained for answer aware question generation task. The answer spans are highlighted within the text with special highlight tokens. + +You can play with the model using the inference API, just highlight the answer spans with `` tokens and end the text with ``. For example + +` 42 is the answer to life, the universe and everything. ` + +For more deatils see [this](https://github.com/patil-suraj/question_generation) repo. + +### Model in action 🚀 + +You'll need to clone the [repo](https://github.com/patil-suraj/question_generation). + +[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb) + +```python3 +from pipelines import pipeline +nlp = pipeline("question-generation") +nlp("42 is the answer to life, universe and everything.") +=> [{'answer': '42', 'question': 'What is the answer to life, universe and everything?'}] +``` \ No newline at end of file