update the notebook after dataset change
This commit is contained in:
Родитель
9eef3c6a92
Коммит
caf347a32b
|
@ -70,7 +70,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -79,9 +79,19 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[nltk_data] Downloading package punkt to /home/daden/nltk_data...\n",
|
||||
"[nltk_data] Package punkt is already up-to-date!\n",
|
||||
"I1224 02:52:40.350996 139807676634944 file_utils.py:40] PyTorch version 1.2.0 available.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"import sys\n",
|
||||
|
@ -113,7 +123,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"execution_count": 5,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -194,7 +204,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -203,13 +213,12 @@
|
|||
"# The number of lines at the head of data file used for preprocessing. -1 means all the lines.\n",
|
||||
"TOP_N = -1\n",
|
||||
"if QUICK_RUN:\n",
|
||||
" #TOP_N = 10000\n",
|
||||
" TOP_N=20"
|
||||
" TOP_N = 10000"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"execution_count": 7,
|
||||
"metadata": {
|
||||
"scrolled": true
|
||||
},
|
||||
|
@ -218,13 +227,8 @@
|
|||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"I1220 21:53:00.933556 140207304460096 utils.py:173] Opening tar file /tmp/tmpm2eh8iau/cnndm.tar.gz.\n",
|
||||
"I1220 21:53:00.935238 140207304460096 utils.py:181] /tmp/tmpm2eh8iau/test.txt.src already extracted.\n",
|
||||
"I1220 21:53:01.244342 140207304460096 utils.py:181] /tmp/tmpm2eh8iau/test.txt.tgt.tagged already extracted.\n",
|
||||
"I1220 21:53:01.272053 140207304460096 utils.py:181] /tmp/tmpm2eh8iau/train.txt.src already extracted.\n",
|
||||
"I1220 21:53:08.778068 140207304460096 utils.py:181] /tmp/tmpm2eh8iau/train.txt.tgt.tagged already extracted.\n",
|
||||
"I1220 21:53:09.402392 140207304460096 utils.py:181] /tmp/tmpm2eh8iau/val.txt.src already extracted.\n",
|
||||
"I1220 21:53:09.738530 140207304460096 utils.py:181] /tmp/tmpm2eh8iau/val.txt.tgt.tagged already extracted.\n"
|
||||
"100%|██████████| 489k/489k [00:07<00:00, 69.5kKB/s] \n",
|
||||
"I1224 02:52:47.868990 139807676634944 utils.py:173] Opening tar file /tmp/tmpm2eh8iau/cnndm.tar.gz.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@ -241,19 +245,14 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"execution_count": 8,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"I1220 21:53:11.937460 140207304460096 file_utils.py:319] https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-vocab.txt not found in cache or force_download set to True, downloading to /tmp/tmpjgimfb7c\n",
|
||||
"100%|██████████| 231508/231508 [00:00<00:00, 2007349.00B/s]\n",
|
||||
"I1220 21:53:12.196867 140207304460096 file_utils.py:334] copying /tmp/tmpjgimfb7c to cache at ./26bc1ad6c0ac742e9b52263248f6d0f00068293b33709fae12320c0e35ccfbbb.542ce4285a40d23a559526243235df47c5f75c197f04f37d1a0c124c32c9a084\n",
|
||||
"I1220 21:53:12.198070 140207304460096 file_utils.py:338] creating metadata file for ./26bc1ad6c0ac742e9b52263248f6d0f00068293b33709fae12320c0e35ccfbbb.542ce4285a40d23a559526243235df47c5f75c197f04f37d1a0c124c32c9a084\n",
|
||||
"I1220 21:53:12.199477 140207304460096 file_utils.py:347] removing temp file /tmp/tmpjgimfb7c\n",
|
||||
"I1220 21:53:12.200323 140207304460096 tokenization_utils.py:379] loading file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-vocab.txt from cache at ./26bc1ad6c0ac742e9b52263248f6d0f00068293b33709fae12320c0e35ccfbbb.542ce4285a40d23a559526243235df47c5f75c197f04f37d1a0c124c32c9a084\n"
|
||||
"I1224 02:52:59.080935 139807676634944 tokenization_utils.py:379] loading file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-vocab.txt from cache at ./26bc1ad6c0ac742e9b52263248f6d0f00068293b33709fae12320c0e35ccfbbb.542ce4285a40d23a559526243235df47c5f75c197f04f37d1a0c124c32c9a084\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -272,7 +271,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"execution_count": 9,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -287,16 +286,20 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 13,
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"['/tmp/tmpm2eh8iau/processed/0_train']"
|
||||
"['/tmp/tmpm2eh8iau/processed/0_train',\n",
|
||||
" '/tmp/tmpm2eh8iau/processed/1_train',\n",
|
||||
" '/tmp/tmpm2eh8iau/processed/2_train',\n",
|
||||
" '/tmp/tmpm2eh8iau/processed/3_train',\n",
|
||||
" '/tmp/tmpm2eh8iau/processed/4_train']"
|
||||
]
|
||||
},
|
||||
"execution_count": 13,
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
|
@ -307,16 +310,20 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 14,
|
||||
"execution_count": 11,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"['/tmp/tmpm2eh8iau/processed/0_test']"
|
||||
"['/tmp/tmpm2eh8iau/processed/0_test',\n",
|
||||
" '/tmp/tmpm2eh8iau/processed/1_test',\n",
|
||||
" '/tmp/tmpm2eh8iau/processed/2_test',\n",
|
||||
" '/tmp/tmpm2eh8iau/processed/3_test',\n",
|
||||
" '/tmp/tmpm2eh8iau/processed/4_test']"
|
||||
]
|
||||
},
|
||||
"execution_count": 14,
|
||||
"execution_count": 11,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
|
@ -327,7 +334,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"execution_count": 12,
|
||||
"metadata": {
|
||||
"scrolled": true
|
||||
},
|
||||
|
@ -345,14 +352,14 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"execution_count": 13,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"200\n"
|
||||
"2000\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -361,7 +368,7 @@
|
|||
"dict_keys(['src', 'labels', 'segs', 'clss', 'src_txt', 'tgt_txt'])"
|
||||
]
|
||||
},
|
||||
"execution_count": 15,
|
||||
"execution_count": 13,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
|
@ -375,16 +382,16 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"execution_count": 14,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"[0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]"
|
||||
"[0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]"
|
||||
]
|
||||
},
|
||||
"execution_count": 16,
|
||||
"execution_count": 14,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
|
@ -402,7 +409,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 17,
|
||||
"execution_count": 15,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -415,7 +422,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 18,
|
||||
"execution_count": 16,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -459,7 +466,7 @@
|
|||
"BATCH_SIZE = 3000\n",
|
||||
"\n",
|
||||
"# GPU used for training\n",
|
||||
"NUM_GPUS = 1\n",
|
||||
"NUM_GPUS = 2\n",
|
||||
"\n",
|
||||
"# Encoder name. Options are: 1. baseline, classifier, transformer, rnn.\n",
|
||||
"ENCODER = \"transformer\"\n",
|
||||
|
@ -493,13 +500,13 @@
|
|||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"I1220 21:53:53.286549 140207304460096 file_utils.py:319] https://s3.amazonaws.com/models.huggingface.co/bert/distilbert-base-uncased-config.json not found in cache or force_download set to True, downloading to /tmp/tmpksnb8v3a\n",
|
||||
"100%|██████████| 492/492 [00:00<00:00, 541768.85B/s]\n",
|
||||
"I1220 21:53:53.437712 140207304460096 file_utils.py:334] copying /tmp/tmpksnb8v3a to cache at /tmp/tmpr6wt1w_l/a41e817d5c0743e29e86ff85edc8c257e61bc8d88e4271bb1b243b6e7614c633.1ccd1a11c9ff276830e114ea477ea2407100f4a3be7bdc45d37be9e37fa71c7e\n",
|
||||
"I1220 21:53:53.438850 140207304460096 file_utils.py:338] creating metadata file for /tmp/tmpr6wt1w_l/a41e817d5c0743e29e86ff85edc8c257e61bc8d88e4271bb1b243b6e7614c633.1ccd1a11c9ff276830e114ea477ea2407100f4a3be7bdc45d37be9e37fa71c7e\n",
|
||||
"I1220 21:53:53.439659 140207304460096 file_utils.py:347] removing temp file /tmp/tmpksnb8v3a\n",
|
||||
"I1220 21:53:53.440414 140207304460096 configuration_utils.py:157] loading configuration file https://s3.amazonaws.com/models.huggingface.co/bert/distilbert-base-uncased-config.json from cache at /tmp/tmpr6wt1w_l/a41e817d5c0743e29e86ff85edc8c257e61bc8d88e4271bb1b243b6e7614c633.1ccd1a11c9ff276830e114ea477ea2407100f4a3be7bdc45d37be9e37fa71c7e\n",
|
||||
"I1220 21:53:53.441374 140207304460096 configuration_utils.py:174] Model config {\n",
|
||||
"I1224 03:01:19.243283 139807676634944 file_utils.py:319] https://s3.amazonaws.com/models.huggingface.co/bert/distilbert-base-uncased-config.json not found in cache or force_download set to True, downloading to /tmp/tmp7bncjhvm\n",
|
||||
"100%|██████████| 492/492 [00:00<00:00, 531307.30B/s]\n",
|
||||
"I1224 03:01:19.403964 139807676634944 file_utils.py:334] copying /tmp/tmp7bncjhvm to cache at /tmp/tmp0ru6f_af/a41e817d5c0743e29e86ff85edc8c257e61bc8d88e4271bb1b243b6e7614c633.1ccd1a11c9ff276830e114ea477ea2407100f4a3be7bdc45d37be9e37fa71c7e\n",
|
||||
"I1224 03:01:19.404998 139807676634944 file_utils.py:338] creating metadata file for /tmp/tmp0ru6f_af/a41e817d5c0743e29e86ff85edc8c257e61bc8d88e4271bb1b243b6e7614c633.1ccd1a11c9ff276830e114ea477ea2407100f4a3be7bdc45d37be9e37fa71c7e\n",
|
||||
"I1224 03:01:19.406319 139807676634944 file_utils.py:347] removing temp file /tmp/tmp7bncjhvm\n",
|
||||
"I1224 03:01:19.407042 139807676634944 configuration_utils.py:157] loading configuration file https://s3.amazonaws.com/models.huggingface.co/bert/distilbert-base-uncased-config.json from cache at /tmp/tmp0ru6f_af/a41e817d5c0743e29e86ff85edc8c257e61bc8d88e4271bb1b243b6e7614c633.1ccd1a11c9ff276830e114ea477ea2407100f4a3be7bdc45d37be9e37fa71c7e\n",
|
||||
"I1224 03:01:19.407970 139807676634944 configuration_utils.py:174] Model config {\n",
|
||||
" \"activation\": \"gelu\",\n",
|
||||
" \"attention_dropout\": 0.1,\n",
|
||||
" \"dim\": 768,\n",
|
||||
|
@ -525,14 +532,14 @@
|
|||
" \"vocab_size\": 30522\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"I1220 21:53:54.101483 140207304460096 file_utils.py:319] https://s3.amazonaws.com/models.huggingface.co/bert/distilbert-base-uncased-pytorch_model.bin not found in cache or force_download set to True, downloading to /tmp/tmpybj6baev\n",
|
||||
"100%|██████████| 267967963/267967963 [00:04<00:00, 58609030.10B/s]\n",
|
||||
"I1220 21:53:58.841547 140207304460096 file_utils.py:334] copying /tmp/tmpybj6baev to cache at /tmp/tmpr6wt1w_l/7b8a8f0b21c4e7f6962451c9370a5d9af90372a5f64637a251f2de154d0fc72c.c2015533705b9dff680ae707e205a35e2860e8d148b45d35085419d74fe57ac5\n",
|
||||
"I1220 21:53:59.137463 140207304460096 file_utils.py:338] creating metadata file for /tmp/tmpr6wt1w_l/7b8a8f0b21c4e7f6962451c9370a5d9af90372a5f64637a251f2de154d0fc72c.c2015533705b9dff680ae707e205a35e2860e8d148b45d35085419d74fe57ac5\n",
|
||||
"I1220 21:53:59.138775 140207304460096 file_utils.py:347] removing temp file /tmp/tmpybj6baev\n",
|
||||
"I1220 21:53:59.180640 140207304460096 modeling_utils.py:393] loading weights file https://s3.amazonaws.com/models.huggingface.co/bert/distilbert-base-uncased-pytorch_model.bin from cache at /tmp/tmpr6wt1w_l/7b8a8f0b21c4e7f6962451c9370a5d9af90372a5f64637a251f2de154d0fc72c.c2015533705b9dff680ae707e205a35e2860e8d148b45d35085419d74fe57ac5\n",
|
||||
"I1220 21:54:00.468782 140207304460096 configuration_utils.py:157] loading configuration file https://s3.amazonaws.com/models.huggingface.co/bert/distilbert-base-uncased-config.json from cache at /tmp/tmpr6wt1w_l/a41e817d5c0743e29e86ff85edc8c257e61bc8d88e4271bb1b243b6e7614c633.1ccd1a11c9ff276830e114ea477ea2407100f4a3be7bdc45d37be9e37fa71c7e\n",
|
||||
"I1220 21:54:00.471764 140207304460096 configuration_utils.py:174] Model config {\n",
|
||||
"I1224 03:01:19.547294 139807676634944 file_utils.py:319] https://s3.amazonaws.com/models.huggingface.co/bert/distilbert-base-uncased-pytorch_model.bin not found in cache or force_download set to True, downloading to /tmp/tmp_3hdcg7f\n",
|
||||
"100%|██████████| 267967963/267967963 [00:04<00:00, 65856939.79B/s]\n",
|
||||
"I1224 03:01:23.860859 139807676634944 file_utils.py:334] copying /tmp/tmp_3hdcg7f to cache at /tmp/tmp0ru6f_af/7b8a8f0b21c4e7f6962451c9370a5d9af90372a5f64637a251f2de154d0fc72c.c2015533705b9dff680ae707e205a35e2860e8d148b45d35085419d74fe57ac5\n",
|
||||
"I1224 03:01:24.139341 139807676634944 file_utils.py:338] creating metadata file for /tmp/tmp0ru6f_af/7b8a8f0b21c4e7f6962451c9370a5d9af90372a5f64637a251f2de154d0fc72c.c2015533705b9dff680ae707e205a35e2860e8d148b45d35085419d74fe57ac5\n",
|
||||
"I1224 03:01:24.140595 139807676634944 file_utils.py:347] removing temp file /tmp/tmp_3hdcg7f\n",
|
||||
"I1224 03:01:24.175863 139807676634944 modeling_utils.py:393] loading weights file https://s3.amazonaws.com/models.huggingface.co/bert/distilbert-base-uncased-pytorch_model.bin from cache at /tmp/tmp0ru6f_af/7b8a8f0b21c4e7f6962451c9370a5d9af90372a5f64637a251f2de154d0fc72c.c2015533705b9dff680ae707e205a35e2860e8d148b45d35085419d74fe57ac5\n",
|
||||
"I1224 03:01:25.453496 139807676634944 configuration_utils.py:157] loading configuration file https://s3.amazonaws.com/models.huggingface.co/bert/distilbert-base-uncased-config.json from cache at /tmp/tmp0ru6f_af/a41e817d5c0743e29e86ff85edc8c257e61bc8d88e4271bb1b243b6e7614c633.1ccd1a11c9ff276830e114ea477ea2407100f4a3be7bdc45d37be9e37fa71c7e\n",
|
||||
"I1224 03:01:25.456668 139807676634944 configuration_utils.py:174] Model config {\n",
|
||||
" \"activation\": \"gelu\",\n",
|
||||
" \"attention_dropout\": 0.1,\n",
|
||||
" \"dim\": 768,\n",
|
||||
|
@ -558,7 +565,7 @@
|
|||
" \"vocab_size\": 30522\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"I1220 21:54:00.614732 140207304460096 modeling_utils.py:393] loading weights file https://s3.amazonaws.com/models.huggingface.co/bert/distilbert-base-uncased-pytorch_model.bin from cache at /tmp/tmpr6wt1w_l/7b8a8f0b21c4e7f6962451c9370a5d9af90372a5f64637a251f2de154d0fc72c.c2015533705b9dff680ae707e205a35e2860e8d148b45d35085419d74fe57ac5\n"
|
||||
"I1224 03:01:25.601239 139807676634944 modeling_utils.py:393] loading weights file https://s3.amazonaws.com/models.huggingface.co/bert/distilbert-base-uncased-pytorch_model.bin from cache at /tmp/tmp0ru6f_af/7b8a8f0b21c4e7f6962451c9370a5d9af90372a5f64637a251f2de154d0fc72c.c2015533705b9dff680ae707e205a35e2860e8d148b45d35085419d74fe57ac5\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@ -568,7 +575,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 59,
|
||||
"execution_count": 19,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -578,121 +585,118 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 60,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"scrolled": true
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"loss: 35.705171, time: 20.699702, number of examples in current step: 5, step 100 out of total 10000\n",
|
||||
"loss: 33.614549, time: 21.716000, number of examples in current step: 5, step 200 out of total 10000\n",
|
||||
"loss: 32.161929, time: 21.074021, number of examples in current step: 5, step 300 out of total 10000\n",
|
||||
"loss: 31.248698, time: 21.511255, number of examples in current step: 5, step 400 out of total 10000\n",
|
||||
"loss: 31.356782, time: 20.723727, number of examples in current step: 5, step 500 out of total 10000\n",
|
||||
"loss: 30.632976, time: 21.887540, number of examples in current step: 5, step 600 out of total 10000\n",
|
||||
"loss: 30.196731, time: 21.082027, number of examples in current step: 6, step 700 out of total 10000\n",
|
||||
"loss: 30.639471, time: 21.844819, number of examples in current step: 5, step 800 out of total 10000\n",
|
||||
"loss: 30.196533, time: 20.926623, number of examples in current step: 5, step 900 out of total 10000\n",
|
||||
"loss: 30.191796, time: 21.434845, number of examples in current step: 5, step 1000 out of total 10000\n",
|
||||
"loss: 30.495885, time: 20.993397, number of examples in current step: 5, step 1100 out of total 10000\n",
|
||||
"loss: 30.398810, time: 22.044536, number of examples in current step: 5, step 1200 out of total 10000\n",
|
||||
"loss: 30.563597, time: 21.231229, number of examples in current step: 5, step 1300 out of total 10000\n",
|
||||
"loss: 29.913852, time: 21.846574, number of examples in current step: 5, step 1400 out of total 10000\n",
|
||||
"loss: 29.966697, time: 20.929719, number of examples in current step: 5, step 1500 out of total 10000\n",
|
||||
"loss: 29.850745, time: 21.726946, number of examples in current step: 5, step 1600 out of total 10000\n",
|
||||
"loss: 30.064030, time: 21.038953, number of examples in current step: 5, step 1700 out of total 10000\n",
|
||||
"loss: 29.384425, time: 21.891750, number of examples in current step: 2, step 1800 out of total 10000\n",
|
||||
"loss: 29.542826, time: 21.164304, number of examples in current step: 5, step 1900 out of total 10000\n",
|
||||
"loss: 29.368233, time: 21.729423, number of examples in current step: 5, step 2000 out of total 10000\n",
|
||||
"loss: 29.897217, time: 20.885688, number of examples in current step: 5, step 2100 out of total 10000\n",
|
||||
"loss: 28.955702, time: 21.920631, number of examples in current step: 5, step 2200 out of total 10000\n",
|
||||
"loss: 29.168944, time: 20.652082, number of examples in current step: 5, step 2300 out of total 10000\n",
|
||||
"loss: 29.024738, time: 21.605953, number of examples in current step: 5, step 2400 out of total 10000\n",
|
||||
"loss: 28.886404, time: 20.676236, number of examples in current step: 5, step 2500 out of total 10000\n",
|
||||
"loss: 28.935077, time: 21.559490, number of examples in current step: 5, step 2600 out of total 10000\n",
|
||||
"loss: 28.166987, time: 20.780099, number of examples in current step: 5, step 2700 out of total 10000\n",
|
||||
"loss: 27.596512, time: 21.436802, number of examples in current step: 5, step 2800 out of total 10000\n",
|
||||
"loss: 28.518833, time: 20.700445, number of examples in current step: 5, step 2900 out of total 10000\n",
|
||||
"loss: 28.037077, time: 21.611207, number of examples in current step: 5, step 3000 out of total 10000\n",
|
||||
"loss: 27.949670, time: 20.695011, number of examples in current step: 5, step 3100 out of total 10000\n",
|
||||
"loss: 27.567136, time: 21.478218, number of examples in current step: 8, step 3200 out of total 10000\n",
|
||||
"loss: 27.531180, time: 20.588627, number of examples in current step: 5, step 3300 out of total 10000\n",
|
||||
"loss: 26.776694, time: 21.408890, number of examples in current step: 9, step 3400 out of total 10000\n",
|
||||
"loss: 26.813284, time: 20.645501, number of examples in current step: 5, step 3500 out of total 10000\n",
|
||||
"loss: 26.683800, time: 21.558728, number of examples in current step: 5, step 3600 out of total 10000\n",
|
||||
"loss: 25.921678, time: 20.619819, number of examples in current step: 5, step 3700 out of total 10000\n",
|
||||
"loss: 26.077410, time: 21.860998, number of examples in current step: 5, step 3800 out of total 10000\n",
|
||||
"loss: 26.636974, time: 20.638044, number of examples in current step: 5, step 3900 out of total 10000\n",
|
||||
"loss: 25.742668, time: 21.513433, number of examples in current step: 5, step 4000 out of total 10000\n",
|
||||
"loss: 24.708473, time: 20.689856, number of examples in current step: 5, step 4100 out of total 10000\n",
|
||||
"loss: 24.782704, time: 21.566555, number of examples in current step: 5, step 4200 out of total 10000\n",
|
||||
"loss: 24.848932, time: 21.616572, number of examples in current step: 5, step 4300 out of total 10000\n",
|
||||
"loss: 23.519407, time: 20.755903, number of examples in current step: 5, step 4400 out of total 10000\n",
|
||||
"loss: 22.817265, time: 21.491147, number of examples in current step: 5, step 4500 out of total 10000\n",
|
||||
"loss: 22.207907, time: 20.577339, number of examples in current step: 5, step 4600 out of total 10000\n",
|
||||
"loss: 22.295377, time: 21.496679, number of examples in current step: 5, step 4700 out of total 10000\n",
|
||||
"loss: 22.965252, time: 20.695663, number of examples in current step: 5, step 4800 out of total 10000\n",
|
||||
"loss: 22.509197, time: 21.525093, number of examples in current step: 5, step 4900 out of total 10000\n",
|
||||
"loss: 20.583351, time: 20.646291, number of examples in current step: 5, step 5000 out of total 10000\n",
|
||||
"loss: 20.348251, time: 21.552454, number of examples in current step: 5, step 5100 out of total 10000\n",
|
||||
"loss: 20.249200, time: 20.725060, number of examples in current step: 5, step 5200 out of total 10000\n",
|
||||
"loss: 19.258824, time: 21.462859, number of examples in current step: 5, step 5300 out of total 10000\n",
|
||||
"loss: 17.822348, time: 20.987993, number of examples in current step: 5, step 5400 out of total 10000\n",
|
||||
"loss: 17.038601, time: 21.720732, number of examples in current step: 5, step 5500 out of total 10000\n",
|
||||
"loss: 16.602293, time: 20.712011, number of examples in current step: 5, step 5600 out of total 10000\n",
|
||||
"loss: 16.917393, time: 21.915439, number of examples in current step: 5, step 5700 out of total 10000\n",
|
||||
"loss: 17.467426, time: 20.745253, number of examples in current step: 10, step 5800 out of total 10000\n",
|
||||
"loss: 16.622328, time: 21.490287, number of examples in current step: 5, step 5900 out of total 10000\n",
|
||||
"loss: 13.652303, time: 20.551913, number of examples in current step: 5, step 6000 out of total 10000\n",
|
||||
"loss: 13.903904, time: 21.412506, number of examples in current step: 5, step 6100 out of total 10000\n",
|
||||
"loss: 14.111962, time: 20.629999, number of examples in current step: 5, step 6200 out of total 10000\n",
|
||||
"loss: 12.658363, time: 21.632099, number of examples in current step: 5, step 6300 out of total 10000\n",
|
||||
"loss: 12.392262, time: 20.716752, number of examples in current step: 5, step 6400 out of total 10000\n",
|
||||
"loss: 11.626139, time: 21.517132, number of examples in current step: 5, step 6500 out of total 10000\n",
|
||||
"loss: 11.267348, time: 20.689841, number of examples in current step: 5, step 6600 out of total 10000\n",
|
||||
"loss: 11.635910, time: 21.477170, number of examples in current step: 5, step 6700 out of total 10000\n",
|
||||
"loss: 12.101193, time: 20.592640, number of examples in current step: 5, step 6800 out of total 10000\n",
|
||||
"loss: 11.018077, time: 21.399954, number of examples in current step: 5, step 6900 out of total 10000\n",
|
||||
"loss: 9.155422, time: 20.709160, number of examples in current step: 5, step 7000 out of total 10000\n",
|
||||
"loss: 9.673459, time: 21.612552, number of examples in current step: 5, step 7100 out of total 10000\n",
|
||||
"loss: 9.708870, time: 20.670329, number of examples in current step: 5, step 7200 out of total 10000\n",
|
||||
"loss: 8.755084, time: 21.467199, number of examples in current step: 5, step 7300 out of total 10000\n",
|
||||
"loss: 7.942005, time: 20.793214, number of examples in current step: 5, step 7400 out of total 10000\n",
|
||||
"loss: 8.233920, time: 22.216369, number of examples in current step: 5, step 7500 out of total 10000\n",
|
||||
"loss: 7.670865, time: 20.644497, number of examples in current step: 5, step 7600 out of total 10000\n",
|
||||
"loss: 8.376804, time: 21.664812, number of examples in current step: 5, step 7700 out of total 10000\n",
|
||||
"loss: 8.142896, time: 20.710759, number of examples in current step: 5, step 7800 out of total 10000\n",
|
||||
"loss: 7.450985, time: 21.802760, number of examples in current step: 5, step 7900 out of total 10000\n",
|
||||
"loss: 6.650354, time: 20.655127, number of examples in current step: 10, step 8000 out of total 10000\n",
|
||||
"loss: 7.041661, time: 21.893282, number of examples in current step: 5, step 8100 out of total 10000\n"
|
||||
"/dadendev/anaconda3/envs/cm3/lib/python3.6/site-packages/torch/nn/parallel/_functions.py:61: UserWarning: Was asked to gather along dimension 0, but all input tensors were scalars; will instead unsqueeze and return a vector.\n",
|
||||
" warnings.warn('Was asked to gather along dimension 0, but all '\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"loss: 6.526273, time: 22.247599, number of examples in current step: 5, step 8200 out of total 10000\n",
|
||||
"loss: 5.718608, time: 20.802443, number of examples in current step: 5, step 8300 out of total 10000\n",
|
||||
"loss: 5.863779, time: 21.679484, number of examples in current step: 5, step 8400 out of total 10000\n",
|
||||
"loss: 5.775331, time: 20.776518, number of examples in current step: 5, step 8500 out of total 10000\n",
|
||||
"loss: 5.439230, time: 21.519706, number of examples in current step: 5, step 8600 out of total 10000\n",
|
||||
"loss: 6.215319, time: 20.749641, number of examples in current step: 5, step 8700 out of total 10000\n",
|
||||
"loss: 6.318656, time: 21.646634, number of examples in current step: 5, step 8800 out of total 10000\n",
|
||||
"loss: 4.837764, time: 20.833888, number of examples in current step: 5, step 8900 out of total 10000\n",
|
||||
"loss: 4.769266, time: 21.449505, number of examples in current step: 5, step 9000 out of total 10000\n",
|
||||
"loss: 4.849743, time: 20.846905, number of examples in current step: 5, step 9100 out of total 10000\n",
|
||||
"loss: 4.765189, time: 22.010775, number of examples in current step: 5, step 9200 out of total 10000\n",
|
||||
"loss: 4.286385, time: 20.883247, number of examples in current step: 5, step 9300 out of total 10000\n",
|
||||
"loss: 4.207896, time: 21.537331, number of examples in current step: 5, step 9400 out of total 10000\n",
|
||||
"loss: 4.151980, time: 20.909060, number of examples in current step: 5, step 9500 out of total 10000\n",
|
||||
"loss: 4.407137, time: 21.653464, number of examples in current step: 5, step 9600 out of total 10000\n",
|
||||
"loss: 4.215871, time: 20.745822, number of examples in current step: 7, step 9700 out of total 10000\n",
|
||||
"loss: 4.864621, time: 21.670415, number of examples in current step: 5, step 9800 out of total 10000\n",
|
||||
"loss: 3.503241, time: 20.759992, number of examples in current step: 5, step 9900 out of total 10000\n",
|
||||
"loss: 3.773483, time: 21.494518, number of examples in current step: 5, step 10000 out of total 10000\n"
|
||||
"loss: 11.160705, time: 42.738963, number of examples in current step: 5, step 100 out of total 10000\n",
|
||||
"loss: 10.624718, time: 33.611201, number of examples in current step: 5, step 200 out of total 10000\n",
|
||||
"loss: 10.389675, time: 32.889951, number of examples in current step: 5, step 300 out of total 10000\n",
|
||||
"loss: 10.167939, time: 33.669455, number of examples in current step: 5, step 400 out of total 10000\n",
|
||||
"loss: 10.233984, time: 32.727784, number of examples in current step: 5, step 500 out of total 10000\n",
|
||||
"loss: 10.185300, time: 33.506980, number of examples in current step: 5, step 600 out of total 10000\n",
|
||||
"loss: 10.074746, time: 33.141054, number of examples in current step: 5, step 700 out of total 10000\n",
|
||||
"loss: 9.924833, time: 33.621255, number of examples in current step: 5, step 800 out of total 10000\n",
|
||||
"loss: 9.977459, time: 32.910738, number of examples in current step: 5, step 900 out of total 10000\n",
|
||||
"loss: 10.138617, time: 33.722555, number of examples in current step: 5, step 1000 out of total 10000\n",
|
||||
"loss: 10.019123, time: 33.110982, number of examples in current step: 5, step 1100 out of total 10000\n",
|
||||
"loss: 9.932224, time: 33.539944, number of examples in current step: 5, step 1200 out of total 10000\n",
|
||||
"loss: 9.874413, time: 33.243643, number of examples in current step: 5, step 1300 out of total 10000\n",
|
||||
"loss: 10.019798, time: 33.554604, number of examples in current step: 5, step 1400 out of total 10000\n",
|
||||
"loss: 9.941930, time: 32.659071, number of examples in current step: 5, step 1500 out of total 10000\n",
|
||||
"loss: 9.965581, time: 33.646271, number of examples in current step: 5, step 1600 out of total 10000\n",
|
||||
"loss: 9.906829, time: 32.895457, number of examples in current step: 5, step 1700 out of total 10000\n",
|
||||
"loss: 9.761838, time: 33.346933, number of examples in current step: 5, step 1800 out of total 10000\n",
|
||||
"loss: 9.653565, time: 32.784759, number of examples in current step: 5, step 1900 out of total 10000\n",
|
||||
"loss: 9.968359, time: 33.301999, number of examples in current step: 5, step 2000 out of total 10000\n",
|
||||
"loss: 9.669802, time: 32.933510, number of examples in current step: 5, step 2100 out of total 10000\n",
|
||||
"loss: 9.795998, time: 33.465689, number of examples in current step: 5, step 2200 out of total 10000\n",
|
||||
"loss: 9.457577, time: 33.026487, number of examples in current step: 5, step 2300 out of total 10000\n",
|
||||
"loss: 9.442477, time: 33.532822, number of examples in current step: 5, step 2400 out of total 10000\n",
|
||||
"loss: 9.423114, time: 32.843011, number of examples in current step: 9, step 2500 out of total 10000\n",
|
||||
"loss: 9.483082, time: 33.595565, number of examples in current step: 5, step 2600 out of total 10000\n",
|
||||
"loss: 9.364571, time: 33.318575, number of examples in current step: 5, step 2700 out of total 10000\n",
|
||||
"loss: 9.271109, time: 33.604982, number of examples in current step: 5, step 2800 out of total 10000\n",
|
||||
"loss: 9.397103, time: 33.258650, number of examples in current step: 5, step 2900 out of total 10000\n",
|
||||
"loss: 9.216123, time: 33.650533, number of examples in current step: 5, step 3000 out of total 10000\n",
|
||||
"loss: 9.075683, time: 33.350430, number of examples in current step: 5, step 3100 out of total 10000\n",
|
||||
"loss: 9.130850, time: 33.198705, number of examples in current step: 5, step 3200 out of total 10000\n",
|
||||
"loss: 8.824206, time: 33.224638, number of examples in current step: 5, step 3300 out of total 10000\n",
|
||||
"loss: 8.868568, time: 33.060924, number of examples in current step: 5, step 3400 out of total 10000\n",
|
||||
"loss: 8.722790, time: 32.755505, number of examples in current step: 5, step 3500 out of total 10000\n",
|
||||
"loss: 8.659580, time: 33.451256, number of examples in current step: 5, step 3600 out of total 10000\n",
|
||||
"loss: 8.672709, time: 32.872691, number of examples in current step: 5, step 3700 out of total 10000\n",
|
||||
"loss: 8.816822, time: 33.150174, number of examples in current step: 5, step 3800 out of total 10000\n",
|
||||
"loss: 8.577710, time: 33.122264, number of examples in current step: 5, step 3900 out of total 10000\n",
|
||||
"loss: 8.298463, time: 33.289581, number of examples in current step: 5, step 4000 out of total 10000\n",
|
||||
"loss: 7.973340, time: 33.288708, number of examples in current step: 5, step 4100 out of total 10000\n",
|
||||
"loss: 8.057464, time: 33.510597, number of examples in current step: 5, step 4200 out of total 10000\n",
|
||||
"loss: 7.755475, time: 33.627128, number of examples in current step: 5, step 4300 out of total 10000\n",
|
||||
"loss: 7.589542, time: 32.941917, number of examples in current step: 5, step 4400 out of total 10000\n",
|
||||
"loss: 7.465863, time: 33.687425, number of examples in current step: 5, step 4500 out of total 10000\n",
|
||||
"loss: 7.355834, time: 33.047327, number of examples in current step: 9, step 4600 out of total 10000\n",
|
||||
"loss: 7.510208, time: 33.150999, number of examples in current step: 5, step 4700 out of total 10000\n",
|
||||
"loss: 7.576485, time: 32.575946, number of examples in current step: 5, step 4800 out of total 10000\n",
|
||||
"loss: 7.407544, time: 33.408200, number of examples in current step: 8, step 4900 out of total 10000\n",
|
||||
"loss: 6.404705, time: 33.094769, number of examples in current step: 5, step 5000 out of total 10000\n",
|
||||
"loss: 6.388583, time: 33.636447, number of examples in current step: 5, step 5100 out of total 10000\n",
|
||||
"loss: 6.387465, time: 33.023443, number of examples in current step: 7, step 5200 out of total 10000\n",
|
||||
"loss: 6.172295, time: 33.682934, number of examples in current step: 5, step 5300 out of total 10000\n",
|
||||
"loss: 5.910387, time: 32.927547, number of examples in current step: 5, step 5400 out of total 10000\n",
|
||||
"loss: 5.610732, time: 33.525970, number of examples in current step: 5, step 5500 out of total 10000\n",
|
||||
"loss: 5.480320, time: 32.890641, number of examples in current step: 8, step 5600 out of total 10000\n",
|
||||
"loss: 5.666756, time: 33.671984, number of examples in current step: 5, step 5700 out of total 10000\n",
|
||||
"loss: 5.624298, time: 33.269477, number of examples in current step: 5, step 5800 out of total 10000\n",
|
||||
"loss: 5.485603, time: 33.338527, number of examples in current step: 5, step 5900 out of total 10000\n",
|
||||
"loss: 4.310713, time: 33.264881, number of examples in current step: 8, step 6000 out of total 10000\n",
|
||||
"loss: 4.388899, time: 33.266150, number of examples in current step: 5, step 6100 out of total 10000\n",
|
||||
"loss: 4.531266, time: 33.386269, number of examples in current step: 5, step 6200 out of total 10000\n",
|
||||
"loss: 4.106246, time: 33.592953, number of examples in current step: 5, step 6300 out of total 10000\n",
|
||||
"loss: 3.865821, time: 33.039088, number of examples in current step: 5, step 6400 out of total 10000\n",
|
||||
"loss: 3.733040, time: 33.357782, number of examples in current step: 5, step 6500 out of total 10000\n",
|
||||
"loss: 3.614104, time: 32.774119, number of examples in current step: 5, step 6600 out of total 10000\n",
|
||||
"loss: 3.891334, time: 33.554248, number of examples in current step: 4, step 6700 out of total 10000\n",
|
||||
"loss: 3.956822, time: 32.964930, number of examples in current step: 5, step 6800 out of total 10000\n",
|
||||
"loss: 3.269616, time: 33.111120, number of examples in current step: 5, step 6900 out of total 10000\n",
|
||||
"loss: 2.918509, time: 33.147460, number of examples in current step: 5, step 7000 out of total 10000\n",
|
||||
"loss: 3.056451, time: 33.467347, number of examples in current step: 5, step 7100 out of total 10000\n",
|
||||
"loss: 2.952458, time: 33.477996, number of examples in current step: 5, step 7200 out of total 10000\n",
|
||||
"loss: 2.720741, time: 33.587339, number of examples in current step: 9, step 7300 out of total 10000\n",
|
||||
"loss: 2.433647, time: 33.104418, number of examples in current step: 5, step 7400 out of total 10000\n",
|
||||
"loss: 2.596394, time: 33.499696, number of examples in current step: 5, step 7500 out of total 10000\n",
|
||||
"loss: 2.241538, time: 32.668587, number of examples in current step: 5, step 7600 out of total 10000\n",
|
||||
"loss: 2.916792, time: 33.352173, number of examples in current step: 5, step 7700 out of total 10000\n",
|
||||
"loss: 2.863580, time: 33.017576, number of examples in current step: 5, step 7800 out of total 10000\n",
|
||||
"loss: 2.355133, time: 33.476678, number of examples in current step: 5, step 7900 out of total 10000\n",
|
||||
"loss: 1.947071, time: 33.222678, number of examples in current step: 5, step 8000 out of total 10000\n",
|
||||
"loss: 2.197302, time: 33.679664, number of examples in current step: 5, step 8100 out of total 10000\n",
|
||||
"loss: 2.075956, time: 33.209228, number of examples in current step: 5, step 8200 out of total 10000\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"loss: 1.903633, time: 33.575222, number of examples in current step: 5, step 8300 out of total 10000\n",
|
||||
"loss: 1.782045, time: 33.406267, number of examples in current step: 5, step 8400 out of total 10000\n",
|
||||
"loss: 1.894894, time: 32.923071, number of examples in current step: 5, step 8500 out of total 10000\n",
|
||||
"loss: 1.757045, time: 33.201561, number of examples in current step: 5, step 8600 out of total 10000\n",
|
||||
"loss: 1.868286, time: 32.830063, number of examples in current step: 5, step 8700 out of total 10000\n",
|
||||
"loss: 1.843515, time: 33.185594, number of examples in current step: 5, step 8800 out of total 10000\n",
|
||||
"loss: 1.560396, time: 32.747909, number of examples in current step: 5, step 8900 out of total 10000\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@ -712,30 +716,22 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 69,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"I1220 21:05:21.955157 140334900168512 extractive_summarization.py:467] Saving model checkpoint to /tmp/tmp88nx0v51/fine_tuned/extsum_modelname_distilbert-base-uncased_usepreprocessTrue_steps_10000.0.pt\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"summarizer.save_model(\"extsum_modelname_{0}_usepreprocess{1}_steps_{2}.pt\".format(MODEL_NAME, USE_PREPROCSSED_DATA, MAX_STEPS))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 19,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# for loading a previous saved model\n",
|
||||
"import torch\n",
|
||||
"summarizer.model = torch.load(\"cnndm_transformersum_distilbert-base-uncased_bertsum_processed_data.pt\")"
|
||||
"#import torch\n",
|
||||
"#summarizer.model = torch.load(\"cnndm_transformersum_distilbert-base-uncased_bertsum_processed_data.pt\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -749,7 +745,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 20,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -758,42 +754,11 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 21,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"dict_keys(['src', 'labels', 'segs', 'clss', 'src_txt', 'tgt_txt'])"
|
||||
]
|
||||
},
|
||||
"execution_count": 21,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"test_dataset[0].keys()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 22,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"<utils_nlp.models.transformers.extractive_summarization.ExmSumProcessedDataset at 0x7f83d10bfe48>"
|
||||
]
|
||||
},
|
||||
"execution_count": 22,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"test_dataset"
|
||||
"len(target)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -802,86 +767,35 @@
|
|||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"prediction = summarizer.predict(test_dataset, num_gpus=2)"
|
||||
"test_dataset[0].keys()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 76,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"9999"
|
||||
]
|
||||
},
|
||||
"execution_count": 76,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"%%time\n",
|
||||
"prediction = summarizer.predict(test_dataset, num_gpus=NUM_GPUS, batch_size=128)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"len(prediction)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 77,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"scrolled": true
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"9999\n",
|
||||
"9999\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"2019-12-20 21:21:37,446 [MainThread ] [INFO ] Writing summaries.\n",
|
||||
"I1220 21:21:37.446838 140334900168512 pyrouge.py:525] Writing summaries.\n",
|
||||
"2019-12-20 21:21:37,448 [MainThread ] [INFO ] Processing summaries. Saving system files to ./results/tmpc6ug5hr1/system and model files to ./results/tmpc6ug5hr1/model.\n",
|
||||
"I1220 21:21:37.448566 140334900168512 pyrouge.py:518] Processing summaries. Saving system files to ./results/tmpc6ug5hr1/system and model files to ./results/tmpc6ug5hr1/model.\n",
|
||||
"2019-12-20 21:21:37,449 [MainThread ] [INFO ] Processing files in ./results/rouge-tmp-2019-12-20-21-21-36/candidate/.\n",
|
||||
"I1220 21:21:37.449473 140334900168512 pyrouge.py:43] Processing files in ./results/rouge-tmp-2019-12-20-21-21-36/candidate/.\n",
|
||||
"2019-12-20 21:21:38,393 [MainThread ] [INFO ] Saved processed files to ./results/tmpc6ug5hr1/system.\n",
|
||||
"I1220 21:21:38.393011 140334900168512 pyrouge.py:53] Saved processed files to ./results/tmpc6ug5hr1/system.\n",
|
||||
"2019-12-20 21:21:38,395 [MainThread ] [INFO ] Processing files in ./results/rouge-tmp-2019-12-20-21-21-36/reference/.\n",
|
||||
"I1220 21:21:38.395236 140334900168512 pyrouge.py:43] Processing files in ./results/rouge-tmp-2019-12-20-21-21-36/reference/.\n",
|
||||
"2019-12-20 21:21:39,315 [MainThread ] [INFO ] Saved processed files to ./results/tmpc6ug5hr1/model.\n",
|
||||
"I1220 21:21:39.315715 140334900168512 pyrouge.py:53] Saved processed files to ./results/tmpc6ug5hr1/model.\n",
|
||||
"2019-12-20 21:21:39,386 [MainThread ] [INFO ] Written ROUGE configuration to ./results/tmp3weq7kff/rouge_conf.xml\n",
|
||||
"I1220 21:21:39.386249 140334900168512 pyrouge.py:354] Written ROUGE configuration to ./results/tmp3weq7kff/rouge_conf.xml\n",
|
||||
"2019-12-20 21:21:39,387 [MainThread ] [INFO ] Running ROUGE with command /dadendev/pyrouge/tools/ROUGE-1.5.5/ROUGE-1.5.5.pl -e /dadendev/pyrouge/tools/ROUGE-1.5.5/data -c 95 -m -r 1000 -n 2 -a ./results/tmp3weq7kff/rouge_conf.xml\n",
|
||||
"I1220 21:21:39.387300 140334900168512 pyrouge.py:372] Running ROUGE with command /dadendev/pyrouge/tools/ROUGE-1.5.5/ROUGE-1.5.5.pl -e /dadendev/pyrouge/tools/ROUGE-1.5.5/data -c 95 -m -r 1000 -n 2 -a ./results/tmp3weq7kff/rouge_conf.xml\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"---------------------------------------------\n",
|
||||
"1 ROUGE-1 Average_R: 0.47424 (95%-conf.int. 0.47135 - 0.47727)\n",
|
||||
"1 ROUGE-1 Average_P: 0.34068 (95%-conf.int. 0.33832 - 0.34317)\n",
|
||||
"1 ROUGE-1 Average_F: 0.38163 (95%-conf.int. 0.37944 - 0.38388)\n",
|
||||
"---------------------------------------------\n",
|
||||
"1 ROUGE-2 Average_R: 0.19410 (95%-conf.int. 0.19151 - 0.19673)\n",
|
||||
"1 ROUGE-2 Average_P: 0.13952 (95%-conf.int. 0.13752 - 0.14164)\n",
|
||||
"1 ROUGE-2 Average_F: 0.15606 (95%-conf.int. 0.15398 - 0.15813)\n",
|
||||
"---------------------------------------------\n",
|
||||
"1 ROUGE-L Average_R: 0.42931 (95%-conf.int. 0.42643 - 0.43221)\n",
|
||||
"1 ROUGE-L Average_P: 0.30907 (95%-conf.int. 0.30675 - 0.31151)\n",
|
||||
"1 ROUGE-L Average_F: 0.34590 (95%-conf.int. 0.34367 - 0.34808)\n",
|
||||
"\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"rouge_transformer = get_rouge(prediction, target, \"./results/\")"
|
||||
]
|
||||
|
|
Загрузка…
Ссылка в новой задаче