Skip to content

Adding RelationExtraction head to layoutLMv2 and layoutXLM models #15451

@R0bk

Description

@R0bk

🌟 New model head addition

Relation Extraction Head for LayoutLMv2/XLM

Addition description

Hey all,

I've see a bunch of different requests across huggingface issues [0], unilm issues [0][1] and on @NielsRogge Transformer Tutorials issues [0][1] about adding the relation extraction head from layoutlmv2 to the huggingface library. As the model is quite difficult to use in it's current state I was going to write my own layer ontop but I saw in this issue that it may be a good idea to add it to transformers as a separate layoutlmv2/xlm head and thought it would be a good way to contribute back to a library I use so much.

I've gone ahead and added it under my own branch and got it successfully working with the library. Here is a colab using my branch of transformers if you want to test it yourself.

Before I add tests/ write more docs I just wanted to post here first to see if there's interest in potentially merging this in. If there is interest I have a few questions that it would be helpful to get some info on to ensure that I've correctly done the integration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions