microsoft / unilm

Large-scale Self-supervised Pre-training Across Tasks, Languages, and Modalities
https://aka.ms/GeneralAI
MIT License
19.49k stars 2.48k forks source link

Question regarding the input and output format for relation extraction task #412

Open RishabhMaheshwary opened 3 years ago

RishabhMaheshwary commented 3 years ago

I am using LayoutLMv2 for relation extraction task.

What does the end_index, start_index, head and tail in the inputs represents?

What does the head_id, head and head_type and tail_id, tail and tail_id represent in the outputs?

sz-lcw commented 2 years ago

I am facing the same issue. Anyone can tell the meaning of these variables? @ranpox @donglixp @wolfshow

kumartecblic commented 2 years ago

Hello i not the author but as per me here is the description for following terms. sentence = > my name is obama and i am president. obama => name president => position relation name->position end_index => end character index from document where our relation ends. so character index of president in sentence. start_index => start character index from document where our relation ends. so character index of obama in sentence. head => The index of name entity in entities list. tail => The index of position entity in entities list. I hope it will clear your doubts.