π§Ύ Model Card: fint5-financeqa
π Overview
Model Name: fint5-financeqa Base Model: t5-small Domain: Financial Question Answering Fine-tuned by: [Your Name] Training Environment: Google Colab License: MIT (inherits from t5-small)
π Description
fint5-financeqa is a fine-tuned version of the t5-small model, tailored for financial question-answering tasks using the sweatSmile/FinanceQA dataset.
The model is capable of answering domain-specific questions when given both the question and relevant context. This makes it suitable for chatbot assistants, enterprise finance automation, or as a component in investment-related QA systems.
π¦ Intended Use
You can use this model to:
- Build finance-domain QA bots
- Help users query financial reports
- Perform automated FAQ answering for fintech tools
Not recommended for:
- General-purpose QA tasks (use base T5 instead)
- Time-sensitive financial forecasting or advice
- Legal or regulatory decision-making
π§ Training Details
| Detail | Value |
|---|---|
| Base Model | t5-small |
| Dataset | sweatSmile/FinanceQA |
| Dataset Size | 3705 total entries (80/20 split) |
| Preprocessing | QUERY + context: CONTEXT |
| Target Text | ANSWER string |
| Max Input Length | 512 tokens |
| Max Target Length | 128 tokens |
| Epochs | 3 |
| Batch Size | 4 |
| Optimizer & LR | AdamW @ 2e-5 |
| Mixed Precision | Enabled (fp16) |
| Evaluation Strategy | Per Epoch |
| Frameworks | π€ Transformers, Datasets, Accelerate |
π Metrics
| Metric | Value |
|---|---|
| Final Eval Loss | 0.415 |
| BLEU / ROUGE | [Not explicitly printed] |
| EM / Accuracy | [Can be added] |
Note: Evaluation beyond loss was mentioned but not shown. Future versions can include BLEU, ROUGE, or exact match scores using evaluate or sacrebleu.
π Training Curves
Loss chart from the training loop:
Replace with actual matplotlib plot or embed image if hosted.
π§ͺ Example Usage
python from transformers import T5Tokenizer, T5ForConditionalGeneration
model = T5ForConditionalGeneration.from_pretrained("./fint5-financeqa") tokenizer = T5Tokenizer.from_pretrained("./fint5-financeqa")
question = "What is the net income of the company?" context = "The company reported a net income of $1.5 million for the last quarter."
input_text = f"{question} context: {context}" input_ids = tokenizer(input_text, return_tensors="pt").input_ids
output = model.generate(input_ids) answer = tokenizer.decode(output[0], skip_special_tokens=True)
print("Answer:", answer)
π± Carbon Footprint (Optional)
Tracked using codecarbon:
| Metric | Value |
|---|---|
| Emissions (kg COβeq) | Reported via emissions.csv |
| Duration | ~[training time] |
| Hardware | Google Colab GPU |
π§ Future Improvements
- Include BLEU / ROUGE / EM scores for comprehensive evaluation
- Apply to other finance datasets (FinQA, Doc2Dial, etc.)
- Use larger base model (e.g., t5-base) for better performance
- Integrate LoRA/PEFT to optimize memory and speed
π Model Access
π Directory: ./fint5-financeqa β Includes:
- pytorch_model.bin
- config.json
- tokenizer_config.json
- spiece.model
You can upload this model to Hugging Face using transformers-cli or huggingface_hub.
- Downloads last month
- 45
Model tree for yakul259/fint5-financeqa-customised
Base model
google/flan-t5-small