File size: 4,336 Bytes
59e50bc
 
 
 
344f541
 
 
59e50bc
 
 
 
 
 
 
 
 
 
344f541
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59e50bc
 
344f541
59e50bc
 
344f541
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0386398
 
 
 
344f541
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59e50bc
344f541
59e50bc
344f541
 
 
 
59e50bc
344f541
59e50bc
344f541
 
 
 
59e50bc
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
license: apache-2.0
pipeline_tag: sentence-similarity
library_name: sentence-transformers
base_model: BAAI/bge-small-en-v1.5
datasets:
  - gyaanbyte/coa-mapping-synthetic
language:
  - en
tags:
  - finance
  - accounting
  - chart-of-accounts
  - data-migration
  - quickbooks
  - sage
  - retrieval
  - sentence-transformers
model-index:
  - name: coa-mapper
    results:
      - task:
          type: sentence-similarity
          name: Chart-of-accounts mapping (retrieval)
        dataset:
          name: COA-Map-Bench v1 (gyaanbyte/coa-mapping-synthetic, test)
          type: gyaanbyte/coa-mapping-synthetic
          split: test
        metrics:
          - type: accuracy
            name: acc@1
            value: 0.8832
          - type: accuracy
            name: acc@5
            value: 0.9635
          - type: mrr
            name: MRR
            value: 0.9239
---

# COA Mapper v1

The first open model for **chart-of-accounts mapping**: given a ledger account
from QuickBooks Desktop or Sage 50 (name + type), retrieve the correct target
account in the client's new QuickBooks Online chart of accounts.

A 33M-parameter embedding model (`BAAI/bge-small-en-v1.5`, fine-tuned) β€”
small enough to run on CPU, in a browser, or inside a migration tool.

## Results β€” COA-Map-Bench v1

Test split of [`gyaanbyte/coa-mapping-synthetic`](https://huggingface.co/datasets/gyaanbyte/coa-mapping-synthetic):
137 mappings from 4 held-out companies (2 QuickBooks Desktop, 2 Sage 50) never
seen in training. Candidates = the distinct target accounts of the same company
(i.e. mapping into the client's new QBO COA). A top-1 hit implies the correct
QBO type *and* detail type.

| Method | acc@1 | acc@5 | MRR |
|---|---|---|---|
| TF-IDF (char 2–4-grams, cosine) | 0.745 | 0.949 | 0.824 |
| `bge-small-en-v1.5` zero-shot | 0.796 | 0.956 | 0.868 |
| qwen3:8b zero-shot (picks from the candidate list) | 0.788 | β€” | β€” |
| **coa-mapper v1 (this model)** | **0.883** | **0.964** | **0.924** |

Read the numbers honestly: the benchmark is synthetic, and account names carry
strong lexical signal (TF-IDF already gets 74.5%). The fine-tune's gain lives in
the hard 25% β€” abbreviations, near-duplicates to consolidate, dumping-ground
splits, type/detail-type disambiguation. An adjudicated benchmark subset is
planned for v1.1.

## Try it

πŸ§ͺ **[Live demo](https://huggingface.co/spaces/gyaanbyte/coa-mapper-demo)** β€” runs in your browser via Transformers.js (int8 ONNX included in this repo under `onnx/`; nothing is uploaded).

## Usage

```python
from sentence_transformers import SentenceTransformer
m = SentenceTransformer("gyaanbyte/coa-mapper")

# Source accounts as "name (type) [system]"; targets as "name β€” type / detail type"
src = ["Accum Depr - Equipment (fixed asset) [quickbooks desktop]"]
targets = [
    "Accumulated Depreciation β€” Fixed Assets / Accumulated Depreciation",
    "Equipment β€” Fixed Assets / Machinery & Equipment",
    "Depreciation Expense β€” Other Expense / Depreciation",
]
S = m.encode(src, normalize_embeddings=True)
T = m.encode(targets, normalize_embeddings=True)
print(targets[(S @ T.T).argmax()])
```

In production we use it as **retrieval β†’ LLM re-rank of the top-5 β†’ confidence
threshold β†’ human review lane**: the goal is hours saved per migration at $0
reconciliation variance, not unattended automation.

## Training

- Base: `BAAI/bge-small-en-v1.5` Β· loss: MultipleNegativesRankingLoss (in-batch negatives)
- Data: 1,025 (source β†’ target) pairs, train split of the dataset above
- 4 epochs, batch 32, lr 3e-5, fp16 β€” **12 seconds on one RTX 5060 laptop GPU**
- Training/eval code: [`coa_train.py`](https://github.com/Divyanshujangra/gyaanbyte-infra) (open)

## Limitations

- Trained and evaluated on synthetic data; real ledgers are messier and more idiosyncratic
- Target side is QuickBooks Online only; sources are QuickBooks Desktop and Sage 50
- English, US-GAAP-oriented account structures
- Candidate pool must be supplied (the target COA); this model does not invent accounts

## Who's building this

[GyaanByte Labs](https://www.gyaanbytelabs.com) β€” accounting data-migration
specialists (6+ production migrations, 200,000+ records, $0 variance). The
mapper is the engine behind our migration service; the reusable parts are
published openly.