question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LayoutLMv2 is added to HuggingFace Transformers

See original GitHub issue

Hi,

I’ve added LayoutLMv2 and LayoutXLM to HuggingFace Transformers. I’ve also created several notebooks to fine-tune the model on custom data, as well as to use it for inference. Demo notebooks can be found here. I’ve split them up according to the different datasets: FUNSD, CORD, DocVQA and RVL-CDIP.

For now, you’ve got to install Transformers from master to use it: pip install git+https://github.com/huggingface/transformers.git

The big difference with LayoutLM (v1) is that I’ve now also created a processor called LayoutLMv2Processor. It takes care of all the preprocessing required for the model (i.e. you just give it an image and it returns input_ids, attention_mask, token_type_ids, bbox and image). It uses Tesseract under the hood for OCR. You can also optionally provide your own words and boxes, if you prefer to use your own OCR. All documentation can be found here: https://huggingface.co/transformers/master/model_doc/layoutlmv2.html

Perhaps relevant to the following issues: #333 #335 #351 #329 #356

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:17
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ManuelFaycommented, Sep 21, 2021

Hello Niels, amazing work ! Out of curiosity, will you be adding the LayoutReader as well to the HF ecosystem ? If not, I’ll try to do it eventually but can’t guarantee I will have the time anytime soon.

0reactions
Anas-Alshaghouricommented, Aug 23, 2022

Hello @lalitr994, At what part of the code did you manage for the confidence? Your help is appreciated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

LayoutLMV2 - Hugging Face
class transformers.LayoutLMv2Config ... This is the configuration class to store the configuration of a LayoutLMv2Model. It is used to instantiate an LayoutLMv2 ......
Read more >
Adding RelationExtraction head to layoutLMv2 and layoutXLM ...
Hey all,. I've see a bunch of different requests across huggingface issues [0], unilm issues [0][1] and on @NielsRogge Transformer ...
Read more >
Document AI: Fine-tuning LayoutLM for document ... - philschmid
... LayoutLM for document-understand using Hugging Face Transformers. ... for commercial purposes compared to other LayoutLMv2/LayoutLMv3.
Read more >
Using LayoutLMv2 from HuggingFace Transformers to get ...
I'm trying to use LayoutLMv2 to extract information from some invoice pictures. So far, and based on what is on this documentation, ...
Read more >
[LayoutLMv2] TokenClassifier on CORD - Kaggle
NOTES: you first need to prepare the CORD dataset for LayoutLMv2 . ... !pip install -q git+https://github.com/huggingface/transformers.git !pip install -q ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found