| --- |
| language: |
| - en |
| license: mit |
| tags: |
| - finance |
| - custom-model |
| - pytorch |
| - conversational-qa |
| - financial-qa |
| datasets: |
| - conv_finqa |
| --- |
| |
| # TinyRecursiveModel for ConvFinQA |
|
|
| ## Model Details |
|
|
| ### Model Description |
|
|
| This model is a custom **TinyRecursiveModel (TRM)** fine-tuned specifically for the **ConvFinQA** dataset. It is designed to handle conversational question answering over complex financial documents, earnings reports, and tables. |
|
|
| * **Developed by:** KenyaWashed |
| * **Model type:** Custom PyTorch Model (`TinyRecursiveModel`) |
| * **Language(s) (NLP):** English |
| * **License:** MIT |
| * **Finetuned from model / Base Tokenizer:** [Điền tên base tokenizer, ví dụ: `roberta-base` hoặc `ProsusAI/finbert`] |
|
|
| ## Uses |
|
|
| ### Direct Use |
|
|
| The model is built for researchers and developers working in Financial NLP. It can be used to extract answers and perform hierarchical reasoning over financial texts and tables in a conversational context. |
|
|
| ### Out-of-Scope Use |
|
|
| This model is not intended to provide professional financial advice or real-time trading signals. It is a research artifact focused on natural language processing and reasoning. |
|
|
| ## How to Get Started with the Model |
|
|
| Since this model uses a custom `TinyRecursiveModel` architecture, you will need the original class definition in your codebase to load the weights properly. |
|
|
| Here is how you can load the tokenizer and the model weights: |
|
|
| ```python |
| import torch |
| from transformers import AutoTokenizer |
| from huggingface_hub import hf_hub_download |
| # Nhớ import class TinyRecursiveModel từ source code của mày |
| # from your_custom_module import TinyRecursiveModel |
| |
| repo_id = "KenyaWashed/trm-convfinqa" |
| |
| # 1. Load Tokenizer |
| tokenizer = AutoTokenizer.from_pretrained(repo_id) |
| |
| # 2. Khởi tạo model base (nhớ truyền đúng tham số lúc train) |
| model = TinyRecursiveModel( |
| # [Điền các tham số khởi tạo model của mày vào đây] |
| ) |
| |
| # 3. Download weights từ Hugging Face và load vào model |
| model_path = hf_hub_download(repo_id=repo_id, filename="pytorch_model.bin") |
| model.load_state_dict(torch.load(model_path, map_location="cpu")) |
| model.eval() |
| |
| print("Model loaded successfully!") |