# Multilabel+multiclass classification

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmultilabel-multiclass-classification%2F18807%3E%5C
**Category:** Beginners\
**Created:** [June 7, 2022, 8:24am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmultilabel-multiclass-classification%2F18807 "2022-06-07T08:24:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyaneos](https://avatars.discourse-cdn.com/v4/letter/k/ba8739/32.png) [@kyaneos](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fkyaneos)%5C
**Post date:** [June 7, 2022, 8:24am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmultilabel-multiclass-classification%2F18807%2F1 "2022-06-07T08:24:20Z")

</div>

Hi,  
I am interested in solving a multilabel+multiclass classification problem, i. e. I have 9 labels and each of these 9 labels can have more than 2 classes.  
I attempted to build 9 classification heads and calculate the loss by averaging the loss of all 9 heads.  
My labels are stored in a list containing 9 elements with the labels for every head. However, the DataCollatorForTokenClassification does not seem to support lists, and I can’t figure out how I can make my data compatible with a DataCollator.  
Is it possible to create a custom DataCollator for this purpose? Or did I miss something which solves my problem?  
Thank you very much in advance.
