diff --git "a/264_BERT\351\242\204\350\256\255\347\273\203.ipynb" "b/264_BERT\351\242\204\350\256\255\347\273\203.ipynb" index a58e50e..36b1691 100644 --- "a/264_BERT\351\242\204\350\256\255\347\273\203.ipynb" +++ "b/264_BERT\351\242\204\350\256\255\347\273\203.ipynb" @@ -565,7 +565,7 @@ " if random.random() < 0.5:\n", " masked_token = tokens[mlm_pred_position]\n", " else:\n", - " masked_token = random.randint(0, len(vocab) - 1)\n", + " masked_token = random.choice(vocab.idx_to_token)\n", " mlm_input_tokens[mlm_pred_position] = masked_token\n", " pred_positions_and_labels.append((mlm_pred_position, tokens[mlm_pred_position])) \n", " return mlm_input_tokens, pred_positions_and_labels\n",