# Why is LayoutLMv2 Bad at Token Classification?

**URL:** <https://discuss.huggingface.co/t/why-is-layoutlmv2-bad-at-token-classification/43590>\
**Category:** Beginners\
**Created:** [June 17, 2023, 8:19am UTC](https://discuss.huggingface.co/t/why-is-layoutlmv2-bad-at-token-classification/43590 "2023-06-17T08:19:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fffiend](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@fffiend](https://discuss.huggingface.co/u/fffiend)\
**Post date:** [June 17, 2023, 8:19am UTC](https://discuss.huggingface.co/t/why-is-layoutlmv2-bad-at-token-classification/43590/1 "2023-06-17T08:19:45Z")

</div>

So for a pretrained model trained on invoice data, I expected this to run pretty smoothly. I gave it the following 9 labels to classify on the invoice document below:

```auto
labels = ['Contact Info','Address','Time','Date','Cost','Title','Table','Logo','Signature']

```

And this is the result (The picture is available on google images if you search “invoice pic”):

 ![Screen Shot 2023-06-17 at 4.18.12 AM](https://us1.discourse-cdn.com/hellohellohello/original/3X/2/6/26582a0a81a0ab0cf11ce89102e2a5f8e6cad12a.jpeg)  
This is just a screenshot of the full document, and I haven’t truncated anything. I thought this was supposed to give you great results right out of the box but apparently not? It’s grabbing all the text, but it’s heavily misclassifying it.

Any tips on what to do?

P.S: Can LayoutLMv2 be used to extract the layout of GUI software screenshots perhaps? Or is there already another model that does that?

Thanks.
