File size: 2,570 Bytes
7e7767d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: other
base_model: sentence-transformers/all-MiniLM-L6-v2
pipeline_tag: text-classification
language:
  - en
tags:
  - finance
  - transactions
  - text-classification
---

# Finipher transaction classifier v1.0.0

Sorts one bank or card transaction line into one of 17 spending categories. It is a fine-tuned
`all-MiniLM-L6-v2` (`BertForSequenceClassification`), so it loads with the standard Transformers
classes and needs no custom code.

Internal checkpoint name: `finance-multitask-minilm-two-head-v2`. Finipher's manifest version:
`minilm-two-head-20261027-v2`.

## Labels

Education, Entertainment, Fees, Groceries, Healthcare, Income, Insurance, Mortgage, Personal Care,
Rent, Restaurants, Shopping, Subscription, Transfer, Transportation, Travel, Utilities.

## Input

- One line per transaction, prefixed with its direction: `[debit] STARBUCKS #1234 SEATTLE WA` or
  `[credit] ACME CORP PAYROLL`.
- Maximum length 64 tokens.
- Below 0.50 confidence, don't trust the label.

```python
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch

repo = "finipher/finipher-transaction-classifier"
tok = AutoTokenizer.from_pretrained(repo, revision="v1.0.0")
model = AutoModelForSequenceClassification.from_pretrained(repo, revision="v1.0.0").eval()

x = tok(["[debit] NETFLIX.COM 866-579-7172 CA"], truncation=True, max_length=64, return_tensors="pt")
with torch.inference_mode():
    p = torch.softmax(model(**x).logits, dim=-1)[0]
i = int(p.argmax())
print(model.config.id2label[i], float(p[i]))
```

## Results

Measured offline through Finipher's production code:
- 1,290 hand-written everyday vendor lines (Plaid names, card swipes, POS, ACH): 90.7% correct.
- DoDataThings 68k rows, final Finipher category: 98.7%.

## Known mistakes

- Walmart paychecks (`[credit] WALMART DIR DEP PPD`) read as Shopping.
- FasTrak and Circle K card lines read as Groceries.
- Mortgage `PRINCIPAL PMT` reads as Utilities.

## Training data

To be confirmed. This repo stays private until the training data and the rights to it are
documented.

## Use

The output is a category label, not tax or financial advice.

## Files and SHA-256

| File | SHA-256 |
|---|---|
| `config.json` | `6b8c456706017e7cbddd8a4826a88746294100336be5aa9e40f7730890f1b72b` |
| `model.safetensors` | `96d95c2520f9b8cee0a3e85e1440f541420c4c043e18a0c4579943e08e91a5a3` |
| `tokenizer.json` | `41b9d12a4c559e4098f30173bc0f76d092c43d7b1f873e7027da45a256f30f87` |
| `tokenizer_config.json` | `1128dd50ff3f913671a9405619c1bd8f9e9ddc28f62257cb94ed70683590b715` |