Closed ogaloglu closed 3 years ago
Hello, thanks for opening an issue! We try to keep the github issues for bugs/feature requests. Could you ask your question on the forum instead?
Regarding your question: I don't see anything wrong with your implementation! You might be interested in taking a look at the BertForPreTraining
class, which does both MLM + NSP tasks for inspiration
Thanks!
Thank you for the answer and the insight!
And sure, I will do that for those who might have a similar question.
Hi,
I have a question regarding multi-task learning: I would like to do domain adaptation by using masked language modeling task but also want to use token classification as an auxiliary task. For token classification, I want to predict for each token if it is a part of any entity or not (binary prediction.) I implemented a custom
BertForMultiTask
class and would like to ask if I am on the right track as I also couldn't find a similar example:I created this custom class for using two heads by following the example for
BertOnlyMLMHead
:And I created
BertForMultiTask
class by followingBertForMaskedLM
(I have previously created a newBertMultiTaskOutput
class for returning also the entity prediction loss) :Thank you very much in advance!