Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,69 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
tags:
|
| 5 |
+
- question-answering
|
| 6 |
+
- t5
|
| 7 |
+
- compact-model
|
| 8 |
+
- sgarbi
|
| 9 |
+
license: apache-2.0
|
| 10 |
+
datasets:
|
| 11 |
+
- squad2
|
| 12 |
+
- quac
|
| 13 |
+
- nq
|
| 14 |
---
|
| 15 |
+
|
| 16 |
+
# Model Card for sgarbi/t5-compact-qa-gen
|
| 17 |
+
|
| 18 |
+
## Model Description
|
| 19 |
+
`sgarbi/t5-compact-qa-gen` is a compact T5-based model designed to generate question and answer pairs from a given text. This model has been trained with a focus on efficiency and speed, making it suitable for deployment on devices with limited computational resources, including CPUs. It utilizes a novel data formatting approach for training, which simplifies the parsing process and enhances the model's performance.
|
| 20 |
+
|
| 21 |
+
## Intended Use
|
| 22 |
+
This model is intended for a wide range of question-answering tasks, including but not limited to:
|
| 23 |
+
- Generating study materials from educational texts.
|
| 24 |
+
- Enhancing search engines with precise Q&A capabilities.
|
| 25 |
+
- Supporting content creators in generating FAQs.
|
| 26 |
+
- Deploying on edge devices for real-time question answering in various applications.
|
| 27 |
+
|
| 28 |
+
## How to Use
|
| 29 |
+
Here is a simple way to use this model with the Transformers library:
|
| 30 |
+
|
| 31 |
+
```python
|
| 32 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
| 33 |
+
|
| 34 |
+
tokenizer = AutoTokenizer.from_pretrained("sgarbi/t5-compact-qa-gen")
|
| 35 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("sgarbi/t5-compact-qa-gen")
|
| 36 |
+
|
| 37 |
+
text = "INPUT: <qa_builder_context>Your context here."
|
| 38 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 39 |
+
output = model.generate(inputs["input_ids"])
|
| 40 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Training Data
|
| 44 |
+
The model was trained on the following datasets:
|
| 45 |
+
|
| 46 |
+
SQuAD 2.0: A large collection of question and answer pairs based on Wikipedia articles.
|
| 47 |
+
QuAC: Question Answering in Context, a dataset for modeling, understanding, and participating in information-seeking dialogues.
|
| 48 |
+
Natural Questions (NQ): A dataset containing real user questions sourced from Google search.
|
| 49 |
+
Training Procedure
|
| 50 |
+
The model was trained using a novel input and output formatting technique, focusing on generating "shallow" training data for efficient model training. The model's architecture, flan-T5-small, was selected for its balance between performance and computational efficiency. Training involved fine-tuning the model on the specified datasets, utilizing a custom XML-like format for simplifying the data structure.
|
| 51 |
+
|
| 52 |
+
## Evaluation Results
|
| 53 |
+
(Include any evaluation metrics and results here to showcase the model's performance on various benchmarks or tasks.)
|
| 54 |
+
|
| 55 |
+
## Limitations and Bias
|
| 56 |
+
(Describe any limitations of the model, including potential biases in the training data and areas where the model's performance may be suboptimal.)
|
| 57 |
+
|
| 58 |
+
## Ethical Considerations
|
| 59 |
+
(Provide guidance on ethical considerations for users of the model, including appropriate and inappropriate uses.)
|
| 60 |
+
|
| 61 |
+
## Citation
|
| 62 |
+
|
| 63 |
+
@misc{sgarbi_t5_compact_qa_gen,
|
| 64 |
+
author = {Erick Sgarbi},
|
| 65 |
+
title = {T5 Compact QA Generator},
|
| 66 |
+
year = {2024},
|
| 67 |
+
publisher = {Hugging Face},
|
| 68 |
+
journal = {Hugging Face Model Hub}
|
| 69 |
+
}
|