fp32 fusion head for triple autofill
Browse files- README.md +7 -0
- config.json +157 -0
- onnx/model.onnx +3 -0
README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# form-autofill-head
|
| 2 |
+
|
| 3 |
+
Fusion head (fp32) for the Firefox triple-encoder autofill field classifier.
|
| 4 |
+
|
| 5 |
+
- **Input** `fused`: float32 `[batch, 1920]` = concat[e_cur, e_prev, e_next, e_cur-e_prev, e_cur-e_next] (each 384-d, from `rolf-mozilla/form-autofill-embed`).
|
| 6 |
+
- **Graph**: Linear(1920->384) -> GELU(erf) -> Linear(384->66).
|
| 7 |
+
- **Output** `logits`: `[batch, 66]` over autofill field types (see `config.json` `id2label`).
|
config.json
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"BertModel"
|
| 4 |
+
],
|
| 5 |
+
"model_type": "bert",
|
| 6 |
+
"hidden_size": 384,
|
| 7 |
+
"num_hidden_layers": 1,
|
| 8 |
+
"num_attention_heads": 1,
|
| 9 |
+
"intermediate_size": 384,
|
| 10 |
+
"vocab_size": 2,
|
| 11 |
+
"max_position_embeddings": 2,
|
| 12 |
+
"type_vocab_size": 1,
|
| 13 |
+
"num_labels": 66,
|
| 14 |
+
"id2label": {
|
| 15 |
+
"1": "other",
|
| 16 |
+
"2": "given-name",
|
| 17 |
+
"3": "family-name",
|
| 18 |
+
"4": "name",
|
| 19 |
+
"5": "additional-name",
|
| 20 |
+
"6": "phonetic-given-name",
|
| 21 |
+
"7": "phonetic-family-name",
|
| 22 |
+
"8": "phonetic-name",
|
| 23 |
+
"9": "honorific-prefix",
|
| 24 |
+
"10": "honorific-suffix",
|
| 25 |
+
"11": "nickname",
|
| 26 |
+
"12": "street-address",
|
| 27 |
+
"13": "address-lookup",
|
| 28 |
+
"14": "address-line1",
|
| 29 |
+
"15": "address-line2",
|
| 30 |
+
"16": "address-line3",
|
| 31 |
+
"17": "address-level1",
|
| 32 |
+
"18": "address-level2",
|
| 33 |
+
"19": "address-level3",
|
| 34 |
+
"20": "address-level4",
|
| 35 |
+
"21": "street",
|
| 36 |
+
"22": "address-streetname",
|
| 37 |
+
"23": "address-housenumber",
|
| 38 |
+
"24": "address-extra-housesuffix",
|
| 39 |
+
"25": "postal-code",
|
| 40 |
+
"26": "postal-code-lookup",
|
| 41 |
+
"27": "postal-code-and-city",
|
| 42 |
+
"28": "postal-code-or-suburb",
|
| 43 |
+
"29": "country",
|
| 44 |
+
"30": "country-name",
|
| 45 |
+
"31": "tel",
|
| 46 |
+
"32": "tel-country-code",
|
| 47 |
+
"33": "tel-national",
|
| 48 |
+
"34": "tel-area-code",
|
| 49 |
+
"35": "tel-local",
|
| 50 |
+
"36": "tel-local-prefix",
|
| 51 |
+
"37": "tel-local-suffix",
|
| 52 |
+
"38": "tel-extension",
|
| 53 |
+
"39": "organization",
|
| 54 |
+
"40": "organization-title",
|
| 55 |
+
"41": "bday",
|
| 56 |
+
"42": "bday-day",
|
| 57 |
+
"43": "bday-month",
|
| 58 |
+
"44": "bday-year",
|
| 59 |
+
"45": "email",
|
| 60 |
+
"46": "apartment",
|
| 61 |
+
"47": "floor",
|
| 62 |
+
"48": "stair",
|
| 63 |
+
"49": "building",
|
| 64 |
+
"50": "block",
|
| 65 |
+
"51": "address-extra",
|
| 66 |
+
"52": "cc-name",
|
| 67 |
+
"53": "cc-given-name",
|
| 68 |
+
"54": "cc-additional-name",
|
| 69 |
+
"55": "cc-family-name",
|
| 70 |
+
"56": "cc-number",
|
| 71 |
+
"57": "cc-exp",
|
| 72 |
+
"58": "cc-exp-month",
|
| 73 |
+
"59": "cc-exp-year",
|
| 74 |
+
"60": "cc-csc",
|
| 75 |
+
"61": "cc-type",
|
| 76 |
+
"62": "sex",
|
| 77 |
+
"63": "id-number",
|
| 78 |
+
"64": "vat-number",
|
| 79 |
+
"65": "reference-point",
|
| 80 |
+
"66": "loginname"
|
| 81 |
+
},
|
| 82 |
+
"label2id": {
|
| 83 |
+
"other": 1,
|
| 84 |
+
"given-name": 2,
|
| 85 |
+
"family-name": 3,
|
| 86 |
+
"name": 4,
|
| 87 |
+
"additional-name": 5,
|
| 88 |
+
"phonetic-given-name": 6,
|
| 89 |
+
"phonetic-family-name": 7,
|
| 90 |
+
"phonetic-name": 8,
|
| 91 |
+
"honorific-prefix": 9,
|
| 92 |
+
"honorific-suffix": 10,
|
| 93 |
+
"nickname": 11,
|
| 94 |
+
"street-address": 12,
|
| 95 |
+
"address-lookup": 13,
|
| 96 |
+
"address-line1": 14,
|
| 97 |
+
"address-line2": 15,
|
| 98 |
+
"address-line3": 16,
|
| 99 |
+
"address-level1": 17,
|
| 100 |
+
"address-level2": 18,
|
| 101 |
+
"address-level3": 19,
|
| 102 |
+
"address-level4": 20,
|
| 103 |
+
"street": 21,
|
| 104 |
+
"address-streetname": 22,
|
| 105 |
+
"address-housenumber": 23,
|
| 106 |
+
"address-extra-housesuffix": 24,
|
| 107 |
+
"postal-code": 25,
|
| 108 |
+
"postal-code-lookup": 26,
|
| 109 |
+
"postal-code-and-city": 27,
|
| 110 |
+
"postal-code-or-suburb": 28,
|
| 111 |
+
"country": 29,
|
| 112 |
+
"country-name": 30,
|
| 113 |
+
"tel": 31,
|
| 114 |
+
"tel-country-code": 32,
|
| 115 |
+
"tel-national": 33,
|
| 116 |
+
"tel-area-code": 34,
|
| 117 |
+
"tel-local": 35,
|
| 118 |
+
"tel-local-prefix": 36,
|
| 119 |
+
"tel-local-suffix": 37,
|
| 120 |
+
"tel-extension": 38,
|
| 121 |
+
"organization": 39,
|
| 122 |
+
"organization-title": 40,
|
| 123 |
+
"bday": 41,
|
| 124 |
+
"bday-day": 42,
|
| 125 |
+
"bday-month": 43,
|
| 126 |
+
"bday-year": 44,
|
| 127 |
+
"email": 45,
|
| 128 |
+
"apartment": 46,
|
| 129 |
+
"floor": 47,
|
| 130 |
+
"stair": 48,
|
| 131 |
+
"building": 49,
|
| 132 |
+
"block": 50,
|
| 133 |
+
"address-extra": 51,
|
| 134 |
+
"cc-name": 52,
|
| 135 |
+
"cc-given-name": 53,
|
| 136 |
+
"cc-additional-name": 54,
|
| 137 |
+
"cc-family-name": 55,
|
| 138 |
+
"cc-number": 56,
|
| 139 |
+
"cc-exp": 57,
|
| 140 |
+
"cc-exp-month": 58,
|
| 141 |
+
"cc-exp-year": 59,
|
| 142 |
+
"cc-csc": 60,
|
| 143 |
+
"cc-type": 61,
|
| 144 |
+
"sex": 62,
|
| 145 |
+
"id-number": 63,
|
| 146 |
+
"vat-number": 64,
|
| 147 |
+
"reference-point": 65,
|
| 148 |
+
"loginname": 66
|
| 149 |
+
},
|
| 150 |
+
"torch_dtype": "float32",
|
| 151 |
+
"transformers_version": "4.44.2",
|
| 152 |
+
"transformers.js_config": {
|
| 153 |
+
"dtype": "fp32",
|
| 154 |
+
"kv_cache_dtype": {}
|
| 155 |
+
},
|
| 156 |
+
"_comment": "Fusion head for the triple autofill classifier. Input 'fused' float32 [batch,1920] = concat[e_cur,e_prev,e_next,e_cur-e_prev,e_cur-e_next]; output 'logits' [batch,66]. Loaded via AutoModel; run directly by the moz-formfill-head pipelineFunction."
|
| 157 |
+
}
|
onnx/model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2483a0f01c175213447ea5a887ef56e5b378fb88dd2e04b239fc29ee80427915
|
| 3 |
+
size 3053297
|