It’s not exactly the same because I’m using one hot enconding : for my 27 classes
I think i found a solution  here :
https://scikit-learn.org/dev/modules/generated/sklearn.metrics.multilabel_confusion_matrix.html 75