Views
No views yet
microsoft/layoutlmv3-base)
Language(s): English
License: Apache 2.0
Fine-tuned from: microsoft/layoutlmv3-baseQUESTIONANSWERHEADERO (other)1from transformers import LayoutLMv3Processor, LayoutLMv3ForTokenClassification
2from PIL import Image
3
4# Load model and processor
5model = LayoutLMv3ForTokenClassification.from_pretrained("nnul/layoutlmv3-finetuned-funsd")
6processor = LayoutLMv3Processor.from_pretrained("nnul/layoutlmv3-finetuned-funsd")
7
8# Load and prepare image + OCR tokens and boxes
9image = Image.open("your_form.jpg").convert("RGB")
10words = ["Name", ":", "John", "Doe"]
11boxes = [[100,100,150,120], [155,100,160,120], [165,100,220,120], [225,100,270,120]]
12
13encoding = processor(image, words, boxes=boxes, return_tensors="pt")
14outputs = model(**encoding)
15predictions = outputs.logits.argmax(-1)| Label | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| ANSWER | 0.90 | 0.93 | 0.92 | 817 |
| HEADER | 0.67 | 0.64 | 0.66 | 119 |
| QUESTION | 0.91 | 0.94 | 0.93 | 1077 |
| Micro Avg | 0.90 | 0.92 | 0.91 | 2013 |
| Macro Avg | 0.83 | 0.84 | 0.83 | 2013 |
| Weighted Avg | 0.89 | 0.92 | 0.91 | 2013 |
| Parameter | Value |
|---|---|
| Hardware Used | NVIDIA A100 GPU (Colab) |
| Training Time | ~5 minutes |
| Cloud Provider | Google Colab |
| Carbon Emitted | Negligible |
@misc{layoutlmv3-funsd,
title={LayoutLMv3 Fine-tuned on FUNSD},
author={nnul},
year={2025},
howpublished={\url{https://huggingface.co/your-username/layoutlmv3-finetuned-funsd}},
note={Fine-tuned LayoutLMv3 for key-value extraction from forms}
}