Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FLAN-T5 for StrategyQA
|
| 2 |
+
This repository contains a fine-tuned version of the FLAN-T5 model for the StrategyQA dataset. The model is trained to perform multi-step reasoning and answer complex multi-choice questions, leveraging the knowledge stored in external resources.
|
| 3 |
+
|
| 4 |
+
Model Overview
|
| 5 |
+
FLAN-T5 (Fine-tuned Language Agnostic T5) is a variant of T5 (Text-to-Text Transfer Transformer) that has been fine-tuned on a wide variety of tasks to improve its ability to generalize across diverse NLP tasks.
|
| 6 |
+
|
| 7 |
+
StrategyQA Dataset
|
| 8 |
+
StrategyQA is a dataset designed for multi-step reasoning tasks, where each question requires a sequence of logical steps to arrive at the correct answer. It focuses on commonsense reasoning and question answering.
|
| 9 |
+
|
| 10 |
+
This model has been fine-tuned specifically to answer questions from the StrategyQA dataset by retrieving relevant knowledge and reasoning through it.
|
| 11 |
+
|
| 12 |
+
Model Description
|
| 13 |
+
This model was fine-tuned using the FLAN-T5 architecture on the StrategyQA dataset. The model is designed to answer multi-step reasoning questions by retrieving relevant documents and reasoning over them.
|
| 14 |
+
|
| 15 |
+
Base Model: FLAN-T5
|
| 16 |
+
Fine-tuned Dataset: StrategyQA
|
| 17 |
+
Task: Multi-step reasoning for question answering
|
| 18 |
+
Retriever Type: Dense retriever (using models like ColBERT or DPR for document retrieval)
|
| 19 |
+
Intended Use
|
| 20 |
+
This model is designed to be used for multi-step reasoning tasks and can be leveraged for a variety of question-answering tasks where the answer requires more than one step of reasoning. It's particularly useful for domains like commonsense reasoning, knowledge-intensive tasks, and complex decision-making questions.
|
| 21 |
+
|
| 22 |
+
How to Use
|
| 23 |
+
To use the model for inference, follow these steps:
|
| 24 |
+
|
| 25 |
+
Installation
|
| 26 |
+
To install the Hugging Face transformers library and use the model, run the following:
|
| 27 |
+
|
| 28 |
+
bash
|
| 29 |
+
Copy
|
| 30 |
+
pip install transformers
|
| 31 |
+
Example Code
|
| 32 |
+
You can use the model with the following Python code:
|
| 33 |
+
|
| 34 |
+
python
|
| 35 |
+
Copy
|
| 36 |
+
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 37 |
+
|
| 38 |
+
# Load the model and tokenizer
|
| 39 |
+
model_name = "Azaz666/flan-t5-strategyqa" # Replace with your model name if necessary
|
| 40 |
+
model = T5ForConditionalGeneration.from_pretrained(model_name)
|
| 41 |
+
tokenizer = T5Tokenizer.from_pretrained(model_name)
|
| 42 |
+
|
| 43 |
+
# Example question
|
| 44 |
+
question = "What is the capital of France?"
|
| 45 |
+
|
| 46 |
+
# Tokenize the input question
|
| 47 |
+
input_ids = tokenizer.encode("question: " + question, return_tensors="pt")
|
| 48 |
+
|
| 49 |
+
# Generate the answer
|
| 50 |
+
outputs = model.generate(input_ids)
|
| 51 |
+
answer = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 52 |
+
|
| 53 |
+
print(f"Answer: {answer}")
|
| 54 |
+
Model Input/Output
|
| 55 |
+
Input: The model expects a question in the format question: {your_question_here}.
|
| 56 |
+
Output: The output is a generated answer based on the reasoning over the retrieved knowledge.
|
| 57 |
+
Example
|
| 58 |
+
Input: "What is the capital of France?"
|
| 59 |
+
|
| 60 |
+
Output: "Paris"
|
| 61 |
+
|
| 62 |
+
Model Training Details
|
| 63 |
+
The model was fine-tuned using the StrategyQA dataset. Here's a brief overview of the training setup:
|
| 64 |
+
|
| 65 |
+
Pre-trained Model: flan-t5-large
|
| 66 |
+
Training Dataset: StrategyQA
|
| 67 |
+
Training Steps: The model was fine-tuned on the StrategyQA dataset, which contains questions requiring multiple reasoning steps.
|
| 68 |
+
Evaluation Metrics: The model performance was evaluated based on accuracy (whether the predicted answer matched the ground truth).
|
| 69 |
+
Limitations
|
| 70 |
+
Context Length: The model is limited by the input size, and longer questions or longer passages might be truncated.
|
| 71 |
+
Generalization: While fine-tuned for multi-step reasoning, performance may vary depending on the complexity of the question.
|
| 72 |
+
Citation
|
| 73 |
+
If you use this model or dataset, please cite the following paper:
|
| 74 |
+
|
| 75 |
+
StrategyQA: https://arxiv.org/abs/2004.06364
|
| 76 |
+
License
|
| 77 |
+
This model is licensed under the MIT License.
|