Instructions to use AllanDai/freightlens-layoutlmv3-funsd with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AllanDai/freightlens-layoutlmv3-funsd with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="AllanDai/freightlens-layoutlmv3-funsd")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForTokenClassification processor = AutoProcessor.from_pretrained("AllanDai/freightlens-layoutlmv3-funsd") model = AutoModelForTokenClassification.from_pretrained("AllanDai/freightlens-layoutlmv3-funsd", device_map="auto") - Notebooks
- Google Colab
- Kaggle
FreightLens LayoutLMv3 (FUNSD)
microsoft/layoutlmv3-base fine-tuned end to end on FUNSD
scanned forms to tag words as question, answer or header (BIO labels). Part of
FreightLens AI.
Training
134 training forms, 15 held-out forms for checkpoint selection, official 50-form test split scored once. 1,000 steps, AdamW, learning rate 1e-5, 10% linear warm-up, batch 2. Each word keeps its own box, as an OCR engine would produce on a new document.
Test results (seqeval entity level)
| Entity | Precision | Recall | F1 |
|---|---|---|---|
| answer | 0.774 | 0.837 | 0.804 |
| header | 0.448 | 0.546 | 0.492 |
| question | 0.829 | 0.830 | 0.829 |
| overall | 0.779 | 0.816 | 0.797 |
With segment-level boxes (every word takes its annotated entity box, the protocol behind the published 90.3 F1) the same recipe reaches 0.878 F1; that setting relies on ground-truth entity extents and is reported only for comparison.
Usage
from transformers import LayoutLMv3ForTokenClassification, LayoutLMv3Processor
repo = "AllanDai/freightlens-layoutlmv3-funsd"
processor = LayoutLMv3Processor.from_pretrained(repo, apply_ocr=True)
model = LayoutLMv3ForTokenClassification.from_pretrained(repo)
License
The base model is CC BY-NC-SA 4.0, so these weights are for non-commercial use only.
- Downloads last month
- 36
Model tree for AllanDai/freightlens-layoutlmv3-funsd
Base model
microsoft/layoutlmv3-base