readme: ---
  tags:
  - generated_from_trainer
  datasets:
  - funsd
  model-index:
  - name: layoutlm-funsd-pytorch
    results: []
  ---
  
  <!-- 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-pytorch
  
  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.7042
  - Answer: {'precision': 0.712403951701427, 'recall': 0.8022249690976514, 'f1': 0.7546511627906977, 'number': 809}
  - Header: {'precision': 0.3203125, 'recall': 0.3445378151260504, 'f1': 0.33198380566801616, 'number': 119}
  - Question: {'precision': 0.7747589833479404, 'recall': 0.8300469483568075, 'f1': 0.8014505893019038, 'number': 1065}
  - Overall Precision: 0.7220
  - Overall Recall: 0.7898
  - Overall F1: 0.7544
  - Overall Accuracy: 0.8078
  
  ## 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
  
  ### Training results
  
  | Training Loss | Epoch | Step | Validation Loss | Answer                                                                                                       | Header                                                                                                        | Question                                                                                                    | Overall Precision | Overall Recall | Overall F1 | Overall Accuracy |
  |:-------------:|:-----:|:----:|:---------------:|:------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------:|:-----------------:|:--------------:|:----------:|:----------------:|
  | 1.7641        | 1.0   | 10   | 1.5569          | {'precision': 0.01979045401629802, 'recall': 0.021013597033374538, 'f1': 0.02038369304556355, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                   | {'precision': 0.20930232558139536, 'recall': 0.15211267605633802, 'f1': 0.1761827079934747, 'number': 1065} | 0.1096            | 0.0898         | 0.0987     | 0.3917           |
  | 1.4096        | 2.0   | 20   | 1.1718          | {'precision': 0.18729096989966554, 'recall': 0.138442521631644, 'f1': 0.15920398009950248, 'number': 809}    | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                   | {'precision': 0.4800601956358164, 'recall': 0.5990610328638498, 'f1': 0.5329991645781119, 'number': 1065}   | 0.3892            | 0.3763         | 0.3827     | 0.6045           |
  | 1.0362        | 3.0   | 30   | 0.9322          | {'precision': 0.5212620027434842, 'recall': 0.46971569839307786, 'f1': 0.494148244473342, 'number': 809}     | {'precision': 0.10344827586206896, 'recall': 0.025210084033613446, 'f1': 0.040540540540540536, 'number': 119} | {'precision': 0.6362847222222222, 'recall': 0.6882629107981221, 'f1': 0.661253946774921, 'number': 1065}    | 0.5843            | 0.5600         | 0.5719     | 0.7091           |
  | 0.8024        | 4.0   | 40   | 0.7725          | {'precision': 0.6457858769931663, 'recall': 0.7008652657601978, 'f1': 0.6721991701244814, 'number': 809}     | {'precision': 0.1791044776119403, 'recall': 0.10084033613445378, 'f1': 0.12903225806451613, 'number': 119}    | {'precision': 0.6911130284728214, 'recall': 0.752112676056338, 'f1': 0.7203237410071942, 'number': 1065}    | 0.6559            | 0.6924         | 0.6737     | 0.7700           |
  | 0.6483        | 5.0   | 50   | 0.7035          | {'precision': 0.6575790621592148, 'recall': 0.7453646477132262, 'f1': 0.6987253765932794, 'number': 809}     | {'precision': 0.26881720430107525, 'recall': 0.21008403361344538, 'f1': 0.2358490566037736, 'number': 119}    | {'precision': 0.7120067170445005, 'recall': 0.7962441314553991, 'f1': 0.75177304964539, 'number': 1065}     | 0.6706            | 0.7406         | 0.7039     | 0.7857           |
  | 0.5298        | 6.0   | 60   | 0.6747          | {'precision': 0.6925601750547046, 'recall': 0.7824474660074165, 'f1': 0.73476494486361, 'number': 809}       | {'precision': 0.3472222222222222, 'recall': 0.21008403361344538, 'f1': 0.2617801047120419, 'number': 119}     | {'precision': 0.7333333333333333, 'recall': 0.8366197183098592, 'f1': 0.7815789473684