Downloads · 30 days
15
36% of all-time downloads
3chez/layoutxlm-finetuned-xfund-fr
layoutxlm-finetuned-xfund-fr is a token classification model from 3chez. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as cc-by-nc-sa-4.0.
This model is a fine-tuned version of microsoft/layoutxlm-base on the XFUND dataset (French split).
Downloads · 30 days
15
36% of all-time downloads
All-time downloads
42
Public
Parameters
369M
11.8 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.5 GB · 99%
From the Hugging Face model README
This model is a fine-tuned version of microsoft/layoutxlm-base on the XFUND dataset (French split).
Note that this model requires Tesseract, French package, in order to perform inference. You can install it using !sudo apt-get install tesseract-ocr-fra.
Here's how to use this model:
from transformers import AutoProcessor, AutoModelForTokenClassification
import torch
from PIL import Image
processor = AutoProcessor.from_pretrained("nielsr/layoutxlm-finetuned-xfund-fr")
model = AutoModelForTokenClassification.from_pretrained(nielsr/layoutxlm-finetuned-xfund-fr")
# assuming you have a French document, turned into an image
image = Image.open("...").convert("RGB")
# prepare for the model
encoding = processor(image, padding="max_length", max_length=512, truncation=True, return_tensors="pt")
with torch.no_grad():
outputs = model(**encoding)
logits = outputs.logits
predictions = logits.argmax(-1)
This model can be used for NER on French scanned documents. It can recognize 4 categories: "question", "answer", "header" and "other".
This checkpoint used the French portion of the multilingual XFUND dataset.
The following hyperparameters were used during training: