Transformers-Tutorials icon indicating copy to clipboard operation
Transformers-Tutorials copied to clipboard

How to save the predicted output from LayoutLM or LayoutLMv2 ?

Open karndeepsingh opened this issue 3 years ago • 2 comments

I trained LayoutLM for my dataset and I am getting predictions at the word level like in the image "ALVARO FRANCISCO MONTOYA" is true labeled as "party_name_1" but while prediction "ALVARO " is tagged as "party_name_1", "FRANCISCO" is tagged as "party_name_1", "MONTOYA" is tagged as "party_name_1". In short, i am getting prediction for each word but how to save these prediction as one predicted output like "ALVARO FRANCISCO MONTOYA" as "party_name_1". How to save this as a single output? Any help would be greatful. Below image is the predicted output image from LayoutLM. download (2) (2)

karndeepsingh avatar Mar 31 '22 11:03 karndeepsingh

Use BIO tagging. Instead of using the label party_name_1 for each word in ALVARO FRANCISCO MONTOYA, map ALVARO : b-party_name_1, FRANCISCO : i-party_name_1, MONTOYA : i-party_name_1

sankalp-wns avatar May 18 '22 15:05 sankalp-wns

@karndeepsingh ,

This issue is resolved in LayoutLMV3.

jyotiyadav94 avatar Jun 03 '22 22:06 jyotiyadav94