Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
thtrieu committed Aug 16, 2019
2 parents 15bb117 + a40d676 commit b84b197
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions colab/Sentiment_Analysis_+_Back_translation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -504,21 +504,25 @@
"* Processing sentences of similar length at the same time.\n",
"* Saving intermediate results during the process.\n",
"\n",
"At its core, the `back_translate.py` script essentially packages two calls to `t2t-decode` from vi -> en and then en -> vi. In the code, we added the ability to save intermediate results after every single batch of data since back-translating the full dataset can take quite a long time."
"At its core, the `back_translate.py` script essentially packages two calls to `t2t-decode` from vi -> en and then en -> vi. We added the ability to save intermediate results after every single batch of data since back-translating the full dataset can take quite a long time."
]
},
{
"cell_type": "code",
"metadata": {
"id": "4ngordrxKCWk",
"colab_type": "code",
"cellView": "both",
"cellView": "form",
"colab": {}
},
"source": [
"output_file = os.path.join(foody_data_dir, 'foody_paraphrased_train.txt')\n",
"\n",
"is_demo = True #@param {type:\"boolean\"}\n",
"is_demo = False #@param {type:\"boolean\"}\n",
"from_ckpt = '/content/vien-translation/checkpoints/translate_vien_iwslt32k_tiny/avg/' # @param{type: \"string\"}\n",
"to_ckpt = '/content/vien-translation/checkpoints/translate_envi_iwslt32k_tiny/avg/' # @param{type: \"string\"}\n",
"\n",
"\n",
"if is_demo:\n",
" paraphrase_from_file = os.path.join(foody_data_dir, 'demo_train.txt')\n",
" paraphrase_to_file = os.path.join(foody_data_dir, 'demo_out.txt')\n",
Expand All @@ -539,6 +543,8 @@
"--decode_hparams=\"beam_size=4,alpha=0.6\" \\\n",
"--paraphrase_from_file=$paraphrase_from_file \\\n",
"--paraphrase_to_file=$paraphrase_to_file \\\n",
"--from_ckpt=$from_ckpt \\\n",
"--to_ckpt=$to_ckpt \\\n",
"--output_dir=/dummy/ \\\n",
"--use_tpu=$use_tpu \\\n",
"--cloud_tpu_name=$tpu_address"
Expand Down

0 comments on commit b84b197

Please sign in to comment.