Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: mit
|
| 5 |
+
tags:
|
| 6 |
+
- finance
|
| 7 |
+
- custom-model
|
| 8 |
+
- pytorch
|
| 9 |
+
- conversational-qa
|
| 10 |
+
- financial-qa
|
| 11 |
+
datasets:
|
| 12 |
+
- conv_finqa
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# TinyRecursiveModel for ConvFinQA
|
| 16 |
+
|
| 17 |
+
## Model Details
|
| 18 |
+
|
| 19 |
+
### Model Description
|
| 20 |
+
|
| 21 |
+
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.
|
| 22 |
+
|
| 23 |
+
* **Developed by:** KenyaWashed
|
| 24 |
+
* **Model type:** Custom PyTorch Model (`TinyRecursiveModel`)
|
| 25 |
+
* **Language(s) (NLP):** English
|
| 26 |
+
* **License:** MIT
|
| 27 |
+
* **Finetuned from model / Base Tokenizer:** [Điền tên base tokenizer, ví dụ: `roberta-base` hoặc `ProsusAI/finbert`]
|
| 28 |
+
|
| 29 |
+
## Uses
|
| 30 |
+
|
| 31 |
+
### Direct Use
|
| 32 |
+
|
| 33 |
+
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.
|
| 34 |
+
|
| 35 |
+
### Out-of-Scope Use
|
| 36 |
+
|
| 37 |
+
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.
|
| 38 |
+
|
| 39 |
+
## How to Get Started with the Model
|
| 40 |
+
|
| 41 |
+
Since this model uses a custom `TinyRecursiveModel` architecture, you will need the original class definition in your codebase to load the weights properly.
|
| 42 |
+
|
| 43 |
+
Here is how you can load the tokenizer and the model weights:
|
| 44 |
+
|
| 45 |
+
```python
|
| 46 |
+
import torch
|
| 47 |
+
from transformers import AutoTokenizer
|
| 48 |
+
from huggingface_hub import hf_hub_download
|
| 49 |
+
# Nhớ import class TinyRecursiveModel từ source code của mày
|
| 50 |
+
# from your_custom_module import TinyRecursiveModel
|
| 51 |
+
|
| 52 |
+
repo_id = "KenyaWashed/trm-convfinqa"
|
| 53 |
+
|
| 54 |
+
# 1. Load Tokenizer
|
| 55 |
+
tokenizer = AutoTokenizer.from_pretrained(repo_id)
|
| 56 |
+
|
| 57 |
+
# 2. Khởi tạo model base (nhớ truyền đúng tham số lúc train)
|
| 58 |
+
model = TinyRecursiveModel(
|
| 59 |
+
# [Điền các tham số khởi tạo model của mày vào đây]
|
| 60 |
+
)
|
| 61 |
+
|
| 62 |
+
# 3. Download weights từ Hugging Face và load vào model
|
| 63 |
+
model_path = hf_hub_download(repo_id=repo_id, filename="pytorch_model.bin")
|
| 64 |
+
model.load_state_dict(torch.load(model_path, map_location="cpu"))
|
| 65 |
+
model.eval()
|
| 66 |
+
|
| 67 |
+
print("Model loaded successfully!")
|