Tencent / NeuralNLP-NeuralClassifier

An Open-source Neural Hierarchical Multi-label Text Classification Toolkit
Other
1.85k stars 406 forks source link

only support hierarchical text classification with BCELoss? #67

Closed guancheng817 closed 4 years ago

guancheng817 commented 4 years ago

Hi, thanks for your works. One question is that I see "only support hierarchical text classification with BCELoss?" in loss.py, why does it only support with BCELoss? Is it useless for SoftmaxCrossEntropy? Thanks again..

coderbyr commented 4 years ago

Hi, thanks for your works. One question is that I see "only support hierarchical text classification with BCELoss?" in loss.py, why does it only support with BCELoss? Is it useless for SoftmaxCrossEntropy? Thanks again..

Actually, the hierarchical regularization loss is mostly used for multi label classification. The main point of this method is forcing the parameters of parent node and children node to be closely in vector space. so generally, you can also use this loss in other condition as well as you can get the parent and children parameters respectively.