Would this dataset work for SER fine-tuning?

#1
by leitouran - opened

I want to fine-tune a Spanish version of LayoutXLM for semantic entity recognition. By the looks of the XFUN.py, this seems to be prepared for Relation Extraction only. Would it work as well for SER? What addaptations would you suggest to use this dataset for SER?

leitouran changed discussion title from Would this XFUN work for ER fine-tuning? to Would this dataset work for SER fine-tuning?

If you mean NER (named entity recognition), then the answer is yes. You just need to make sure to use the appropriate processor (tokenizer).

Yeah, that's exactly why I'm confused. The xfun.py already preps the dataset for Relation Extraction by default.

image.png

If I were to use this for token classification, wouldn't I need the attention_mask and token_type_ids in my encoded inputs?

Hi,

Ok yes I see that in the script (which I copied from Microsoft's unilm repository), they already tokenize the dataset for you.

Regarding the attention_mask and token_type_ids, these are created when batching the examples together. As seen here, the DataCollatorForKeyValueExtraction class is leveraged for creating batches of examples. This will basically pad the examples to the same length as seen here.

This padding method will create the attention_mask and token_type_ids, as seen here.

So I'd advise you to just copy the data collator and use it for batching the examples together.

Sign up or log in to comment