pierreguillou
commited on
Commit
•
339b1e7
1
Parent(s):
8384d84
Update README.md
Browse files
README.md
CHANGED
@@ -1,41 +1,131 @@
|
|
1 |
---
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
tags:
|
|
|
|
|
4 |
- generated_from_trainer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
metrics:
|
6 |
- precision
|
7 |
- recall
|
8 |
- f1
|
9 |
- accuracy
|
10 |
model-index:
|
11 |
-
- name: layout-xlm-base-finetuned-DocLayNet-
|
12 |
-
results:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
---
|
14 |
|
15 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
16 |
should probably proofread and complete it, then remove this comment. -->
|
17 |
|
18 |
-
#
|
19 |
|
20 |
-
This model is a fine-tuned version of [microsoft/layoutxlm-base](https://huggingface.co/microsoft/layoutxlm-base)
|
21 |
It achieves the following results on the evaluation set:
|
|
|
22 |
- Loss: 0.2364
|
23 |
- Precision: 0.7260
|
24 |
- Recall: 0.7415
|
25 |
- F1: 0.7336
|
26 |
- Accuracy: 0.9373
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
## Model description
|
29 |
|
30 |
-
|
|
|
|
|
31 |
|
32 |
-
##
|
33 |
|
34 |
-
|
35 |
|
36 |
## Training and evaluation data
|
37 |
|
38 |
-
|
39 |
|
40 |
## Training procedure
|
41 |
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- multilingual
|
4 |
+
- en
|
5 |
+
- de
|
6 |
+
- fr
|
7 |
+
- ja
|
8 |
+
license: mit
|
9 |
tags:
|
10 |
+
- object-detection
|
11 |
+
- vision
|
12 |
- generated_from_trainer
|
13 |
+
- DocLayNet
|
14 |
+
- COCO
|
15 |
+
- PDF
|
16 |
+
- IBM
|
17 |
+
- Financial-Reports
|
18 |
+
- Finance
|
19 |
+
- Manuals
|
20 |
+
- Scientific-Articles
|
21 |
+
- Science
|
22 |
+
- Laws
|
23 |
+
- Law
|
24 |
+
- Regulations
|
25 |
+
- Patents
|
26 |
+
- Government-Tenders
|
27 |
+
- object-detection
|
28 |
+
- image-segmentation
|
29 |
+
- token-classification
|
30 |
+
inference: false
|
31 |
+
datasets:
|
32 |
+
- pierreguillou/DocLayNet-base
|
33 |
metrics:
|
34 |
- precision
|
35 |
- recall
|
36 |
- f1
|
37 |
- accuracy
|
38 |
model-index:
|
39 |
+
- name: layout-xlm-base-finetuned-with-DocLayNet-base-at-linelevel-ml384
|
40 |
+
results:
|
41 |
+
- task:
|
42 |
+
name: Token Classification
|
43 |
+
type: token-classification
|
44 |
+
metrics:
|
45 |
+
- name: f1
|
46 |
+
type: f1
|
47 |
+
value: 0.7336
|
48 |
---
|
49 |
|
50 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
51 |
should probably proofread and complete it, then remove this comment. -->
|
52 |
|
53 |
+
# Document Understanding model (at line level)
|
54 |
|
55 |
+
This model is a fine-tuned version of [microsoft/layoutxlm-base](https://huggingface.co/microsoft/layoutxlm-base) with the [DocLayNet base](https://huggingface.co/datasets/pierreguillou/DocLayNet-base) dataset.
|
56 |
It achieves the following results on the evaluation set:
|
57 |
+
|
58 |
- Loss: 0.2364
|
59 |
- Precision: 0.7260
|
60 |
- Recall: 0.7415
|
61 |
- F1: 0.7336
|
62 |
- Accuracy: 0.9373
|
63 |
|
64 |
+
## References
|
65 |
+
|
66 |
+
### Other models
|
67 |
+
- LiLT base
|
68 |
+
- [Document Understanding model (at paragraph level)](https://huggingface.co/pierreguillou/lilt-xlm-roberta-base-finetuned-with-DocLayNet-base-at-paragraphlevel-ml512)
|
69 |
+
- [Document Understanding model (at line level)](https://huggingface.co/pierreguillou/lilt-xlm-roberta-base-finetuned-with-DocLayNet-base-at-linelevel-ml384)
|
70 |
+
|
71 |
+
### Blog posts
|
72 |
+
|
73 |
+
- Layout XLM base
|
74 |
+
- (03/05/2023) [Document AI | Inference APP and fine-tuning notebook for Document Understanding at line level with LayoutXLM base]()
|
75 |
+
- LiLT base
|
76 |
+
- (02/16/2023) [Document AI | Inference APP and fine-tuning notebook for Document Understanding at paragraph level](https://medium.com/@pierre_guillou/document-ai-inference-app-and-fine-tuning-notebook-for-document-understanding-at-paragraph-level-c18d16e53cf8)
|
77 |
+
- (02/14/2023) [Document AI | Inference APP for Document Understanding at line level](https://medium.com/@pierre_guillou/document-ai-inference-app-for-document-understanding-at-line-level-a35bbfa98893)
|
78 |
+
- (02/10/2023) [Document AI | Document Understanding model at line level with LiLT, Tesseract and DocLayNet dataset](https://medium.com/@pierre_guillou/document-ai-document-understanding-model-at-line-level-with-lilt-tesseract-and-doclaynet-dataset-347107a643b8)
|
79 |
+
- (01/31/2023) [Document AI | DocLayNet image viewer APP](https://medium.com/@pierre_guillou/document-ai-doclaynet-image-viewer-app-3ac54c19956)
|
80 |
+
- (01/27/2023) [Document AI | Processing of DocLayNet dataset to be used by layout models of the Hugging Face hub (finetuning, inference)](https://medium.com/@pierre_guillou/document-ai-processing-of-doclaynet-dataset-to-be-used-by-layout-models-of-the-hugging-face-hub-308d8bd81cdb)
|
81 |
+
|
82 |
+
### Notebooks (paragraph level)
|
83 |
+
- LiLT base
|
84 |
+
- [Document AI | Inference APP at paragraph level with a Document Understanding model (LiLT fine-tuned on DocLayNet dataset)](https://github.com/piegu/language-models/blob/master/Gradio_inference_on_LiLT_model_finetuned_on_DocLayNet_base_in_any_language_at_levelparagraphs_ml512.ipynb)
|
85 |
+
- [Document AI | Inference at paragraph level with a Document Understanding model (LiLT fine-tuned on DocLayNet dataset)](https://github.com/piegu/language-models/blob/master/inference_on_LiLT_model_finetuned_on_DocLayNet_base_in_any_language_at_levelparagraphs_ml512.ipynb)
|
86 |
+
- [Document AI | Fine-tune LiLT on DocLayNet base in any language at paragraph level (chunk of 512 tokens with overlap)](https://github.com/piegu/language-models/blob/master/Fine_tune_LiLT_on_DocLayNet_base_in_any_language_at_paragraphlevel_ml_512.ipynb)
|
87 |
+
|
88 |
+
### Notebooks (line level)
|
89 |
+
- Layout XLM base
|
90 |
+
- [Document AI | Inference at line level with a Document Understanding model (LayoutXLM base fine-tuned on DocLayNet dataset)](https://github.com/piegu/language-models/blob/master/inference_on_LayoutXLM_base_model_finetuned_on_DocLayNet_base_in_any_language_at_levellines_ml384.ipynb)
|
91 |
+
- [Document AI | Inference APP at line level with a Document Understanding model (LayoutXLM base fine-tuned on DocLayNet base dataset)](https://github.com/piegu/language-models/blob/master/Gradio_inference_on_LayoutXLM_base_model_finetuned_on_DocLayNet_base_in_any_language_at_levellines_ml384.ipynb)
|
92 |
+
- [Document AI | Fine-tune LayoutXLM base on DocLayNet base in any language at line level (chunk of 384 tokens with overlap)](https://github.com/piegu/language-models/blob/master/Fine_tune_LayoutXLM_base_on_DocLayNet_base_in_any_language_at_linelevel_ml_384.ipynb)
|
93 |
+
- LiLT base
|
94 |
+
- [Document AI | Inference at line level with a Document Understanding model (LiLT fine-tuned on DocLayNet dataset)](https://github.com/piegu/language-models/blob/master/inference_on_LiLT_model_finetuned_on_DocLayNet_base_in_any_language_at_levellines_ml384.ipynb)
|
95 |
+
- [Document AI | Inference APP at line level with a Document Understanding model (LiLT fine-tuned on DocLayNet dataset)](https://github.com/piegu/language-models/blob/master/Gradio_inference_on_LiLT_model_finetuned_on_DocLayNet_base_in_any_language_at_levellines_ml384.ipynb)
|
96 |
+
- [Document AI | Fine-tune LiLT on DocLayNet base in any language at line level (chunk of 384 tokens with overlap)](https://github.com/piegu/language-models/blob/master/Fine_tune_LiLT_on_DocLayNet_base_in_any_language_at_linelevel_ml_384.ipynb)
|
97 |
+
- [DocLayNet image viewer APP](https://github.com/piegu/language-models/blob/master/DocLayNet_image_viewer_APP.ipynb)
|
98 |
+
- [Processing of DocLayNet dataset to be used by layout models of the Hugging Face hub (finetuning, inference)](processing_DocLayNet_dataset_to_be_used_by_layout_models_of_HF_hub.ipynb)
|
99 |
+
|
100 |
+
### APP
|
101 |
+
|
102 |
+
You can test this model with this APP in Hugging Face Spaces: [Inference APP for Document Understanding at line level (v2)](https://huggingface.co/spaces/pierreguillou/Inference-APP-Document-Understanding-at-linelevel-v2).
|
103 |
+
|
104 |
+
![Inference APP for Document Understanding at line level (v2)](https://huggingface.co/pierreguillou/layout-xlm-base-finetuned-with-DocLayNet-base-at-linelevel-ml384/resolve/main/app_layoutXLM_base_document_understanding_AI.png)
|
105 |
+
|
106 |
+
### DocLayNet dataset
|
107 |
+
|
108 |
+
[DocLayNet dataset](https://github.com/DS4SD/DocLayNet) (IBM) provides page-by-page layout segmentation ground-truth using bounding-boxes for 11 distinct class labels on 80863 unique pages from 6 document categories.
|
109 |
+
|
110 |
+
Until today, the dataset can be downloaded through direct links or as a dataset from Hugging Face datasets:
|
111 |
+
- direct links: [doclaynet_core.zip](https://codait-cos-dax.s3.us.cloud-object-storage.appdomain.cloud/dax-doclaynet/1.0.0/DocLayNet_core.zip) (28 GiB), [doclaynet_extra.zip](https://codait-cos-dax.s3.us.cloud-object-storage.appdomain.cloud/dax-doclaynet/1.0.0/DocLayNet_extra.zip) (7.5 GiB)
|
112 |
+
- Hugging Face dataset library: [dataset DocLayNet](https://huggingface.co/datasets/ds4sd/DocLayNet)
|
113 |
+
|
114 |
+
Paper: [DocLayNet: A Large Human-Annotated Dataset for Document-Layout Analysis](https://arxiv.org/abs/2206.01062) (06/02/2022)
|
115 |
+
|
116 |
## Model description
|
117 |
|
118 |
+
The model was finetuned at **line level on chunk of 384 tokens with overlap of 128 tokens**. Thus, the model was trained with all layout and text data of all pages of the dataset.
|
119 |
+
|
120 |
+
At inference time, a calculation of best probabilities give the label to each line bounding boxes.
|
121 |
|
122 |
+
## Inference
|
123 |
|
124 |
+
See notebook: [Document AI | Inference at line level with a Document Understanding model (LayoutXLM base fine-tuned on DocLayNet dataset)](https://github.com/piegu/language-models/blob/master/inference_on_LayoutXLM_base_model_finetuned_on_DocLayNet_base_in_any_language_at_levellines_ml384.ipynb)
|
125 |
|
126 |
## Training and evaluation data
|
127 |
|
128 |
+
See notebook: [Document AI | Fine-tune LayoutXLM base on DocLayNet base in any language at line level (chunk of 384 tokens with overlap)](https://github.com/piegu/language-models/blob/master/Fine_tune_LayoutXLM_base_on_DocLayNet_base_in_any_language_at_linelevel_ml_384.ipynb)
|
129 |
|
130 |
## Training procedure
|
131 |
|