
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# layoutlm-funsd

This model is a fine-tuned version of [microsoft/layoutlm-base-uncased](https://huggingface.co/microsoft/layoutlm-base-uncased) on the funsd dataset.
It achieves the following results on the evaluation set:
- Loss: 0.7065
- Answer: {'precision': 0.7120708748615725, 'recall': 0.7948084054388134, 'f1': 0.7511682242990654, 'number': 809}
- Header: {'precision': 0.31746031746031744, 'recall': 0.33613445378151263, 'f1': 0.32653061224489793, 'number': 119}
- Question: {'precision': 0.7776809067131648, 'recall': 0.8375586854460094, 'f1': 0.8065099457504521, 'number': 1065}
- Overall Precision: 0.7238
- Overall Recall: 0.7903
- Overall F1: 0.7556
- Overall Accuracy: 0.7999

## Model description

More information needed

## Intended uses & limitations

More information needed

## Training and evaluation data

More information needed

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 3e-05
- train_batch_size: 16
- eval_batch_size: 8
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 15
- mixed_precision_training: Native AMP

### Training results

| Training Loss | Epoch | Step | Validation Loss | Answer                                                                                                        | Header                                                                                                         | Question                                                                                                     | Overall Precision | Overall Recall | Overall F1 | Overall Accuracy |
|:-------------:|:-----:|:----:|:---------------:|:-------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------:|:-----------------:|:--------------:|:----------:|:----------------:|
| 1.7682        | 1.0   | 10   | 1.5613          | {'precision': 0.029469548133595286, 'recall': 0.037082818294190356, 'f1': 0.03284072249589491, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                    | {'precision': 0.14761904761904762, 'recall': 0.14553990610328638, 'f1': 0.14657210401891252, 'number': 1065} | 0.0895            | 0.0928         | 0.0911     | 0.3814           |
| 1.4106        | 2.0   | 20   | 1.2321          | {'precision': 0.1530120481927711, 'recall': 0.15698393077873918, 'f1': 0.1549725442342892, 'number': 809}     | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                    | {'precision': 0.4595959595959596, 'recall': 0.5981220657276995, 'f1': 0.5197878416972664, 'number': 1065}    | 0.3448            | 0.3833         | 0.3630     | 0.5884           |
| 1.0722        | 3.0   | 30   | 0.9239          | {'precision': 0.45864661654135336, 'recall': 0.5278121137206427, 'f1': 0.4908045977011494, 'number': 809}     | {'precision': 0.034482758620689655, 'recall': 0.008403361344537815, 'f1': 0.013513513513513513, 'number': 119} | {'precision': 0.6172006745362564, 'recall': 0.6873239436619718, 'f1': 0.6503776099511329, 'number': 1065}    | 0.5405            | 0.5820         | 0.5605     | 0.7059           |
| 0.813         | 4.0   | 40   | 0.7588          | {'precision': 0.6421404682274248, 'recall': 0.7119901112484549, 'f1': 0.675263774912075, 'number': 809}       | {'precision': 0.17543859649122806, 'recall': 0.08403361344537816, 'f1': 0.11363636363636363, 'number': 119}    | {'precision': 0.6691236691236692, 'recall': 0.7671361502347418, 'f1': 0.7147856517935257, 'number': 1065}    | 0.6451            | 0.7040         | 0.6732     | 0.7672           |
| 0.6435        | 5.0   | 50   | 0.6978          | {'precision': 0.6810631229235881, 'recall': 0.7601977750309024, 'f1': 0.7184579439252335, 'number': 809}      | {'precision': 0.33766233766233766, 'recall': 0.2184873949579832, 'f1': 0.2653061224489796, 'number': 119}      | {'precision': 0.6998394863563403, 'recall': 0.8187793427230047, 'f1': 0.7546516659454782, 'number': 1065}    | 0.6797            | 0.7592         | 0.7172     | 0.7834           |
| 0.5577        | 6.0   | 60   | 0.6803          | {'precision': 0.6797385620915033, 'recall': 0.7713226205191595, 'f1': 0.7226404169079328, 'number': 809}      | {'precision': 0.31645569620253167, 'recall': 0.21008403361344538, 'f1': 0.25252525252525254, 'number': 119}    | {'precision': 0.7280334728033473, 'recall': 0.8169014084507042, 'f1': 0.7699115044247787, 'number': 1065}    | 0.6930            | 0.7622         | 0.7259     | 0.7920           |
| 0.4844        | 7.0   | 70   | 0.6678          | {'precision': 0.6868798235942668, 'recall': 0.7700865265760197, 'f1': 0.726107226107226, 'number': 809}       | {'precision': 0.3157894736842105, 'recall': 0.25210084033613445, 'f1': 0.2803738317757009, 'number': 119}      | {'precision': 0.7511032656663724, 'recall': 0.7990610328638498, 'f1': 0.7743403093721565, 'number': 1065}    | 0.7044            | 0.7546         | 0.7287     | 0.7968           |
| 0.4396        | 8.0   | 80   | 0.6579          | {'precision': 0.7017543859649122, 'recall': 0.7911001236093943, 'f1': 0.7437536316095292, 'number': 809}      | {'precision': 0.30927835051546393, 'recall': 0.25210084033613445, 'f1': 0.2777777777777778, 'number': 119}     | {'precision': 0.7595486111111112, 'recall': 0.8215962441314554, 'f1': 0.7893549842129003, 'number': 1065}    | 0.7149            | 0.7752         | 0.7439     | 0.8041           |
| 0.3704        | 9.0   | 90   | 0.6669          | {'precision': 0.7118834080717489, 'recall': 0.7849196538936959, 'f1': 0.7466196355085244, 'number': 809}      | {'precision': 0.3064516129032258, 'recall': 0.31932773109243695, 'f1': 0.31275720164609055, 'number': 119}     | {'precision': 0.7565217391304347, 'recall': 0.8169014084507042, 'f1': 0.7855530474040633, 'number': 1065}    | 0.7124            | 0.7742         | 0.7420     | 0.7986           |
| 0.3414        | 10.0  | 100  | 0.6865          | {'precision': 0.7039911308203991, 'recall': 0.7849196538936959, 'f1': 0.7422559906487435, 'number': 809}      | {'precision': 0.308411214953271, 'recall': 0.2773109243697479, 'f1': 0.29203539823008845, 'number': 119}       | {'precision': 0.7589743589743589, 'recall': 0.8338028169014085, 'f1': 0.7946308724832215, 'number': 1065}    | 0.7141            | 0.7807         | 0.7459     | 0.7986           |
| 0.3189        | 11.0  | 110  | 0.6830          | {'precision': 0.7093922651933702, 'recall': 0.7935723114956736, 'f1': 0.7491248541423571, 'number': 809}      | {'precision': 0.2972972972972973, 'recall': 0.2773109243697479, 'f1': 0.28695652173913044, 'number': 119}      | {'precision': 0.7759078830823738, 'recall': 0.8225352112676056, 'f1': 0.7985414767547857, 'number': 1065}    | 0.7231            | 0.7782         | 0.7496     | 0.8025           |
| 0.2921        | 12.0  | 120  | 0.6976          | {'precision': 0.7194163860830527, 'recall': 0.792336217552534, 'f1': 0.7541176470588233, 'number': 809}       | {'precision': 0.3333333333333333, 'recall': 0.36134453781512604, 'f1': 0.34677419354838707, 'number': 119}     | {'precision': 0.7757417102966842, 'recall': 0.8347417840375587, 'f1': 0.8041610131162371, 'number': 1065}    | 0.7262            | 0.7893         | 0.7564     | 0.7987           |
| 0.2775        | 13.0  | 130  | 0.6988          | {'precision': 0.7120708748615725, 'recall': 0.7948084054388134, 'f1': 0.7511682242990654, 'number': 809}      | {'precision': 0.34234234234234234, 'recall': 0.31932773109243695, 'f1': 0.33043478260869563, 'number': 119}    | {'precision': 0.7779735682819383, 'recall': 0.8291079812206573, 'f1': 0.8027272727272727, 'number': 1065}    | 0.7278            | 0.7847         | 0.7552     | 0.8008           |
| 0.2632        | 14.0  | 140  | 0.7080          | {'precision': 0.7189249720044792, 'recall': 0.7935723114956736, 'f1': 0.7544065804935369, 'number': 809}      | {'precision': 0.3333333333333333, 'recall': 0.3445378151260504, 'f1': 0.33884297520661155, 'number': 119}      | {'precision': 0.7769028871391076, 'recall': 0.8338028169014085, 'f1': 0.8043478260869565, 'number': 1065}    | 0.7277            | 0.7883         | 0.7567     | 0.8005           |
| 0.2666        | 15.0  | 150  | 0.7065          | {'precision': 0.7120708748615725, 'recall': 0.7948084054388134, 'f1': 0.7511682242990654, 'number': 809}      | {'precision': 0.31746031746031744, 'recall': 0.33613445378151263, 'f1': 0.32653061224489793, 'number': 119}    | {'precision': 0.7776809067131648, 'recall': 0.8375586854460094, 'f1': 0.8065099457504521, 'number': 1065}    | 0.7238            | 0.7903         | 0.7556     | 0.7999           |


### Framework versions

- Transformers 4.36.2
- Pytorch 2.1.2
- Datasets 2.15.0
- Tokenizers 0.15.0

{"license": "mit", "tags": ["generated_from_trainer"], "datasets": ["funsd"], "base_model": "microsoft/layoutlm-base-uncased", "model-index": [{"name": "layoutlm-funsd", "results": []}]}
transformers tensorboard safetensors layoutlm token-classification generated_from_trainer dataset:funsd base_model:microsoft/layoutlm-base-uncased license:mit autotrain_compatible endpoints_compatible region:us