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

bugs from bert_tokenizer? #5

Closed yzho0907 closed 5 years ago

yzho0907 commented 5 years ago

I try to train the model by using bert cell, but i find this error during the selection_loader File "/data/young/pytorch_multi_head_selection_re/lib/dataloaders/selection_loader.py", line 69, in pad_bert text = ['[CLS]'] + text + ['[SEP]'] TypeError: can only concatenate list (not "str") to list any idea to fix it?

yzho0907 commented 5 years ago

should add a tokenizer before pass it to padding? like: self.pad_bert(self.bert_tokenizer.tokenize(text), bio, selection)

yzho0907 commented 5 years ago

self.pad_bert(self.bert_tokenizer.tokenize(text), bio, selection)