Update README.md
Browse files
README.md
CHANGED
@@ -13,17 +13,35 @@ model-index:
|
|
13 |
|
14 |
This model is a fine-tuned version of [microsoft/layoutxlm-base](https://huggingface.co/microsoft/layoutxlm-base) on the [XUND](https://github.com/doc-analysis/XFUND) dataset (French split).
|
15 |
|
16 |
-
## Model
|
17 |
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
## Intended uses & limitations
|
21 |
|
22 |
-
|
23 |
|
24 |
## Training and evaluation data
|
25 |
|
26 |
-
|
27 |
|
28 |
## Training procedure
|
29 |
|
|
|
13 |
|
14 |
This model is a fine-tuned version of [microsoft/layoutxlm-base](https://huggingface.co/microsoft/layoutxlm-base) on the [XUND](https://github.com/doc-analysis/XFUND) dataset (French split).
|
15 |
|
16 |
+
## Model usage
|
17 |
|
18 |
+
Here's how to use this model:
|
19 |
+
|
20 |
+
```
|
21 |
+
from transformers import AutoProcessor, AutoModelForTokenClassification
|
22 |
+
from PIL import Image
|
23 |
+
|
24 |
+
processor = AutoProcessor.from_pretrained("nielsr/layoutxlm-finetuned-xfund-fr")
|
25 |
+
model = AutoModelForTokenClassification.from_pretrained(nielsr/layoutxlm-finetuned-xfund-fr")
|
26 |
+
|
27 |
+
# assuming you have a French document, turned into an image
|
28 |
+
image = Image("...").convert("RGB")
|
29 |
+
|
30 |
+
# prepare for the model
|
31 |
+
encoding = processor(image, return_tensors="pt")
|
32 |
+
|
33 |
+
with torch.no_grad():
|
34 |
+
outputs = model(**encoding)
|
35 |
+
logits = outputs.logits
|
36 |
+
```
|
37 |
|
38 |
## Intended uses & limitations
|
39 |
|
40 |
+
This model can be used for NER on French scanned documents. It can recognize 4 categories: "question", "answer", "header" and "other".
|
41 |
|
42 |
## Training and evaluation data
|
43 |
|
44 |
+
This checkpoint used the French portion of the multilingual [XUND](https://github.com/doc-analysis/XFUND) dataset.
|
45 |
|
46 |
## Training procedure
|
47 |
|