# LayoutLM model annotation regarding

**URL:** <https://discuss.huggingface.co/t/layoutlm-model-annotation-regarding/37332>\
**Category:** Beginners\
**Created:** [April 21, 2023, 9:59am UTC](https://discuss.huggingface.co/t/layoutlm-model-annotation-regarding/37332 "2023-04-21T09:59:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jayan](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@Jayan](https://discuss.huggingface.co/u/Jayan)\
**Post date:** [April 21, 2023, 9:59am UTC](https://discuss.huggingface.co/t/layoutlm-model-annotation-regarding/37332/1 "2023-04-21T09:59:55Z")

</div>

Hi  
I am trying to fine tune Layoutlm model with my custom invoice dataset. In the annotation phase, how should I label ? In Funsd dataset, the images are labelled in the Q-A format. For invoice how to do it ? for example, if i have below present in invoice

ABC Technologies LLC  
invoice number : 1234  
invoice date : 21/04/2023

---

<div class="post-metadata">

**Author:** ![cog](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@cog](https://discuss.huggingface.co/u/cog)\
**Post date:** [May 3, 2023, 2:15am UTC](https://discuss.huggingface.co/t/layoutlm-model-annotation-regarding/37332/2 "2023-05-03T02:15:04Z")

</div>

hi.

Maybe that data will tagging like this.

First, data labeling with tag Q-A NER format.  
in this case, funsd label is

```auto
{'header', 'question', 'answer', 'other'}

```

Then, that sentence will tagging like this.

```auto
{"ABC Technologies LLC":header}
{"invoice number : ":question}{"1234":answer}
{"invoice date :" :question} {"21/04/2023":answer}

```

If you will use that NER tagged data to LayoutLM model. make that tagging data to fit model input format.

In LayoutLM finetuning funsd, that use BIO-tag to split word to token.  
Let me show example, not formal tokenize rule just trial to show example.

```auto
{"ABC Technologies LLC":header} 
-> {"ABC":B-header, "Technologies":I-header , "LLC":I-header } 

{"invoice number : ":question}
->{"invoice":B-question,"number : ":I-question}
...

```

After tagging data, fine-tuning LayoutLM model will work fine.

---

<div class="post-metadata">

**Author:** ![Jayan](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@Jayan](https://discuss.huggingface.co/u/Jayan)\
**Post date:** [May 3, 2023, 2:36am UTC](https://discuss.huggingface.co/t/layoutlm-model-annotation-regarding/37332/3 "2023-05-03T02:36:17Z")

</div>

Hi

Thank you for the clarification  
I will try this and let you know
