WindChimeRan / pytorch_multi_head_selection_re

BERT + reproduce "Joint entity recognition and relation extraction as a multi-head selection problem" for Chinese and English IE
138 stars 31 forks source link

NER part #15

Closed littleflow3r closed 4 years ago

littleflow3r commented 4 years ago

Hey @WindChimeRan ! Much thanks for your effort!

I have one question. Why do you only extract the BIO part in your preprocessing, and exclude the entity type such as ORG, LOC, etc... ? When I processed the data including the entity type (I also adjusted the bio_vocab.json to include all of the entity type), it worked without any error halfway training and then threw an error as below (first epoch):

L: 49.30, L_crf: 45.91, L_selection: 3.39, epoch: 0/4:: 41%|███████████████████████████████▊ | 38/93 [00:17<00:21, 2.60it/s] /pytorch/aten/src/ATen/native/cuda/IndexKernel.cu:60: lambda [](int)->auto::operator()(int)->auto: block: [0,0,0], thread: [2,0,0] Assertion index >= -sizes[i] && index < sizes[i] && index out of bounds" failed. I think I should modified somewhere in the model but I am not sure where. Could you give me some pointer abt this? Thanks.

littleflow3r commented 4 years ago

Solved it. Thanks!

KyuhwanYeom commented 1 year ago

Solved it. Thanks!

How did you modified code to solve "index out of bounds" error you mentioned above? I'm struggling with this issue too.