Instructions to use davidadeyemi/layoutlm-nigerian-forms with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use davidadeyemi/layoutlm-nigerian-forms with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="davidadeyemi/layoutlm-nigerian-forms")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("davidadeyemi/layoutlm-nigerian-forms") model = AutoModelForTokenClassification.from_pretrained("davidadeyemi/layoutlm-nigerian-forms", device_map="auto") - Notebooks
- Google Colab
- Kaggle
LayoutLM for Nigerian forms
philschmid/layoutlm-funsd fine-tuned on pages of Nigerian bank forms. It tags each OCR word of a
form page as HEADER, QUESTION (a label), ANSWER or other (the 7 FUNSD BIO labels). It is the
stage 1 model of the N-ATLAS Form Assistant (https://github.com/1demilade/n-atlas-form-assistant).
No tokenizer is included: use microsoft/layoutlm-base-uncased.
from transformers import AutoTokenizer, LayoutLMForTokenClassification
tokenizer = AutoTokenizer.from_pretrained('microsoft/layoutlm-base-uncased')
model = LayoutLMForTokenClassification.from_pretrained('davidadeyemi/layoutlm-nigerian-forms')
Training
Started from philschmid/layoutlm-funsd. 15 epochs, learning rate 3e-5, batch size 4. Data: 53 pages
of Nigerian forms (each repeated 3 times) plus the 149 FUNSD training forms. Full numbers are in
training_results.json.
Results
Entity F1 on the trainer's held-out sets:
| Test set | before | after |
|---|---|---|
| Nigerian forms (19 pages of 3 bank account-opening forms) | 0.522 | 0.691 |
| FUNSD test | 0.785 | 0.765 |
On the N-ATLAS Form Assistant's own gold data (6 real forms, 155 fields, scored on whole fields after the project's layout rules, 8 Nov 2026) it scored slightly below the base model: field F1 56% against 59%. Those forms are mostly not account-opening forms.
Limits
- The Nigerian training and test sets are small and come from a few bank forms.
- The licence of the base model is not stated; treat this model as research-only until checked.
- Downloads last month
- -
Model tree for davidadeyemi/layoutlm-nigerian-forms
Base model
philschmid/layoutlm-funsd