Transformers-Tutorials icon indicating copy to clipboard operation
Transformers-Tutorials copied to clipboard

How to run LayoutLMv3 on my custom image for Text classification

Open vikasr111 opened this issue 1 year ago • 1 comments

I am following this LayoutLMv3 guide to finetune and evaluate on FUNSD dataset: https://github.com/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv3/Fine_tune_LayoutLMv3_on_FUNSD_(HuggingFace_Trainer).ipynb

I have been able to successfully run this in the Google Colab. But I am running into multiple issues when I try to run it on my custom images. Is there any guide available on how to run get prediction on my own image and visualize the result?

All the example that I came across show the finetuning and then usage example on test dataset only. While running it on my own image, I have tried setting apply_ocr=True and also used tesseract for OCR but didn't get the result.

Another problem is I ran into is lack of labels. When I use my custom image I don't have any NER tags on them to use it as labels. How to handle this scenario?

vikasr111 avatar Oct 19 '23 21:10 vikasr111

@vikasr111 did the uploaded notebook work for you? I get arrow type error in the Feature mapping part.

Davo00 avatar Nov 13 '23 11:11 Davo00