Skip to content
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

Improve relation extraction #37

Open
tuongtranegs opened this issue Feb 5, 2023 · 7 comments
Open

Improve relation extraction #37

tuongtranegs opened this issue Feb 5, 2023 · 7 comments

Comments

@tuongtranegs
Copy link

tuongtranegs commented Feb 5, 2023

Hi @jpWang , thanks for your repo,

I have used it for my project: extract keys and values in complicated layout document types

  1. The NER model looks good
  2. The RE model does not work well
    Examples: The outputs of RE model: Q1 -> A2, Q2->A2, Q3 -> A1

I have an idea to improve the RE model as below:
As I know that the RE is based on the semantics of language to learn -> relation classification
From my point of view, they can be learned on position (position embedding) + semantics of language to improve relation classification

To take the good result as bellow:
image

What do you think about my idea?

@logan-markewich
Copy link

Have you looked at the FUNSD dataset? The original version of the dataset contains relation labels, relating questions (i.e. field names) to answers (i.e field values). This seems to be similar to your idea here.

@tuongtranegs
Copy link
Author

@logan-markewich,
No, I want to use the boxes position of entities to model learning while the model here uses only linking about language

@logan-markewich
Copy link

LiLT already uses boxes to learn (and the FUNSD dataset has boxes as well), so I'm not sure what you mean 🤔

@tuongtranegs
Copy link
Author

@logan-markewich,
For XFUND dataset, There are two models to learn: SER(need position) and RE(only relation and not position)

@sudheer997
Copy link

Hi there @tuongtranegs @logan-markewich @NielsRogge @NielsRogge,

I'm wondering if Hugging Face's Transformers library includes support for relation extraction using LiLT. I'm interested in fine-tuning a pre-trained model for relation extraction, but I'm not sure if the library provides this functionality.

Could someone please let me know if relation extraction is supported in Hugging Face's Transformers library, and if so, which pre-trained models are recommended for this task?

Thanks!

@logan-markewich
Copy link

@sudheer997 relation extraction isn't really supported by huggingface. If you want to support it, I suggest using the LiLT model and adding a relation extraction head to it.

@lalitr994
Copy link

@tuongtranegs can you please share the inference code? I am getting an error while initializing the tokenizer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants