File size: 2,697 Bytes
0c24599
 
 
 
7b9cf74
 
 
 
3ce3a1d
 
 
 
0c24599
 
 
 
 
 
 
 
 
 
 
3ce3a1d
7b9cf74
0c24599
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3ce3a1d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1280f00
 
 
3ce3a1d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7b9cf74
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
---
language: en
thumbnail: https://huggingface.co/front/thumbnails/google.png
license: apache-2.0
base_model:
- google/mobilebert-uncased
pipeline_tag: text-classification
library_name: transformers
metrics:
- f1
- precision
- recall
---

## MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices

MobileBERT is a thin version of BERT_LARGE, while equipped with bottleneck structures and a carefully designed balance
between self-attentions and feed-forward networks.

This checkpoint is the original MobileBert Optimized Uncased English:
[uncased_L-24_H-128_B-512_A-4_F-4_OPT](https://storage.googleapis.com/cloud-tpu-checkpoints/mobilebert/uncased_L-24_H-128_B-512_A-4_F-4_OPT.tar.gz)
checkpoint.

This model was fine-tuned on html tags and labels using [Fathom](https://mozilla.github.io/fathom/commands/label.html).

## How to use MobileBERT in `transformers`

```python
from transformers import pipeline

classifier = pipeline(
	"text-classification",
	model="vazish/mobile_bert_autofill",
	tokenizer="vazish/mobile_bert_autofill"
)

print(
	classifier('<input class="cc-number" placeholder="Enter credit card number..." />')
)

```

## Model Training Info
```python
HyperParameters: {
'learning_rate': 0.000082,
'num_train_epochs': 12,
'weight_decay': 0.1,
'per_device_train_batch_size': 32,
}
```

# Model Performance
```
Test Performance:
Precision: 0.97043
Recall: 0.96966
F1: 0.96921

                     precision    recall  f1-score   support

      CC Expiration      1.000     0.875     0.933        16
CC Expiration Month      1.000     0.972     0.986        36
 CC Expiration Year      0.973     0.973     0.973        37
            CC Name      1.000     0.968     0.984        31
          CC Number      0.942     0.980     0.961        50
    CC Payment Type      0.934     0.760     0.838        75
   CC Security Code      0.929     0.951     0.940        41
            CC Type      0.857     0.857     0.857        14
   Confirm Password      1.000     0.860     0.925        57
              Email      0.972     0.945     0.958        73
         First Name      0.833     1.000     0.909         5
               Form      0.950     0.974     0.962        39
          Last Name      0.833     1.000     0.909         5
       New Password      0.915     1.000     0.956        97
              Other      0.981     0.989     0.985      1235
              Phone      0.600     1.000     0.750         3
           Zip Code      0.939     0.969     0.954        32

           accuracy                          0.970      1846
          macro avg      0.921     0.945     0.928      1846
       weighted avg      0.970     0.970     0.969      1846
```