I am trying to implement the BiDAF model for a Sinhala question answering dataset.
This dataset is created by translating a portion of SQuAD into Sinhala language using Google translate.
And I am using Google colab for this.
I found a code which is implemented BiDAF for SQuAD (english) dataset using pytorch.
And I modified it for my dataset.
I changed some data pre-processing steps and used fastText word embeddings instead of GloVe word embeddings.
I got lot of issues on the way through.
I solved many of them. But this one seems to be very difficult to understand because I am very new to pytorch.
This is my final year research project as well.
I kindly request someone to take a look at this issue and solve it for me. Any kind of help is highly appreciated. Thanks in advance.
@Abhilash_Srivastava Thank you very much for replying.
I added the notebook link for my code. And I thought it would help you guys.
Anyway I will try what you suggested.
The error points towards an invalid target index. Assuming your max. target value is 545 it would mean you are dealing with 546 classes and the model output should have the shape [batch_size, 546] for a multi-class classification use case.
This error is raised, if the size of dim1 is smaller than the max. target index, so you would have to check the model output.