From 80d08ad8f1aeecf6bd41ca00d02e86848773e470 Mon Sep 17 00:00:00 2001 From: Richard Wen <45990941+YeQiuO@users.noreply.github.com> Date: Mon, 16 Oct 2023 11:42:33 +0800 Subject: [PATCH] =?UTF-8?q?Update=20264=5FBERT=E9=A2=84=E8=AE=AD=E7=BB=83.?= =?UTF-8?q?ipynb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 代码错误 --- "264_BERT\351\242\204\350\256\255\347\273\203.ipynb" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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",