I am working on a relation extraction and classification problem. The data is in the form of text files. The data is imbalanced. I want to use focal loss function to address class imbalance problem in the data. My question is: Can focal loss be utilized for extraction and classification task to increase the accuracy? Focal loss has been applied on object detection task and for image classification task. The link is below. I want to use this on text classification task.




1 Answer 1


From Focal Loss for Dense Object Detection paper, focal loss is defined as:

$$FL(p_t) = −(1 − p_t)^γ log(p_t)$$

It is a generalized formation of a loss function that can be directly implemented for any classification problem, including text classification.

Focal loss function is designed for problems with 1:1000 training imbalance. Does your data actually have that much imbalance? If not, you can use much simpler methods (i.e., resampling).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.