-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Demo notebook for LayoutLMForSequenceClassification #287
Comments
Btw, the demo notebook for fine-tuning |
Hi @NielsRogge, thanks for providing the notebooks! I am working with your demo notebook for fine-tuning LayoutLMForTokenClassification. How can we save the fine-tuned model in order to use it in for inference in the future? I don't see any output file after fine-tuning. Thank you in advance! |
Hi! In HuggingFace, a model can be saved using |
Thank you for your prompt reply! |
@NielsRogge Cant thank you enough . It really helped . I took your code and implemented without installing unlim basically pure transformers . Would love to add to your repo my notebook . |
@NielsRogge I am getting "PicklingError: Can't pickle <class 'layoutlm.data.funsd.InputFeatures'>: import of module 'layoutlm.data.funsd' failed" while preparing a dataloader for FUNSD dataset. Can you please help? |
Hi @monuminu @VishnuGopireddy I have a new notebook that adds visual features from a Resnet-101 backbone in addition to the text + layout features. You can find it here: https://github.com/NielsRogge/Transformers-Tutorials/blob/master/LayoutLM/Add_image_embeddings_to_LayoutLM.ipynb It relies entirely on HuggingFace Transformers, no need for the unilm repo anymore :) |
@NielsRogge Awesome!!! Woking fine. Big thanks. |
@NielsRogge amazing work ! |
Hi @NielsRogge Nice work, I am able to get all the tags for each word. Is there any way/ approach to get correspondence between tags? I mean mapping question to the answer. Thanks... |
Hi @NielsRogge, |
The link seems to be broken - 'Sorry, the file you have requested does not exist.' |
@vinayakk1094 hi, all tutorials can be found here (both for LayoutLM and LayoutLMv2): https://github.com/NielsRogge/Transformers-Tutorials |
Hey there,
I've recently improved LayoutLM in the HuggingFace Transformers library by adding some more documentation + code examples, a demo notebook that illustrates how to fine-tune
LayoutLMForTokenClassification
on the FUNSD dataset, some integration tests that verify whether the implementation in HuggingFace Transformers gives the same output tensors on the same input data as the original implementation, and finallyLayoutLMForSequenceClassification
. My PR was merged yesterday :)However, now I'm also preparing a notebook that illustrates how to fine-tune
LayoutLMForSequenceClassification
on (a small subset of) the RVL-CDIP dataset. However, it doesn't seem to be able to overfit the tiny subset (I have 16 images per class, so as there are 16 labels I have 256 training examples). You can run it here: https://colab.research.google.com/drive/1DUpTi2aL64AuIJ_9g6dGgKfltEEFqQbt?usp=sharingAny feedback is greatly appreciated!
The text was updated successfully, but these errors were encountered: