Open hinneslung opened 4 years ago
it may be vocal size which not matches embedding shape. you can try to modify raw unified_information.py as below.
def explain_local(...)
# ...
if self.regular is None:
assert self.train_dataset is not None, "Training dataset is required"
# sample the training dataset
if len(self.train_dataset) <= self.max_points:
sampled_train_dataset = self.train_dataset
else:
sampled_train_dataset = random.sample(self.train_dataset, k=self.max_points)
training_embeddings = make_bert_embeddings(
# ======================================
# MODIFIED HERE, LANGUAGE param are now added
# ======================================
sampled_train_dataset, self.model, self.device, LANGUAGE=Language.CHINESE
)
# ...
I am following the Text Classification of MultiNLI Sentences using BERT notebook to interpret BERT classification work. When I changed the line
LANGUAGE = Language.ENGLISH
toLANGUAGE = Language.CHINESE
, indicating to use thebert-base-chinese
pre-trained model, the following error occured:I tried with the original dataset as used in the example notebook, and also tried with my own dataset with Chinese texts. Both resulted in the above error. There was no issue when using multilingual model.