finipher commited on
Commit
7e7767d
·
verified ·
1 Parent(s): 73269ae
Files changed (5) hide show
  1. README.md +77 -0
  2. config.json +69 -0
  3. model.safetensors +3 -0
  4. tokenizer.json +0 -0
  5. tokenizer_config.json +24 -0
README.md ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ base_model: sentence-transformers/all-MiniLM-L6-v2
4
+ pipeline_tag: text-classification
5
+ language:
6
+ - en
7
+ tags:
8
+ - finance
9
+ - transactions
10
+ - text-classification
11
+ ---
12
+
13
+ # Finipher transaction classifier v1.0.0
14
+
15
+ Sorts one bank or card transaction line into one of 17 spending categories. It is a fine-tuned
16
+ `all-MiniLM-L6-v2` (`BertForSequenceClassification`), so it loads with the standard Transformers
17
+ classes and needs no custom code.
18
+
19
+ Internal checkpoint name: `finance-multitask-minilm-two-head-v2`. Finipher's manifest version:
20
+ `minilm-two-head-20261027-v2`.
21
+
22
+ ## Labels
23
+
24
+ Education, Entertainment, Fees, Groceries, Healthcare, Income, Insurance, Mortgage, Personal Care,
25
+ Rent, Restaurants, Shopping, Subscription, Transfer, Transportation, Travel, Utilities.
26
+
27
+ ## Input
28
+
29
+ - One line per transaction, prefixed with its direction: `[debit] STARBUCKS #1234 SEATTLE WA` or
30
+ `[credit] ACME CORP PAYROLL`.
31
+ - Maximum length 64 tokens.
32
+ - Below 0.50 confidence, don't trust the label.
33
+
34
+ ```python
35
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
36
+ import torch
37
+
38
+ repo = "finipher/finipher-transaction-classifier"
39
+ tok = AutoTokenizer.from_pretrained(repo, revision="v1.0.0")
40
+ model = AutoModelForSequenceClassification.from_pretrained(repo, revision="v1.0.0").eval()
41
+
42
+ x = tok(["[debit] NETFLIX.COM 866-579-7172 CA"], truncation=True, max_length=64, return_tensors="pt")
43
+ with torch.inference_mode():
44
+ p = torch.softmax(model(**x).logits, dim=-1)[0]
45
+ i = int(p.argmax())
46
+ print(model.config.id2label[i], float(p[i]))
47
+ ```
48
+
49
+ ## Results
50
+
51
+ Measured offline through Finipher's production code:
52
+ - 1,290 hand-written everyday vendor lines (Plaid names, card swipes, POS, ACH): 90.7% correct.
53
+ - DoDataThings 68k rows, final Finipher category: 98.7%.
54
+
55
+ ## Known mistakes
56
+
57
+ - Walmart paychecks (`[credit] WALMART DIR DEP PPD`) read as Shopping.
58
+ - FasTrak and Circle K card lines read as Groceries.
59
+ - Mortgage `PRINCIPAL PMT` reads as Utilities.
60
+
61
+ ## Training data
62
+
63
+ To be confirmed. This repo stays private until the training data and the rights to it are
64
+ documented.
65
+
66
+ ## Use
67
+
68
+ The output is a category label, not tax or financial advice.
69
+
70
+ ## Files and SHA-256
71
+
72
+ | File | SHA-256 |
73
+ |---|---|
74
+ | `config.json` | `6b8c456706017e7cbddd8a4826a88746294100336be5aa9e40f7730890f1b72b` |
75
+ | `model.safetensors` | `96d95c2520f9b8cee0a3e85e1440f541420c4c043e18a0c4579943e08e91a5a3` |
76
+ | `tokenizer.json` | `41b9d12a4c559e4098f30173bc0f76d092c43d7b1f873e7027da45a256f30f87` |
77
+ | `tokenizer_config.json` | `1128dd50ff3f913671a9405619c1bd8f9e9ddc28f62257cb94ed70683590b715` |
config.json ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_cross_attention": false,
3
+ "architectures": [
4
+ "BertForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": null,
8
+ "classifier_dropout": null,
9
+ "dtype": "float32",
10
+ "eos_token_id": null,
11
+ "gradient_checkpointing": false,
12
+ "hidden_act": "gelu",
13
+ "hidden_dropout_prob": 0.1,
14
+ "hidden_size": 384,
15
+ "id2label": {
16
+ "0": "Education",
17
+ "1": "Entertainment",
18
+ "2": "Fees",
19
+ "3": "Groceries",
20
+ "4": "Healthcare",
21
+ "5": "Income",
22
+ "6": "Insurance",
23
+ "7": "Mortgage",
24
+ "8": "Personal Care",
25
+ "9": "Rent",
26
+ "10": "Restaurants",
27
+ "11": "Shopping",
28
+ "12": "Subscription",
29
+ "13": "Transfer",
30
+ "14": "Transportation",
31
+ "15": "Travel",
32
+ "16": "Utilities"
33
+ },
34
+ "initializer_range": 0.02,
35
+ "intermediate_size": 1536,
36
+ "is_decoder": false,
37
+ "label2id": {
38
+ "Education": 0,
39
+ "Entertainment": 1,
40
+ "Fees": 2,
41
+ "Groceries": 3,
42
+ "Healthcare": 4,
43
+ "Income": 5,
44
+ "Insurance": 6,
45
+ "Mortgage": 7,
46
+ "Personal Care": 8,
47
+ "Rent": 9,
48
+ "Restaurants": 10,
49
+ "Shopping": 11,
50
+ "Subscription": 12,
51
+ "Transfer": 13,
52
+ "Transportation": 14,
53
+ "Travel": 15,
54
+ "Utilities": 16
55
+ },
56
+ "layer_norm_eps": 1e-12,
57
+ "max_position_embeddings": 512,
58
+ "model_type": "bert",
59
+ "num_attention_heads": 12,
60
+ "num_hidden_layers": 6,
61
+ "pad_token_id": 0,
62
+ "position_embedding_type": "absolute",
63
+ "problem_type": "single_label_classification",
64
+ "tie_word_embeddings": true,
65
+ "transformers_version": "5.19.0",
66
+ "type_vocab_size": 2,
67
+ "use_cache": true,
68
+ "vocab_size": 30522
69
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96d95c2520f9b8cee0a3e85e1440f541420c4c043e18a0c4579943e08e91a5a3
3
+ size 90891060
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "cls_token": "[CLS]",
4
+ "do_basic_tokenize": true,
5
+ "do_lower_case": true,
6
+ "is_local": true,
7
+ "local_files_only": true,
8
+ "mask_token": "[MASK]",
9
+ "max_length": 128,
10
+ "model_max_length": 512,
11
+ "never_split": null,
12
+ "pad_to_multiple_of": null,
13
+ "pad_token": "[PAD]",
14
+ "pad_token_type_id": 0,
15
+ "padding_side": "right",
16
+ "sep_token": "[SEP]",
17
+ "stride": 0,
18
+ "strip_accents": null,
19
+ "tokenize_chinese_chars": true,
20
+ "tokenizer_class": "BertTokenizer",
21
+ "truncation_side": "right",
22
+ "truncation_strategy": "longest_first",
23
+ "unk_token": "[UNK]"
24
+ }