diff --git "a/transformer_train.ipynb" "b/transformer_train.ipynb" new file mode 100644--- /dev/null +++ "b/transformer_train.ipynb" @@ -0,0 +1,3042 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "id": "FOwRggVcwtzP" + }, + "outputs": [], + "source": [ + "from transformer import Transformer\n", + "import torch\n", + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "id": "6TApzOj5xCwR" + }, + "outputs": [], + "source": [ + "english_file = 'dataset/english.txt'\n", + "spanish_file = 'dataset/spanish.txt'\n", + "\n", + "START_TOKEN = ''\n", + "PADDING_TOKEN = ''\n", + "END_TOKEN = ''\n", + "\n", + "english_vocabulary = [START_TOKEN, ' ', '!', '\"', '#', '$', '%', '&', \"'\", '(', ')', '*', '+', ',', '-', '.', '/', '’', '‘', ';', '₂',\n", + " '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n", + " ':', '<', '=', '>', '?', '@',\n", + " '[', '\\\\', ']', '^', '_', '`', \n", + " 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',\n", + " 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', \n", + " 'y', 'z', \n", + " 'á', 'é', 'í', 'ó', 'ú', 'ñ', 'ü',\n", + " '¿', '¡',\n", + " 'Á', 'É', 'Í', 'Ó', 'Ú', 'Ñ', 'Ü',\n", + " '{', '|', '}', '~', PADDING_TOKEN, END_TOKEN,\n", + " 'à', 'è', 'ì', 'ò', 'ù', 'À', 'È', 'Ì', 'Ò', 'Ù',\n", + " 'â', 'ê', 'î', 'ô', 'û', 'Â', 'Ê', 'Î', 'Ô', 'Û',\n", + " 'ä', 'ë', 'ï', 'ö', 'ü', 'Ä', 'Ë', 'Ï', 'Ö',\n", + " 'ã', 'õ', 'Ã', 'Õ',\n", + " 'ā', 'ē', 'ī', 'ō', 'ū', 'Ā', 'Ē', 'Ī', 'Ō', 'Ū',\n", + " 'ą', 'ę', 'į', 'ǫ', 'ų', 'Ą', 'Ę', 'Į', 'Ǫ', 'Ų',\n", + " 'ç', 'Ç', 'ş', 'Ş', 'ğ', 'Ğ', 'ń', 'Ń', 'ś', 'Ś', 'ź', 'Ź', 'ż', 'Ż',\n", + " 'č', 'Č', 'ć', 'Ć', 'đ', 'Đ', 'ł', 'Ł', 'ř', 'Ř', 'š', 'Š', 'ť', 'Ť',\n", + " 'ý', 'ÿ', 'Ý', 'Ÿ', 'ž', 'Ž', 'ß', 'œ', 'Œ', 'æ', 'Æ', 'å', 'Å', 'ø', 'Ø', 'å', 'Å',\n", + " 'æ', 'Æ', 'œ', 'Œ']\n", + "\n", + "spanish_vocabulary = [START_TOKEN, ' ', '!', '\"', '#', '$', '%', '&', \"'\", '(', ')', '*', '+', ',', '-', '.', '/', '’', '‘', ';', '₂',\n", + " '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n", + " ':', '<', '=', '>', '?', '@',\n", + " '[', '\\\\', ']', '^', '_', '`', \n", + " 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',\n", + " 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', \n", + " 'y', 'z', \n", + " 'á', 'é', 'í', 'ó', 'ú', 'ñ', 'ü',\n", + " '¿', '¡',\n", + " 'Á', 'É', 'Í', 'Ó', 'Ú', 'Ñ', 'Ü',\n", + " '{', '|', '}', '~', PADDING_TOKEN, END_TOKEN,\n", + " 'à', 'è', 'ì', 'ò', 'ù', 'À', 'È', 'Ì', 'Ò', 'Ù',\n", + " 'â', 'ê', 'î', 'ô', 'û', 'Â', 'Ê', 'Î', 'Ô', 'Û',\n", + " 'ä', 'ë', 'ï', 'ö', 'ü', 'Ä', 'Ë', 'Ï', 'Ö',\n", + " 'ã', 'õ', 'Ã', 'Õ',\n", + " 'ā', 'ē', 'ī', 'ō', 'ū', 'Ā', 'Ē', 'Ī', 'Ō', 'Ū',\n", + " 'ą', 'ę', 'į', 'ǫ', 'ų', 'Ą', 'Ę', 'Į', 'Ǫ', 'Ų',\n", + " 'ç', 'Ç', 'ş', 'Ş', 'ğ', 'Ğ', 'ń', 'Ń', 'ś', 'Ś', 'ź', 'Ź', 'ż', 'Ż',\n", + " 'č', 'Č', 'ć', 'Ć', 'đ', 'Đ', 'ł', 'Ł', 'ř', 'Ř', 'š', 'Š', 'ť', 'Ť',\n", + " 'ý', 'ÿ', 'Ý', 'Ÿ', 'ž', 'Ž', 'ß', 'œ', 'Œ', 'æ', 'Æ', 'å', 'Å', 'ø', 'Ø', 'å', 'Å',\n", + " 'æ', 'Æ', 'œ', 'Œ']\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "id": "gA8ESmCrNoc7" + }, + "outputs": [], + "source": [ + "index_to_english = {k:v for k,v in enumerate(english_vocabulary)}\n", + "english_to_index = {v:k for k,v in enumerate(english_vocabulary)}\n", + "index_to_spanish = {k:v for k,v in enumerate(spanish_vocabulary)}\n", + "spanish_to_index = {v:k for k,v in enumerate(spanish_vocabulary)}" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "id": "9SYGjRdoxRg-" + }, + "outputs": [], + "source": [ + "with open(english_file, 'r') as file:\n", + " english_sentences = file.readlines()\n", + "with open(spanish_file, 'r') as file:\n", + " spanish_sentences = file.readlines()\n", + "\n", + "TOTAL_SENTENCES = 110000\n", + "english_sentences = english_sentences[:TOTAL_SENTENCES]\n", + "spanish_sentences = spanish_sentences[:TOTAL_SENTENCES]\n", + "english_sentences = [sentence.rstrip('\\n').lower() for sentence in english_sentences]\n", + "spanish_sentences = [sentence.rstrip('\\n').lower() for sentence in spanish_sentences]" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "CUB-BkgFxXfM", + "outputId": "bcf7e19c-d1df-4b69-bdfa-eb74ac1a4338" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "['english', 'go.', 'go.', 'go.', 'go.', 'hi.', 'run!', 'run.', 'who?', 'fire!']" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "english_sentences[:10]" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "8OT-aznAxc5U", + "outputId": "716c4145-fdc2-4bb0-e883-c3dcad30c2da" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "['spanish',\n", + " 've.',\n", + " 'vete.',\n", + " 'vaya.',\n", + " 'váyase.',\n", + " 'hola.',\n", + " '¡corre!',\n", + " 'corred.',\n", + " '¿quién?',\n", + " '¡fuego!']" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "spanish_sentences[:10]" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "h8VAutsTxlaR", + "outputId": "ff8fba72-020d-4f0c-b3c5-31c102b6fe9b" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "97th percentile length English: 48.0\n", + "97th percentile length Spanish: 53.0\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "PERCENTILE = 97\n", + "print( f\"{PERCENTILE}th percentile length English: {np.percentile([len(x) for x in english_sentences], PERCENTILE)}\" )\n", + "print( f\"{PERCENTILE}th percentile length Spanish: {np.percentile([len(x) for x in spanish_sentences], PERCENTILE)}\" )\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "HG9ezqvaxl4b", + "outputId": "d13be774-ca07-4333-856e-76186f71caae" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Number of sentences: 110000\n", + "Number of valid sentences: 109964\n" + ] + } + ], + "source": [ + "max_sequence_length = 200\n", + "\n", + "def is_valid_tokens(sentence, vocab):\n", + " for token in list(set(sentence)):\n", + " if token not in vocab:\n", + " return False\n", + " return True\n", + "\n", + "def is_valid_length(sentence, max_sequence_length):\n", + " return len(list(sentence)) < (max_sequence_length - 1) # need to re-add the end token so leaving 1 space\n", + "\n", + "valid_sentence_indicies = []\n", + "for index in range(len(spanish_sentences)):\n", + " spanish_sentence, english_sentence = spanish_sentences[index], english_sentences[index]\n", + " if is_valid_length(spanish_sentence, max_sequence_length) \\\n", + " and is_valid_length(english_sentence, max_sequence_length) \\\n", + " and is_valid_tokens(spanish_sentence, spanish_vocabulary):\n", + " valid_sentence_indicies.append(index)\n", + "\n", + "print(f\"Number of sentences: {len(spanish_sentences)}\")\n", + "print(f\"Number of valid sentences: {len(valid_sentence_indicies)}\")" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "id": "o80QDn4CxsV7" + }, + "outputs": [], + "source": [ + "english_sentences = [english_sentences[i] for i in valid_sentence_indicies]\n", + "spanish_sentences = [spanish_sentences[i] for i in valid_sentence_indicies]" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "id": "xqOFnclmyxAE" + }, + "outputs": [], + "source": [ + "import torch\n", + "\n", + "d_model = 512\n", + "batch_size = 30\n", + "ffn_hidden = 2048\n", + "num_heads = 8\n", + "drop_prob = 0.1\n", + "num_layers = 1\n", + "max_sequence_length = 200\n", + "kn_vocab_size = len(kannada_vocabulary)\n", + "es_vocab_size = len(spanish_vocabulary)\n", + "\n", + "transformer = Transformer(d_model, \n", + " ffn_hidden,\n", + " num_heads, \n", + " drop_prob, \n", + " num_layers, \n", + " max_sequence_length,\n", + " es_vocab_size,\n", + " english_to_index,\n", + " spanish_to_index,\n", + " START_TOKEN, \n", + " END_TOKEN, \n", + " PADDING_TOKEN)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Zc2hYQk9yxX0", + "outputId": "c060f588-6a2e-4179-9475-5acafd641f1f", + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "Transformer(\n", + " (encoder): Encoder(\n", + " (sentence_embedding): SentenceEmbedding(\n", + " (embedding): Embedding(186, 512)\n", + " (position_encoder): PositionalEncoding()\n", + " (dropout): Dropout(p=0.1, inplace=False)\n", + " )\n", + " (layers): SequentialEncoder(\n", + " (0): EncoderLayer(\n", + " (attention): MultiHeadAttention(\n", + " (qkv_layer): Linear(in_features=512, out_features=1536, bias=True)\n", + " (linear_layer): Linear(in_features=512, out_features=512, bias=True)\n", + " )\n", + " (norm1): LayerNormalization()\n", + " (dropout1): Dropout(p=0.1, inplace=False)\n", + " (ffn): PositionwiseFeedForward(\n", + " (linear1): Linear(in_features=512, out_features=2048, bias=True)\n", + " (linear2): Linear(in_features=2048, out_features=512, bias=True)\n", + " (relu): ReLU()\n", + " (dropout): Dropout(p=0.1, inplace=False)\n", + " )\n", + " (norm2): LayerNormalization()\n", + " (dropout2): Dropout(p=0.1, inplace=False)\n", + " )\n", + " )\n", + " )\n", + " (decoder): Decoder(\n", + " (sentence_embedding): SentenceEmbedding(\n", + " (embedding): Embedding(186, 512)\n", + " (position_encoder): PositionalEncoding()\n", + " (dropout): Dropout(p=0.1, inplace=False)\n", + " )\n", + " (layers): SequentialDecoder(\n", + " (0): DecoderLayer(\n", + " (self_attention): MultiHeadAttention(\n", + " (qkv_layer): Linear(in_features=512, out_features=1536, bias=True)\n", + " (linear_layer): Linear(in_features=512, out_features=512, bias=True)\n", + " )\n", + " (layer_norm1): LayerNormalization()\n", + " (dropout1): Dropout(p=0.1, inplace=False)\n", + " (encoder_decoder_attention): MultiHeadCrossAttention(\n", + " (kv_layer): Linear(in_features=512, out_features=1024, bias=True)\n", + " (q_layer): Linear(in_features=512, out_features=512, bias=True)\n", + " (linear_layer): Linear(in_features=512, out_features=512, bias=True)\n", + " )\n", + " (layer_norm2): LayerNormalization()\n", + " (dropout2): Dropout(p=0.1, inplace=False)\n", + " (ffn): PositionwiseFeedForward(\n", + " (linear1): Linear(in_features=512, out_features=2048, bias=True)\n", + " (linear2): Linear(in_features=2048, out_features=512, bias=True)\n", + " (relu): ReLU()\n", + " (dropout): Dropout(p=0.1, inplace=False)\n", + " )\n", + " (layer_norm3): LayerNormalization()\n", + " (dropout3): Dropout(p=0.1, inplace=False)\n", + " )\n", + " )\n", + " )\n", + " (linear): Linear(in_features=512, out_features=193, bias=True)\n", + ")" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "transformer" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "id": "asUJX-STy7fg" + }, + "outputs": [], + "source": [ + "from torch.utils.data import Dataset, DataLoader\n", + "\n", + "class TextDataset(Dataset):\n", + "\n", + " def __init__(self, english_sentences, spanish_sentences):\n", + " self.english_sentences = english_sentences\n", + " self.spanish_sentences = spanish_sentences\n", + "\n", + " def __len__(self):\n", + " return len(self.english_sentences)\n", + "\n", + " def __getitem__(self, idx):\n", + " return self.english_sentences[idx], self.spanish_sentences[idx]" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "id": "-auNWjkdzDge" + }, + "outputs": [], + "source": [ + "dataset = TextDataset(english_sentences, spanish_sentences)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "roH2A4m4zF4z", + "outputId": "f4353aa8-2f37-43b6-be0f-12aab9a35145" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "109964" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(dataset)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "HGeHNlzozIGF", + "outputId": "ec3596fe-feee-426c-dce8-373fb07080fd" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "('go.', 've.')" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dataset[1]" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "id": "5YDttjQ0zMrv" + }, + "outputs": [], + "source": [ + "train_loader = DataLoader(dataset, batch_size)\n", + "iterator = iter(train_loader)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "9EnjHKB1zM8Y", + "outputId": "1a825e56-6706-46ee-85b5-ed7f0ac657fb", + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[('english', 'go.', 'go.', 'go.', 'go.', 'hi.', 'run!', 'run.', 'who?', 'fire!', 'fire!', 'fire!', 'help!', 'help!', 'help!', 'jump!', 'jump.', 'stop!', 'stop!', 'stop!', 'wait!', 'wait.', 'go on.', 'go on.', 'hello!', 'i ran.', 'i ran.', 'i try.', 'i won!', 'oh no!'), ('spanish', 've.', 'vete.', 'vaya.', 'váyase.', 'hola.', '¡corre!', 'corred.', '¿quién?', '¡fuego!', '¡incendio!', '¡disparad!', '¡ayuda!', '¡socorro! ¡auxilio!', '¡auxilio!', '¡salta!', 'salte.', '¡parad!', '¡para!', '¡pare!', '¡espera!', 'esperen.', 'continúa.', 'continúe.', 'hola.', 'corrí.', 'corría.', 'lo intento.', '¡he ganado!', '¡oh, no!')]\n", + "[('relax.', 'smile.', 'attack!', 'attack!', 'get up.', 'go now.', 'got it!', 'got it?', 'got it?', 'he ran.', 'hop in.', 'hug me.', 'i fell.', 'i know.', 'i left.', 'i lied.', 'i lost.', 'i quit.', 'i quit.', 'i work.', \"i'm 19.\", \"i'm up.\", 'listen.', 'listen.', 'listen.', 'no way!', 'no way!', 'no way!', 'no way!', 'no way!'), ('tomátelo con soda.', 'sonríe.', '¡al ataque!', '¡atacad!', 'levanta.', 've ahora mismo.', '¡lo tengo!', '¿lo pillas?', '¿entendiste?', 'él corrió.', 'métete adentro.', 'abrázame.', 'me caí.', 'yo lo sé.', 'salí.', 'mentí.', 'perdí.', 'dimito.', 'renuncié.', 'estoy trabajando.', 'tengo diecinueve.', 'estoy levantado.', 'escucha.', 'escuche.', 'escuchen.', '¡no puede ser!', 'de ninguna manera.', '¡de ninguna manera!', '¡imposible!', '¡de ningún modo!')]\n", + "[('no way!', 'no way!', 'no way!', 'no way!', 'no way!', 'really?', 'really?', 'thanks.', 'thanks.', 'try it.', 'we try.', 'we won.', 'why me?', 'ask tom.', 'awesome!', 'be calm.', 'be cool.', 'be fair.', 'be kind.', 'be nice.', 'beat it.', 'call me.', 'call me.', 'call me.', 'call us.', 'come in.', 'come in.', 'come in.', 'come on!', 'come on.'), ('¡de eso nada!', '¡ni cagando!', '¡mangos!', '¡minga!', '¡ni en pedo!', '¿en serio?', '¿la verdad?', '¡gracias!', 'gracias.', 'pruébalo.', 'lo procuramos.', 'ganamos.', '¿por qué yo?', 'pregúntale a tom.', '¡órale!', 'mantente en calma.', 'estate tranquilo.', 'sé justo.', 'sean gentiles.', 'sé agradable.', 'pírate.', 'llamame.', 'llamadme.', 'llámame.', 'llámanos.', 'entre.', 'pase.', '¡entren!', '¡órale!', 'ándale.')]\n", + "[('come on.', 'drop it!', 'get tom.', 'get out!', 'get out.', 'get out.', 'get out.', 'get out.', 'get out.', 'go away!', 'go away!', 'go away!', 'go away!', 'go away!', 'go away!', 'go away!', 'go away.', 'go away.', 'go away.', 'go away.', 'go away.', 'go away.', 'go away.', 'go home.', 'go slow.', 'goodbye!', 'goodbye!', 'goodbye!', 'hang on!', 'hang on!'), ('¡órale!', 'suéltalo.', 'agarra a tom.', 'bájate.', 'salte.', 'sal.', 'salí.', 'salid.', 'salgan.', '¡vete de aquí!', '¡lárgate!', '¡salga de aquí!', '¡largo!', '¡vete ya!', '¡órale!', '¡a la calle!', '¡vete de aquí!', '¡lárgate!', '¡largo!', '¡vete ya!', '¡órale!', 'lárguese.', 'váyase.', 'vete a casa.', 'vaya despacio.', '¡hasta luego!', 'hasta la vista.', '¡chau!', '¡espera!', '¡espera un momento!')]\n", + "[('hang on!', 'hang on.', 'he came.', 'he quit.', 'help me!', 'help me.', 'help me.', 'help me.', 'help us.', 'hit tom.', 'hold it!', 'hold on.', 'hold on.', 'hold on.', 'hug tom.', 'i agree.', 'i agree.', 'i bowed.', 'i moved.', 'i moved.', 'i moved.', 'i moved.', 'i slept.', 'i tried.', \"i'll go.\", \"i'm tom.\", \"i'm fat.\", \"i'm fat.\", \"i'm fit.\", \"i'm hit!\"), ('¡un segundo!', 'agarra fuertemente.', 'él vino.', 'él renunció.', 'ayúdame.', 'ayúdame.', 'échame una mano.', 'ayudame.', 'ayúdanos.', 'golpea a tom.', 'espera.', 'resista.', 'resiste.', 'agarra fuertemente.', 'abraza a tom.', 'estoy de acuerdo.', 'de acuerdo.', 'me incliné.', 'me he mudado.', 'me mudé.', 'me trasladé.', 'me he trasladado.', 'dormí.', 'lo intenté.', 'iré.', 'soy tom.', 'estoy gordo.', 'soy gorda.', 'estoy en forma.', 'estoy afectado.')]\n" + ] + } + ], + "source": [ + "for batch_num, batch in enumerate(iterator):\n", + " print(batch)\n", + " if batch_num > 3:\n", + " break" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "id": "XnanjzqtzQi8" + }, + "outputs": [], + "source": [ + "from torch import nn\n", + "\n", + "criterian = nn.CrossEntropyLoss(ignore_index=spanish_to_index[PADDING_TOKEN],\n", + " reduction='none')\n", + "\n", + "for params in transformer.parameters():\n", + " if params.dim() > 1:\n", + " nn.init.xavier_uniform_(params)\n", + "\n", + "optim = torch.optim.Adam(transformer.parameters(), lr=1e-4)\n", + "device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')\n", + "# device = \"cpu\"" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "id": "_saWU5QmVem2" + }, + "outputs": [], + "source": [ + "NEG_INFTY = -1e9\n", + "\n", + "def create_masks(eng_batch, kn_batch):\n", + " num_sentences = len(eng_batch)\n", + " look_ahead_mask = torch.full([max_sequence_length, max_sequence_length] , True)\n", + " look_ahead_mask = torch.triu(look_ahead_mask, diagonal=1)\n", + " encoder_padding_mask = torch.full([num_sentences, max_sequence_length, max_sequence_length] , False)\n", + " decoder_padding_mask_self_attention = torch.full([num_sentences, max_sequence_length, max_sequence_length] , False)\n", + " decoder_padding_mask_cross_attention = torch.full([num_sentences, max_sequence_length, max_sequence_length] , False)\n", + "\n", + " for idx in range(num_sentences):\n", + " eng_sentence_length, kn_sentence_length = len(eng_batch[idx]), len(kn_batch[idx])\n", + " eng_chars_to_padding_mask = np.arange(eng_sentence_length + 1, max_sequence_length)\n", + " kn_chars_to_padding_mask = np.arange(kn_sentence_length + 1, max_sequence_length)\n", + " encoder_padding_mask[idx, :, eng_chars_to_padding_mask] = True\n", + " encoder_padding_mask[idx, eng_chars_to_padding_mask, :] = True\n", + " decoder_padding_mask_self_attention[idx, :, kn_chars_to_padding_mask] = True\n", + " decoder_padding_mask_self_attention[idx, kn_chars_to_padding_mask, :] = True\n", + " decoder_padding_mask_cross_attention[idx, :, eng_chars_to_padding_mask] = True\n", + " decoder_padding_mask_cross_attention[idx, kn_chars_to_padding_mask, :] = True\n", + "\n", + " encoder_self_attention_mask = torch.where(encoder_padding_mask, NEG_INFTY, 0)\n", + " decoder_self_attention_mask = torch.where(look_ahead_mask + decoder_padding_mask_self_attention, NEG_INFTY, 0)\n", + " decoder_cross_attention_mask = torch.where(decoder_padding_mask_cross_attention, NEG_INFTY, 0)\n", + " return encoder_self_attention_mask, decoder_self_attention_mask, decoder_cross_attention_mask" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "ju59VDGLuOqf", + "outputId": "0ad34e31-521a-4ca2-f444-26b5374946f6" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Epoch 0\n", + "Iteration 0 : 6.019732475280762\n", + "English: english\n", + "Spanish Translation: spanish\n", + "Spanish Prediction: íú77e33333ų33.3Ä/åeĐĐŒ..?Ć?Ā???????????????????????8????????????????????????q??]77ÛĐÒĐ88Ō33?Ū&??Ū?eŪ?eešeąÝeeeeå]Ý7e/*ÝÝÒq?ą?ş3Ý8Ý8ĪeÝÝŒeÝÝ8eåå/Öe/eǫ8ö?q/ÝeÝqqqqÖÖ`qÝĐÝqqÒÒÒÒ?Ò\n", + "Evaluation translation (should we go to the mall?) : ('aa',)\n", + "-------------------------------------------\n", + "Iteration 100 : 2.9844906330108643\n", + "English: i'm very hot.\n", + "Spanish Translation: estoy muy cachondo.\n", + "Spanish Prediction: oooe e eo oooo\n", + "Evaluation translation (should we go to the mall?) : ('eoo e oooo.',)\n", + "-------------------------------------------\n", + "Iteration 200 : 2.9213802814483643\n", + "English: i have nothing.\n", + "Spanish Translation: no tengo nada.\n", + "Spanish Prediction: eo o eo ooa.\n", + "Evaluation translation (should we go to the mall?) : ('eo e e e eo.',)\n", + "-------------------------------------------\n", + "Iteration 300 : 2.6449875831604004\n", + "English: there's no rush.\n", + "Spanish Translation: no hay prisa.\n", + "Spanish Prediction: eeeeee e e \n", + "Evaluation translation (should we go to the mall?) : ('es e e e e e e.',)\n", + "-------------------------------------------\n", + "Iteration 400 : 2.369377613067627\n", + "English: tom is too picky.\n", + "Spanish Translation: tomás es muy mañoso.\n", + "Spanish Prediction: eo e tot to o.o.\n", + "Evaluation translation (should we go to the mall?) : ('es to e to e to.',)\n", + "-------------------------------------------\n", + "Iteration 500 : 2.317014217376709\n", + "English: tom was terrified.\n", + "Spanish Translation: tom estaba aterrorizado.\n", + "Spanish Prediction: tom e o e onao.omo.o.\n", + "Evaluation translation (should we go to the mall?) : ('tom e e e emamamama.',)\n", + "-------------------------------------------\n", + "Iteration 600 : 2.53130841255188\n", + "English: tom ate your candy.\n", + "Spanish Translation: tom se comió tus dulces.\n", + "Spanish Prediction: eo ae seesoe eoeaeoaoo..\n", + "Evaluation translation (should we go to the mall?) : ('es es es es esto.',)\n", + "-------------------------------------------\n", + "Iteration 700 : 2.4228038787841797\n", + "English: may i eat something?\n", + "Spanish Translation: ¿puedo comer algo?\n", + "Spanish Prediction: seue e da a aa.\n", + "Evaluation translation (should we go to the mall?) : ('no e es es es a a.',)\n", + "-------------------------------------------\n", + "Iteration 800 : 2.3281898498535156\n", + "English: i met mary yesterday.\n", + "Spanish Translation: ayer me encontré con mary.\n", + "Spanish Prediction: n eu en a aa ma mar..\n", + "Evaluation translation (should we go to the mall?) : ('no e es cun cuna carar.',)\n", + "-------------------------------------------\n", + "Iteration 900 : 2.4039134979248047\n", + "English: everybody likes money.\n", + "Spanish Translation: a todo el mundo le gusta el dinero.\n", + "Spanish Prediction: ¿leu e lselan e eanaaeoe.lsocoeos??\n", + "Evaluation translation (should we go to the mall?) : ('¿¿e es es es lo lo?',)\n", + "-------------------------------------------\n", + "Iteration 1000 : 2.136368751525879\n", + "English: we're all from boston.\n", + "Spanish Translation: todos somos de boston.\n", + "Spanish Prediction: tomom ee o eeneer o. \n", + "Evaluation translation (should we go to the mall?) : ('tom eses es es arararara.',)\n", + "-------------------------------------------\n", + "Iteration 1100 : 2.2196924686431885\n", + "English: she gave him a massage.\n", + "Spanish Translation: ella le dio un masaje.\n", + "Spanish Prediction: es a ma pon ee pe os\n", + "Evaluation translation (should we go to the mall?) : ('es es esta es es asto mies.',)\n", + "-------------------------------------------\n", + "Iteration 1200 : 2.2431554794311523\n", + "English: i hate to be a nuisance.\n", + "Spanish Translation: detesto ser una molestia.\n", + "Spanish Prediction: no o o eu tseo eo. .onn\n", + "Evaluation translation (should we go to the mall?) : ('no ne esto ento conto.',)\n", + "-------------------------------------------\n", + "Iteration 1300 : 2.2038650512695312\n", + "English: are these cups porcelain?\n", + "Spanish Translation: ¿estas tazas son de porcelana?\n", + "Spanish Prediction: ¿t e ee a ees aerduraar.r.?\n", + "Evaluation translation (should we go to the mall?) : ('¿qué que es es es ester.',)\n", + "-------------------------------------------\n", + "Iteration 1400 : 2.054495096206665\n", + "English: this baby is 3 weeks old.\n", + "Spanish Translation: este bebé tiene tres semanas.\n", + "Spanish Prediction: esta eusa eas eoontdos..t..\n", + "Evaluation translation (should we go to the mall?) : ('esta esto esto esto.',)\n", + "-------------------------------------------\n", + "Iteration 1500 : 2.1415395736694336\n", + "English: i'm happy to see you here.\n", + "Spanish Translation: estoy feliz de verte aquí.\n", + "Spanish Prediction: tste qu aeaeerder a truea\n", + "Evaluation translation (should we go to the mall?) : ('te que que esta ar a ara.',)\n", + "-------------------------------------------\n", + "Iteration 1600 : 2.082583427429199\n", + "English: he is an expert at fishing.\n", + "Spanish Translation: él es un experto pescando.\n", + "Spanish Prediction: ¿l hntenaenaar o monta to \n", + "Evaluation translation (should we go to the mall?) : ('¿te este en al a a a a ala ala alado.',)\n", + "-------------------------------------------\n", + "Iteration 1700 : 2.233649253845215\n", + "English: what did you say yesterday?\n", + "Spanish Translation: ¿qué dijiste ayer?\n", + "Spanish Prediction: ttui teeoeee pr r \n", + "Evaluation translation (should we go to the mall?) : ('tom estos ester este de de deres.',)\n", + "-------------------------------------------\n", + "Iteration 1800 : 2.2232067584991455\n", + "English: tennis is my favorite sport.\n", + "Spanish Translation: el tenis es mi deporte favorito.\n", + "Spanish Prediction: ellpa etelteu ee a o lo i .ro.\n", + "Evaluation translation (should we go to the mall?) : ('ellla ella el el el llla llla.',)\n", + "-------------------------------------------\n", + "Iteration 1900 : 1.9595186710357666\n", + "English: i have nothing to do with it.\n", + "Spanish Translation: no tengo nada que ver con eso.\n", + "Spanish Prediction: no qe eu qo o eue eer aon est \n", + "Evaluation translation (should we go to the mall?) : ('no qué que este este ester.',)\n", + "-------------------------------------------\n", + "Iteration 2000 : 2.0934722423553467\n", + "English: can you speak a little slower?\n", + "Spanish Translation: ¿puede hablar un poco más despacio?\n", + "Spanish Prediction: ¿quére qa aa an eurorae de tudoa.\n", + "Evaluation translation (should we go to the mall?) : ('¿pué qué que esta a a pora.',)\n", + "-------------------------------------------\n", + "Iteration 2100 : 2.0101888179779053\n", + "English: tom negotiated a new contract.\n", + "Spanish Translation: tom negoció un nuevo contrato.\n", + "Spanish Prediction: tom to o oe tn eoe o tomtoo.o.\n", + "Evaluation translation (should we go to the mall?) : ('tom to to to to tomo tomo toma.',)\n", + "-------------------------------------------\n", + "Iteration 2200 : 2.004150629043579\n", + "English: she is now well enough to work.\n", + "Spanish Translation: está suficientemente bien como para trabajar.\n", + "Spanish Prediction: ls a li aeaer a o a eaer ea a.eara.eaa a.ar.\n", + "Evaluation translation (should we go to the mall?) : ('el es es esta esta la la la la la la la llllararar l elastastol es el l e l l l l l llla es ella ll es',)\n", + "-------------------------------------------\n", + "Iteration 2300 : 2.2291951179504395\n", + "English: i need to know what's happening.\n", + "Spanish Translation: necesito saber qué ocurre.\n", + "Spanish Prediction: no onteo qa lr eue e oe a \n", + "Evaluation translation (should we go to the mall?) : ('no qué que esta esta por esta.',)\n", + "-------------------------------------------\n", + "Iteration 2400 : 2.2144694328308105\n", + "English: he cut down a tree in the garden.\n", + "Spanish Translation: él tumbó un árbol en el jardín.\n", + "Spanish Prediction: ¿l nesoo qn a a ln dn do o?a\n", + "Evaluation translation (should we go to the mall?) : ('¿por este este este a a a a a a a a de el el astompomontes estomomtos',)\n", + "-------------------------------------------\n", + "Iteration 2500 : 2.22062087059021\n", + "English: what's your favorite ethnic food?\n", + "Spanish Translation: ¿cuál es tu comida étnica favorita?\n", + "Spanish Prediction: ttoes ts qoetomoóo asaaeorpores.des\n", + "Evaluation translation (should we go to the mall?) : ('tom que este de de de de de de de de de desas.',)\n", + "-------------------------------------------\n", + "Iteration 2600 : 1.910857915878296\n", + "English: tom has decided to sell his house.\n", + "Spanish Translation: tom ha decidido vender su casa.\n", + "Spanish Prediction: eom sa de eóoeo di o do eo t \n", + "Evaluation translation (should we go to the mall?) : ('esto es esta esta de de esta de de de de torto.',)\n", + "-------------------------------------------\n", + "Iteration 2700 : 1.9585397243499756\n", + "English: tom and mary just don't hit it off.\n", + "Spanish Translation: tom y mary simplemente no se llevan bien.\n", + "Spanish Prediction: eom e ea eaeaaara a eo eu eaasa.aeaena\n", + "Evaluation translation (should we go to the mall?) : ('esta es esta esta en en esta esta.',)\n", + "-------------------------------------------\n", + "Iteration 2800 : 1.8803805112838745\n", + "English: tom couldn't get in touch with mary.\n", + "Spanish Translation: tom no pudo ponerse en contacto con mary.\n", + "Spanish Prediction: eom lo eree ear es eon a oa.eom ea .\n", + "Evaluation translation (should we go to the mall?) : ('el se es esta esta esta esta esta.',)\n", + "-------------------------------------------\n", + "Iteration 2900 : 2.0509188175201416\n", + "English: tom woke up with a terrible headache.\n", + "Spanish Translation: tom despertó con un terrible dolor de cabeza.\n", + "Spanish Prediction: tom te tarao pomten eo aóaa te . .ce torora.\n", + "Evaluation translation (should we go to the mall?) : ('tom tompor tompor esta de esta de de toma.',)\n", + "-------------------------------------------\n", + "Iteration 3000 : 2.0753114223480225\n", + "English: do you know where he bought his camera?\n", + "Spanish Translation: ¿sabes dónde compró él su cámara de fotos?\n", + "Spanish Prediction: tcaber pe o canaae al du pos ce camas.\n", + "Evaluation translation (should we go to the mall?) : ('tom quiere estar a de esta a de de de de a a parararararas.',)\n", + "-------------------------------------------\n", + "Iteration 3100 : 1.9807583093643188\n", + "English: i worked on sunday, so i had monday off.\n", + "Spanish Translation: trabajé el domingo, así que tuve el lunes libre.\n", + "Spanish Prediction: ¿oe e o es ee eto p taeue pe e enaean r.paeoa.\n", + "Evaluation translation (should we go to the mall?) : ('¿puedo que esta esta par esta para de esta.',)\n", + "-------------------------------------------\n", + "Iteration 3200 : 2.0463008880615234\n", + "English: this melody is familiar to many japanese.\n", + "Spanish Translation: muchos japoneses están familiarizados con esta melodía.\n", + "Spanish Prediction: ei ia eubandr enta eurpn c da os.eumtelta.cani..a.\n", + "Evaluation translation (should we go to the mall?) : ('ella esta esta esta en esta esta el el el el el estas.',)\n", + "-------------------------------------------\n", + "Iteration 3300 : 1.905799388885498\n", + "English: i think this sweater will look good on you.\n", + "Spanish Translation: creo que este suéter te va a quedar muy bien.\n", + "Spanish Prediction: toen que cs a ee e eo le c eue o dee.crent\n", + "Evaluation translation (should we go to the mall?) : ('¿por que esta que en en en esta de de de coma.',)\n", + "-------------------------------------------\n", + "Iteration 3400 : 2.090034246444702\n", + "English: everybody can see that he has a crush on her.\n", + "Spanish Translation: cualquiera puede ver que él está enamorado de ella.\n", + "Spanish Prediction: tuánaueera qoere eer eue es dstasds es o ee as as\n", + "Evaluation translation (should we go to the mall?) : ('tom que es esta de esta esta esta de es es es de es de es desta ca ca ca el de ca es es es esta ca es el el en',)\n", + "-------------------------------------------\n", + "Iteration 3500 : 2.0626943111419678\n", + "English: he didn't succeed in explaining what he wanted.\n", + "Spanish Translation: no consiguió explicar lo que quería.\n", + "Spanish Prediction: to eond dudó dspeeei ea due eue a \n", + "Evaluation translation (should we go to the mall?) : ('tom que está que esta de esta de de de de de de de corara.',)\n", + "-------------------------------------------\n", + "Iteration 3600 : 2.032939910888672\n", + "English: the dampness of the weather is bad for my health.\n", + "Spanish Translation: la humedad del tiempo me hace daño a la salud.\n", + "Spanish Prediction: ta saepno ee ceenpa ae aasi aeso e aa aunano\n", + "Evaluation translation (should we go to the mall?) : ('tom no que esta a esta esta esta a al a a al a al a a al esta a a a a l esca l l a alll al al a a alal al al el al al al al elgalgalal el ellllllllll el elll pal ell esl a al el a el el el al el pal e',)\n", + "-------------------------------------------\n", + "Epoch 1\n", + "Iteration 0 : 3.7869722843170166\n", + "English: english\n", + "Spanish Translation: spanish\n", + "Spanish Prediction: tereoeoa n nn n nn nnnn nnnnnn\n", + "Evaluation translation (should we go to the mall?) : ('el padre la estar la la la la esta la la la la la la la la ll la castasta l l l l la lal lalal l l lalal el el el cal el el elalalalalal elol',)\n", + "-------------------------------------------\n", + "Iteration 100 : 1.86270010471344\n", + "English: i'm very hot.\n", + "Spanish Translation: estoy muy cachondo.\n", + "Spanish Prediction: tstoy ce lonoo..o.\n", + "Evaluation translation (should we go to the mall?) : ('¿estoy esto.',)\n", + "-------------------------------------------\n", + "Iteration 200 : 1.9862295389175415\n", + "English: i have nothing.\n", + "Spanish Translation: no tengo nada.\n", + "Spanish Prediction: ¿o te a ao o.\n", + "Evaluation translation (should we go to the mall?) : ('¿está a a a a a a a a a a a a a a a a a a a a a ala a all.',)\n", + "-------------------------------------------\n", + "Iteration 300 : 1.965863823890686\n", + "English: there's no rush.\n", + "Spanish Translation: no hay prisa.\n", + "Spanish Prediction: eo ea eaeea \n", + "Evaluation translation (should we go to the mall?) : ('es es es es es es es es es es es es es es esol.',)\n", + "-------------------------------------------\n", + "Iteration 400 : 1.5883314609527588\n", + "English: tom is too picky.\n", + "Spanish Translation: tomás es muy mañoso.\n", + "Spanish Prediction: eom s esteu ei o...\n", + "Evaluation translation (should we go to the mall?) : ('esto es es está.',)\n", + "-------------------------------------------\n", + "Iteration 500 : 1.7099920511245728\n", + "English: tom was terrified.\n", + "Spanish Translation: tom estaba aterrorizado.\n", + "Spanish Prediction: tom es a a e rnto..c..o.\n", + "Evaluation translation (should we go to the mall?) : ('tom está tomprero.',)\n", + "-------------------------------------------\n", + "Iteration 600 : 1.7917671203613281\n", + "English: tom ate your candy.\n", + "Spanish Translation: tom se comió tus dulces.\n", + "Spanish Prediction: eom ee eonpsneoeteeeoe..\n", + "Evaluation translation (should we go to the mall?) : ('esto es está esto.',)\n", + "-------------------------------------------\n", + "Iteration 700 : 1.958808422088623\n", + "English: may i eat something?\n", + "Spanish Translation: ¿puedo comer algo?\n", + "Spanish Prediction: eeueno eompn e o.\n", + "Evaluation translation (should we go to the mall?) : ('es es es esta esta.',)\n", + "-------------------------------------------\n", + "Iteration 800 : 1.8442991971969604\n", + "English: i met mary yesterday.\n", + "Spanish Translation: ayer me encontré con mary.\n", + "Spanish Prediction: t oca ds o oo camtcara.\n", + "Evaluation translation (should we go to the mall?) : ('él come conta conta.',)\n", + "-------------------------------------------\n", + "Iteration 900 : 2.013242244720459\n", + "English: everybody likes money.\n", + "Spanish Translation: a todo el mundo le gusta el dinero.\n", + "Spanish Prediction: ¿ eede es ee a aavaanta.mn aeeeno.\n", + "Evaluation translation (should we go to the mall?) : ('¿te esta esta este?',)\n", + "-------------------------------------------\n", + "Iteration 1000 : 1.6881904602050781\n", + "English: we're all from boston.\n", + "Spanish Translation: todos somos de boston.\n", + "Spanish Prediction: tomo telps te tar as.\n", + "Evaluation translation (should we go to the mall?) : ('tom está está tom tom.',)\n", + "-------------------------------------------\n", + "Iteration 1100 : 1.7999248504638672\n", + "English: she gave him a massage.\n", + "Spanish Translation: ella le dio un masaje.\n", + "Spanish Prediction: esla ea eee enaairtnor\n", + "Evaluation translation (should we go to the mall?) : ('¿puedo está esta esto esto?',)\n", + "-------------------------------------------\n", + "Iteration 1200 : 1.8286387920379639\n", + "English: i hate to be a nuisance.\n", + "Spanish Translation: detesto ser una molestia.\n", + "Spanish Prediction: ne o o se en cemo..ot.\n", + "Evaluation translation (should we go to the mall?) : ('él se se conte conte com.',)\n", + "-------------------------------------------\n", + "Iteration 1300 : 1.8762657642364502\n", + "English: are these cups porcelain?\n", + "Spanish Translation: ¿estas tazas son de porcelana?\n", + "Spanish Prediction: ¿psta eunar den ee darriresds\n", + "Evaluation translation (should we go to the mall?) : ('¿qué qué están está?',)\n", + "-------------------------------------------\n", + "Iteration 1400 : 1.7622088193893433\n", + "English: this baby is 3 weeks old.\n", + "Spanish Translation: este bebé tiene tres semanas.\n", + "Spanish Prediction: esoo eo l eo nt eoan mo p.t..\n", + "Evaluation translation (should we go to the mall?) : ('estoy es está esta esta.',)\n", + "-------------------------------------------\n", + "Iteration 1500 : 1.756186604499817\n", + "English: i'm happy to see you here.\n", + "Spanish Translation: estoy feliz de verte aquí.\n", + "Spanish Prediction: tstoy euragaae cer a m uí.\n", + "Evaluation translation (should we go to the mall?) : ('él que esta estar casa.',)\n", + "-------------------------------------------\n", + "Iteration 1600 : 1.6858603954315186\n", + "English: he is an expert at fishing.\n", + "Spanish Translation: él es un experto pescando.\n", + "Spanish Prediction: ¿l esten estarae errtinto \n", + "Evaluation translation (should we go to the mall?) : ('¿te hace esta de este de a de tom?',)\n", + "-------------------------------------------\n", + "Iteration 1700 : 1.6103018522262573\n", + "English: what did you say yesterday?\n", + "Spanish Translation: ¿qué dijiste ayer?\n", + "Spanish Prediction: ¿pué tejodta e u \n", + "Evaluation translation (should we go to the mall?) : ('tom está está esta de com.',)\n", + "-------------------------------------------\n", + "Iteration 1800 : 1.8903272151947021\n", + "English: tennis is my favorite sport.\n", + "Spanish Translation: el tenis es mi deporte favorito.\n", + "Spanish Prediction: ellponge el lu pe ar e puror.da.\n", + "Evaluation translation (should we go to the mall?) : ('ella está está el el la la mary.',)\n", + "-------------------------------------------\n", + "Iteration 1900 : 1.56015145778656\n", + "English: i have nothing to do with it.\n", + "Spanish Translation: no tengo nada que ver con eso.\n", + "Spanish Prediction: no qengo qodoreue nir eonteso.\n", + "Evaluation translation (should we go to the mall?) : ('¿quiero que te te te te tom?',)\n", + "-------------------------------------------\n", + "Iteration 2000 : 1.7369458675384521\n", + "English: can you speak a little slower?\n", + "Spanish Translation: ¿puede hablar un poco más despacio?\n", + "Spanish Prediction: ¿puedortaclar pn porarpás pe peroe?\n", + "Evaluation translation (should we go to the mall?) : ('¿qué te que te te te te tom?',)\n", + "-------------------------------------------\n", + "Iteration 2100 : 1.7568533420562744\n", + "English: tom negotiated a new contract.\n", + "Spanish Translation: tom negoció un nuevo contrato.\n", + "Spanish Prediction: tom no u hó an coevi ton oa os\n", + "Evaluation translation (should we go to the mall?) : ('tom se está está está tomprerte.',)\n", + "-------------------------------------------\n", + "Iteration 2200 : 1.7256996631622314\n", + "English: she is now well enough to work.\n", + "Spanish Translation: está suficientemente bien como para trabajar.\n", + "Spanish Prediction: elta qe ióión e onte einneeanpseara.eoara.o..\n", + "Evaluation translation (should we go to the mall?) : ('esta es está esta esta esta mi esta.',)\n", + "-------------------------------------------\n", + "Iteration 2300 : 1.830100178718567\n", + "English: i need to know what's happening.\n", + "Spanish Translation: necesito saber qué ocurre.\n", + "Spanish Prediction: nocesito qeber eue elheae.\n", + "Evaluation translation (should we go to the mall?) : ('¿cuánto que este este esto?',)\n", + "-------------------------------------------\n", + "Iteration 2400 : 1.8603578805923462\n", + "English: he cut down a tree in the garden.\n", + "Spanish Translation: él tumbó un árbol en el jardín.\n", + "Spanish Prediction: el sivpr sn esbr een an auvdaaa\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres hacer este hacer?',)\n", + "-------------------------------------------\n", + "Iteration 2500 : 1.7750110626220703\n", + "English: what's your favorite ethnic food?\n", + "Spanish Translation: ¿cuál es tu comida étnica favorita?\n", + "Spanish Prediction: ¿cuán qs hu eompno elradi tunir?ce?\n", + "Evaluation translation (should we go to the mall?) : ('tenes que te está de está de de de de tom.',)\n", + "-------------------------------------------\n", + "Iteration 2600 : 1.5351510047912598\n", + "English: tom has decided to sell his house.\n", + "Spanish Translation: tom ha decidido vender su casa.\n", + "Spanish Prediction: tom dabee ióaao eerta oce aosa \n", + "Evaluation translation (should we go to the mall?) : ('esta se de está de esta de de trar de tom.',)\n", + "-------------------------------------------\n", + "Iteration 2700 : 1.5668525695800781\n", + "English: tom and mary just don't hit it off.\n", + "Spanish Translation: tom y mary simplemente no se llevan bien.\n", + "Spanish Prediction: tom e eery ee poenante eo eo daage.acoent\n", + "Evaluation translation (should we go to the mall?) : ('el para está de la está de la de la de la la la la es en el da es esta el e e e esta es es estl es esta esto estel do estol estn tn estol es tor es es es tol estol ta es do tes es el el el es el to to',)\n", + "-------------------------------------------\n", + "Iteration 2800 : 1.500148892402649\n", + "English: tom couldn't get in touch with mary.\n", + "Spanish Translation: tom no pudo ponerse en contacto con mary.\n", + "Spanish Prediction: tom no qaei ear c e es eon a ia.dom lary.\n", + "Evaluation translation (should we go to the mall?) : ('ella la la la de la de la de la de la la la la la la la l la l la ca ll l l l ca la la la la la l la el es el es el el es lalalalalal el es tos es es el es es es talos es es tor es el el es es el el t',)\n", + "-------------------------------------------\n", + "Iteration 2900 : 1.7753657102584839\n", + "English: tom woke up with a terrible headache.\n", + "Spanish Translation: tom despertó con un terrible dolor de cabeza.\n", + "Spanish Prediction: tom te paraa comtmnadontoeaa aes . ae tosrra.\n", + "Evaluation translation (should we go to the mall?) : ('ella te que tom de la de la de la de la de la de de la l la destostora e e de de de estesta deste esteste te te te destesta estr tr estel es tes testestes es testes tes te te te el el e ta ta te te te',)\n", + "-------------------------------------------\n", + "Iteration 3000 : 1.7634834051132202\n", + "English: do you know where he bought his camera?\n", + "Spanish Translation: ¿sabes dónde compró él su cámara de fotos?\n", + "Spanish Prediction: ¿cabes ten o aun re dl ae aanps sce turo??\n", + "Evaluation translation (should we go to the mall?) : ('¿quién que te de la de la a de la a al a al casa?',)\n", + "-------------------------------------------\n", + "Iteration 3100 : 1.7017146348953247\n", + "English: i worked on sunday, so i had monday off.\n", + "Spanish Translation: trabajé el domingo, así que tuve el lunes libre.\n", + "Spanish Prediction: eeena e qs eeragao e taeue eo i ds eantv.eaeaor\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres te que te este de la esta de este?',)\n", + "-------------------------------------------\n", + "Iteration 3200 : 1.8275713920593262\n", + "English: this melody is familiar to many japanese.\n", + "Spanish Translation: muchos japoneses están familiarizados con esta melodía.\n", + "Spanish Prediction: eecha euba dsta ealaóla óa o ean ll a.pan ..a.\n", + "Evaluation translation (should we go to the mall?) : ('ella que te la de estaba esta de la de la la casa.',)\n", + "-------------------------------------------\n", + "Iteration 3300 : 1.6061913967132568\n", + "English: i think this sweater will look good on you.\n", + "Spanish Translation: creo que este suéter te va a quedar muy bien.\n", + "Spanish Prediction: nreo que ts a da i aonqenc cue a cay cannd\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres que te que te que te de la de la de la com?',)\n", + "-------------------------------------------\n", + "Iteration 3400 : 1.84147310256958\n", + "English: everybody can see that he has a crush on her.\n", + "Spanish Translation: cualquiera puede ver que él está enamorado de ella.\n", + "Spanish Prediction: eoanmueera eaeda lerreue el esoa dn esi.o de ll o.\n", + "Evaluation translation (should we go to the mall?) : ('esta que tom que tom que tom de la de la de la de la la de de de de de de de de ca ca l l l l desa la ca estestesta desto to tes to tela tes tes tes tel es',)\n", + "-------------------------------------------\n", + "Iteration 3500 : 1.799903154373169\n", + "English: he didn't succeed in explaining what he wanted.\n", + "Spanish Translation: no consiguió explicar lo que quería.\n", + "Spanish Prediction: éo eontatuir dnpeiói ea eue nue ía \n", + "Evaluation translation (should we go to the mall?) : ('¿qué tienes que te que te la de la de la de la conto?',)\n", + "-------------------------------------------\n", + "Iteration 3600 : 1.8394795656204224\n", + "English: the dampness of the weather is bad for my health.\n", + "Spanish Translation: la humedad del tiempo me hace daño a la salud.\n", + "Spanish Prediction: la caeonodoae aeenpa ei lacereero e ea aulena\n", + "Evaluation translation (should we go to the mall?) : ('¿qué te que te que te que te la esta de la la com?',)\n", + "-------------------------------------------\n", + "Epoch 2\n", + "Iteration 0 : 3.064643144607544\n", + "English: english\n", + "Spanish Translation: spanish\n", + "Spanish Prediction: naoeeeta \n", + "Evaluation translation (should we go to the mall?) : ('¿qué te que te que te te que te tom que te la tom?',)\n", + "-------------------------------------------\n", + "Iteration 100 : 1.6023755073547363\n", + "English: i'm very hot.\n", + "Spanish Translation: estoy muy cachondo.\n", + "Spanish Prediction: estoy auyoaonoo..o.\n", + "Evaluation translation (should we go to the mall?) : ('¿qué qué tom?',)\n", + "-------------------------------------------\n", + "Iteration 200 : 1.6319528818130493\n", + "English: i have nothing.\n", + "Spanish Translation: no tengo nada.\n", + "Spanish Prediction: eo eengo eodo.\n", + "Evaluation translation (should we go to the mall?) : ('¿qué ha está?',)\n", + "-------------------------------------------\n", + "Iteration 300 : 1.5888149738311768\n", + "English: there's no rush.\n", + "Spanish Translation: no hay prisa.\n", + "Spanish Prediction: eo eay eeeetd\n", + "Evaluation translation (should we go to the mall?) : ('¿es es es es es es es eso?',)\n", + "-------------------------------------------\n", + "Iteration 400 : 1.23897123336792\n", + "English: tom is too picky.\n", + "Spanish Translation: tomás es muy mañoso.\n", + "Spanish Prediction: tom s es may maro...\n", + "Evaluation translation (should we go to the mall?) : ('esto es es es esto.',)\n", + "-------------------------------------------\n", + "Iteration 500 : 1.467972993850708\n", + "English: tom was terrified.\n", + "Spanish Translation: tom estaba aterrorizado.\n", + "Spanish Prediction: tom es a a m rnto..oo.o.\n", + "Evaluation translation (should we go to the mall?) : ('este esta esta esta.',)\n", + "-------------------------------------------\n", + "Iteration 600 : 1.4087638854980469\n", + "English: tom ate your candy.\n", + "Spanish Translation: tom se comió tus dulces.\n", + "Spanish Prediction: tom ee uun n ao mmerai..\n", + "Evaluation translation (should we go to the mall?) : ('¿debería es es está esto?',)\n", + "-------------------------------------------\n", + "Iteration 700 : 1.7256287336349487\n", + "English: may i eat something?\n", + "Spanish Translation: ¿puedo comer algo?\n", + "Spanish Prediction: meuedo eomon e lo?\n", + "Evaluation translation (should we go to the mall?) : ('¿quién es es es está tom?',)\n", + "-------------------------------------------\n", + "Iteration 800 : 1.4069797992706299\n", + "English: i met mary yesterday.\n", + "Spanish Translation: ayer me encontré con mary.\n", + "Spanish Prediction: m e ae ds o teo dam cery.\n", + "Evaluation translation (should we go to the mall?) : ('¿cómo qué tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 900 : 1.7681550979614258\n", + "English: everybody likes money.\n", + "Spanish Translation: a todo el mundo le gusta el dinero.\n", + "Spanish Prediction: ¿ toma es aisda ma masta.cn aenero.\n", + "Evaluation translation (should we go to the mall?) : ('¿debe está está tom?',)\n", + "-------------------------------------------\n", + "Iteration 1000 : 1.3770242929458618\n", + "English: we're all from boston.\n", + "Spanish Translation: todos somos de boston.\n", + "Spanish Prediction: eedos eenos ee eorta. \n", + "Evaluation translation (should we go to the mall?) : ('este es un está de tom.',)\n", + "-------------------------------------------\n", + "Iteration 1100 : 1.4796913862228394\n", + "English: she gave him a massage.\n", + "Spanish Translation: ella le dio un masaje.\n", + "Spanish Prediction: ella le lej en cir .a.\n", + "Evaluation translation (should we go to the mall?) : ('¿cuál es es es es esto?',)\n", + "-------------------------------------------\n", + "Iteration 1200 : 1.5352256298065186\n", + "English: i hate to be a nuisance.\n", + "Spanish Translation: detesto ser una molestia.\n", + "Spanish Prediction: eebe o eer en cuner.od.\n", + "Evaluation translation (should we go to the mall?) : ('¿cuánto quién esta tom?',)\n", + "-------------------------------------------\n", + "Iteration 1300 : 1.5618617534637451\n", + "English: are these cups porcelain?\n", + "Spanish Translation: ¿estas tazas son de porcelana?\n", + "Spanish Prediction: eestá eenan een ee eer ira?d?\n", + "Evaluation translation (should we go to the mall?) : ('¿dónde está está está está de está está esto?',)\n", + "-------------------------------------------\n", + "Iteration 1400 : 1.4991856813430786\n", + "English: this baby is 3 weeks old.\n", + "Spanish Translation: este bebé tiene tres semanas.\n", + "Spanish Prediction: es e eibe eoene moac me a.a..\n", + "Evaluation translation (should we go to the mall?) : ('¿dónde es es es es es es está está eso?',)\n", + "-------------------------------------------\n", + "Iteration 1500 : 1.4482184648513794\n", + "English: i'm happy to see you here.\n", + "Spanish Translation: estoy feliz de verte aquí.\n", + "Spanish Prediction: tstoy quligape terda tquí.\n", + "Evaluation translation (should we go to the mall?) : ('¿cómo qué te te tom tom?',)\n", + "-------------------------------------------\n", + "Iteration 1600 : 1.4275410175323486\n", + "English: he is an expert at fishing.\n", + "Spanish Translation: él es un experto pescando.\n", + "Spanish Prediction: él ns pn pstaraa dortundo.\n", + "Evaluation translation (should we go to the mall?) : ('¿qué ha quién este tom tom tom?',)\n", + "-------------------------------------------\n", + "Iteration 1700 : 1.3489837646484375\n", + "English: what did you say yesterday?\n", + "Spanish Translation: ¿qué dijiste ayer?\n", + "Spanish Prediction: ¿pué qejoste t ug \n", + "Evaluation translation (should we go to the mall?) : ('este que esta la la mary.',)\n", + "-------------------------------------------\n", + "Iteration 1800 : 1.5293066501617432\n", + "English: tennis is my favorite sport.\n", + "Spanish Translation: el tenis es mi deporte favorito.\n", + "Spanish Prediction: ml pr getps pá pe ir a pavor.oa.\n", + "Evaluation translation (should we go to the mall?) : ('¿cómo qué está es está esto?',)\n", + "-------------------------------------------\n", + "Iteration 1900 : 1.2975882291793823\n", + "English: i have nothing to do with it.\n", + "Spanish Translation: no tengo nada que ver con eso.\n", + "Spanish Prediction: to tengo qoda cue eerdton elt.\n", + "Evaluation translation (should we go to the mall?) : ('¿qué te tom qué tom tom tom tom tom tom tom?',)\n", + "-------------------------------------------\n", + "Iteration 2000 : 1.5291494131088257\n", + "English: can you speak a little slower?\n", + "Spanish Translation: ¿puede hablar un poco más despacio?\n", + "Spanish Prediction: ¿puedestablar pn paronpás ae aoñid?\n", + "Evaluation translation (should we go to the mall?) : ('¿quién que tom que tom tom?',)\n", + "-------------------------------------------\n", + "Iteration 2100 : 1.550544023513794\n", + "English: tom negotiated a new contract.\n", + "Spanish Translation: tom negoció un nuevo contrato.\n", + "Spanish Prediction: tom nocu ió anabonva aon ae as\n", + "Evaluation translation (should we go to the mall?) : ('¿dónde que tom que tom está tom?',)\n", + "-------------------------------------------\n", + "Iteration 2200 : 1.4942275285720825\n", + "English: she is now well enough to work.\n", + "Spanish Translation: está suficientemente bien como para trabajar.\n", + "Spanish Prediction: elta qepiciónee anta lien eone dara doabaje..\n", + "Evaluation translation (should we go to the mall?) : ('¿qué tiene que tom esta este la la la la la la la la la esca?',)\n", + "-------------------------------------------\n", + "Iteration 2300 : 1.573631763458252\n", + "English: i need to know what's happening.\n", + "Spanish Translation: necesito saber qué ocurre.\n", + "Spanish Prediction: nocesito qaber eue ecupaas\n", + "Evaluation translation (should we go to the mall?) : ('¿qué tienes este esto esto?',)\n", + "-------------------------------------------\n", + "Iteration 2400 : 1.6267869472503662\n", + "English: he cut down a tree in the garden.\n", + "Spanish Translation: él tumbó un árbol en el jardín.\n", + "Spanish Prediction: él sivpi en albrnven en auraeaa\n", + "Evaluation translation (should we go to the mall?) : ('¿de quieres que hace que tom que hacer a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2500 : 1.4244874715805054\n", + "English: what's your favorite ethnic food?\n", + "Spanish Translation: ¿cuál es tu comida étnica favorita?\n", + "Spanish Prediction: ¿cuál es eu pompno clr gi eavirica?\n", + "Evaluation translation (should we go to the mall?) : ('¿qué tenía que tom que tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 2600 : 1.3161983489990234\n", + "English: tom has decided to sell his house.\n", + "Spanish Translation: tom ha decidido vender su casa.\n", + "Spanish Prediction: tom ta eebióoóo derte lu dosa.\n", + "Evaluation translation (should we go to the mall?) : ('¿qué tiene es está en la con esta con esto?',)\n", + "-------------------------------------------\n", + "Iteration 2700 : 1.32162606716156\n", + "English: tom and mary just don't hit it off.\n", + "Spanish Translation: tom y mary simplemente no se llevan bien.\n", + "Spanish Prediction: tom m mary ae poiae te eo eu daago dcuent\n", + "Evaluation translation (should we go to the mall?) : ('¿qué tiene que tom que tom de la esto?',)\n", + "-------------------------------------------\n", + "Iteration 2800 : 1.3094007968902588\n", + "English: tom couldn't get in touch with mary.\n", + "Spanish Translation: tom no pudo ponerse en contacto con mary.\n", + "Spanish Prediction: tom so pudi eors e ds lon r ia don eary.\n", + "Evaluation translation (should we go to the mall?) : ('¿dónde que tom es es está con esta con esto?',)\n", + "-------------------------------------------\n", + "Iteration 2900 : 1.6135778427124023\n", + "English: tom woke up with a terrible headache.\n", + "Spanish Translation: tom despertó con un terrible dolor de cabeza.\n", + "Spanish Prediction: tom secperaó aon lnaprlaocaa aesísaae losara.\n", + "Evaluation translation (should we go to the mall?) : ('esta lo que lo que lo que lo que lo que la con la con esto.',)\n", + "-------------------------------------------\n", + "Iteration 3000 : 1.5261095762252808\n", + "English: do you know where he bought his camera?\n", + "Spanish Translation: ¿sabes dónde compró él su cámara de fotos?\n", + "Spanish Prediction: ¿sabes qende eonpre dl da aonosi ce curo??\n", + "Evaluation translation (should we go to the mall?) : ('ella es que tom que lo que la con la con la mary.',)\n", + "-------------------------------------------\n", + "Iteration 3100 : 1.4485477209091187\n", + "English: i worked on sunday, so i had monday off.\n", + "Spanish Translation: trabajé el domingo, así que tuve el lunes libre.\n", + "Spanish Prediction: meaba é es perinao e í eue eo iran aaner.pabro.\n", + "Evaluation translation (should we go to the mall?) : ('¿de qué tom que te la tom que tom de la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3200 : 1.6862704753875732\n", + "English: this melody is familiar to many japanese.\n", + "Spanish Translation: muchos japoneses están familiarizados con esta melodía.\n", + "Spanish Prediction: eecha eu antr dn a pavin a oa.o dom el a.dina.oa.\n", + "Evaluation translation (should we go to the mall?) : ('¿de qué te que te la la la la la la la la la la la casa?',)\n", + "-------------------------------------------\n", + "Iteration 3300 : 1.4028421640396118\n", + "English: i think this sweater will look good on you.\n", + "Spanish Translation: creo que este suéter te va a quedar muy bien.\n", + "Spanish Prediction: creo que es á qa i qonqe d mue a eey eoen.\n", + "Evaluation translation (should we go to the mall?) : ('¿qué te que tom que tom que tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 3400 : 1.7001128196716309\n", + "English: everybody can see that he has a crush on her.\n", + "Spanish Translation: cualquiera puede ver que él está enamorado de ella.\n", + "Spanish Prediction: taanmueera eoeda eezaeue er es a en esi.o.ee ln o.\n", + "Evaluation translation (should we go to the mall?) : ('¿qué te de la que lo que lo que lo que la la la la maría?',)\n", + "-------------------------------------------\n", + "Iteration 3500 : 1.6334779262542725\n", + "English: he didn't succeed in explaining what he wanted.\n", + "Spanish Translation: no consiguió explicar lo que quería.\n", + "Spanish Prediction: éo eonteóuió enpeimi easeue eue ía \n", + "Evaluation translation (should we go to the mall?) : ('¿qué te que tom la la que tom que tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 3600 : 1.6866817474365234\n", + "English: the dampness of the weather is bad for my health.\n", + "Spanish Translation: la humedad del tiempo me hace daño a la salud.\n", + "Spanish Prediction: ea caeoni oee aeenpo ee eabe eerosa la lelida\n", + "Evaluation translation (should we go to the mall?) : ('¿qué te que te que te que te que te a la la la la la la la la le a a l l l a a a a a lllla l a l llllla a a a a esesima a a ta ta ta ta ta taseseseseseses tes ta es es tes eses ta es es es es er er es',)\n", + "-------------------------------------------\n", + "Epoch 3\n", + "Iteration 0 : 2.5909273624420166\n", + "English: english\n", + "Spanish Translation: spanish\n", + "Spanish Prediction: eeuéaéao n rr nnnn nnnrn.n nnnnnnnn.n..nnnnnn....n.........n?..n?n?..s...nr.n.?.n.nnnnnnan n nnannn? ?n n n\n", + "Evaluation translation (should we go to the mall?) : ('¿dónde que tom que tom que tom esta la la la la la la la la la verererma?',)\n", + "-------------------------------------------\n", + "Iteration 100 : 1.4482184648513794\n", + "English: i'm very hot.\n", + "Spanish Translation: estoy muy cachondo.\n", + "Spanish Prediction: estoy eey casaa..o.\n", + "Evaluation translation (should we go to the mall?) : ('¿qué tom?',)\n", + "-------------------------------------------\n", + "Iteration 200 : 1.4274522066116333\n", + "English: i have nothing.\n", + "Spanish Translation: no tengo nada.\n", + "Spanish Prediction: no hengo eoda.\n", + "Evaluation translation (should we go to the mall?) : ('¿qué te es tom?',)\n", + "-------------------------------------------\n", + "Iteration 300 : 1.404067873954773\n", + "English: there's no rush.\n", + "Spanish Translation: no hay prisa.\n", + "Spanish Prediction: no say arodtd\n", + "Evaluation translation (should we go to the mall?) : ('¿qué es es está eso?',)\n", + "-------------------------------------------\n", + "Iteration 400 : 1.0662879943847656\n", + "English: tom is too picky.\n", + "Spanish Translation: tomás es muy mañoso.\n", + "Spanish Prediction: tom s es uuy paro...\n", + "Evaluation translation (should we go to the mall?) : ('¿qué está está el está está el está eso?',)\n", + "-------------------------------------------\n", + "Iteration 500 : 1.291086196899414\n", + "English: tom was terrified.\n", + "Spanish Translation: tom estaba aterrorizado.\n", + "Spanish Prediction: tom es aba mrrmra..oodo.\n", + "Evaluation translation (should we go to the mall?) : ('espera es es mi casa.',)\n", + "-------------------------------------------\n", + "Iteration 600 : 1.2323647737503052\n", + "English: tom ate your candy.\n", + "Spanish Translation: tom se comió tus dulces.\n", + "Spanish Prediction: tom se uomin ar deroa..\n", + "Evaluation translation (should we go to the mall?) : ('¿debe es es es está esto?',)\n", + "-------------------------------------------\n", + "Iteration 700 : 1.4281946420669556\n", + "English: may i eat something?\n", + "Spanish Translation: ¿puedo comer algo?\n", + "Spanish Prediction: ¿muedo eome e go?\n", + "Evaluation translation (should we go to the mall?) : ('¿qué tiene está el a tom?',)\n", + "-------------------------------------------\n", + "Iteration 800 : 1.2035555839538574\n", + "English: i met mary yesterday.\n", + "Spanish Translation: ayer me encontré con mary.\n", + "Spanish Prediction: mler me ds antea aon meny.\n", + "Evaluation translation (should we go to the mall?) : ('¿dónde que tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 900 : 1.5352203845977783\n", + "English: everybody likes money.\n", + "Spanish Translation: a todo el mundo le gusta el dinero.\n", + "Spanish Prediction: t todo es eicdo eoseusta ms aesest.\n", + "Evaluation translation (should we go to the mall?) : ('¿de quién este esto?',)\n", + "-------------------------------------------\n", + "Iteration 1000 : 1.21847665309906\n", + "English: we're all from boston.\n", + "Spanish Translation: todos somos de boston.\n", + "Spanish Prediction: eedos eenos ae eosto..\n", + "Evaluation translation (should we go to the mall?) : ('¿quién está está esto?',)\n", + "-------------------------------------------\n", + "Iteration 1100 : 1.2860791683197021\n", + "English: she gave him a massage.\n", + "Spanish Translation: ella le dio un masaje.\n", + "Spanish Prediction: ella le gij dn mer a.\n", + "Evaluation translation (should we go to the mall?) : ('¿de qué tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 1200 : 1.3593107461929321\n", + "English: i hate to be a nuisance.\n", + "Spanish Translation: detesto ser una molestia.\n", + "Spanish Prediction: teben o ue una mucer.od.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién este esto quién?',)\n", + "-------------------------------------------\n", + "Iteration 1300 : 1.3567780256271362\n", + "English: are these cups porcelain?\n", + "Spanish Translation: ¿estas tazas son de porcelana?\n", + "Spanish Prediction: ¿está eunón pen pe arr osonds\n", + "Evaluation translation (should we go to the mall?) : ('ella que hablar a me de la media.',)\n", + "-------------------------------------------\n", + "Iteration 1400 : 1.346932291984558\n", + "English: this baby is 3 weeks old.\n", + "Spanish Translation: este bebé tiene tres semanas.\n", + "Spanish Prediction: este pibe eoene lras de a.a..\n", + "Evaluation translation (should we go to the mall?) : ('¿de qué está este estoy esto?',)\n", + "-------------------------------------------\n", + "Iteration 1500 : 1.2784061431884766\n", + "English: i'm happy to see you here.\n", + "Spanish Translation: estoy feliz de verte aquí.\n", + "Spanish Prediction: estoy euliz pe terde pyuí.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería el a tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 1600 : 1.2580188512802124\n", + "English: he is an expert at fishing.\n", + "Spanish Translation: él es un experto pescando.\n", + "Spanish Prediction: él es un psparaa aorauddo.\n", + "Evaluation translation (should we go to the mall?) : ('¿debe quiere que tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 1700 : 1.1434338092803955\n", + "English: what did you say yesterday?\n", + "Spanish Translation: ¿qué dijiste ayer?\n", + "Spanish Prediction: ¿qué tesoste tlur \n", + "Evaluation translation (should we go to the mall?) : ('ella que estaba esta mary.',)\n", + "-------------------------------------------\n", + "Iteration 1800 : 1.3284114599227905\n", + "English: tennis is my favorite sport.\n", + "Spanish Translation: el tenis es mi deporte favorito.\n", + "Spanish Prediction: ns pe emtpstmu pe ista davor.da.\n", + "Evaluation translation (should we go to the mall?) : ('¿qué te está el a la tom?',)\n", + "-------------------------------------------\n", + "Iteration 1900 : 1.1303364038467407\n", + "English: i have nothing to do with it.\n", + "Spanish Translation: no tengo nada que ver con eso.\n", + "Spanish Prediction: no tengo qodarque eir eonteso.\n", + "Evaluation translation (should we go to the mall?) : ('¿de qué tom que tom que tom esto?',)\n", + "-------------------------------------------\n", + "Iteration 2000 : 1.3422515392303467\n", + "English: can you speak a little slower?\n", + "Spanish Translation: ¿puede hablar un poco más despacio?\n", + "Spanish Prediction: ¿puedestablar an paro dás de poñio?\n", + "Evaluation translation (should we go to the mall?) : ('¿quiere que tom que tom ayuda?',)\n", + "-------------------------------------------\n", + "Iteration 2100 : 1.430239200592041\n", + "English: tom negotiated a new contract.\n", + "Spanish Translation: tom negoció un nuevo contrato.\n", + "Spanish Prediction: tom noco in anapaeva aon aa as\n", + "Evaluation translation (should we go to the mall?) : ('¿qué te que tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 2200 : 1.3891444206237793\n", + "English: she is now well enough to work.\n", + "Spanish Translation: está suficientemente bien como para trabajar.\n", + "Spanish Prediction: elta naficinr e o te eaen lonp dara laabajo..\n", + "Evaluation translation (should we go to the mall?) : ('¿de quién que tom la la la la la la la la la la la la la la ca ese?',)\n", + "-------------------------------------------\n", + "Iteration 2300 : 1.4072600603103638\n", + "English: i need to know what's happening.\n", + "Spanish Translation: necesito saber qué ocurre.\n", + "Spanish Prediction: necesito saber eue epupaas\n", + "Evaluation translation (should we go to the mall?) : ('¿a debe que tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 2400 : 1.525039792060852\n", + "English: he cut down a tree in the garden.\n", + "Spanish Translation: él tumbó un árbol en el jardín.\n", + "Spanish Prediction: él sivpr anabtba en el cureea.\n", + "Evaluation translation (should we go to the mall?) : ('ella le dijo que hablar a mary.',)\n", + "-------------------------------------------\n", + "Iteration 2500 : 1.2894519567489624\n", + "English: what's your favorite ethnic food?\n", + "Spanish Translation: ¿cuál es tu comida étnica favorita?\n", + "Spanish Prediction: ¿cuál es tu eanpdo dlriga eavor?to?\n", + "Evaluation translation (should we go to the mall?) : ('¿qué te que tom que tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 2600 : 1.2126271724700928\n", + "English: tom has decided to sell his house.\n", + "Spanish Translation: tom ha decidido vender su casa.\n", + "Spanish Prediction: tom ta cebidióo lardir du casad\n", + "Evaluation translation (should we go to the mall?) : ('¿quién está la mi a mary a mary?',)\n", + "-------------------------------------------\n", + "Iteration 2700 : 1.1631349325180054\n", + "English: tom and mary just don't hit it off.\n", + "Spanish Translation: tom y mary simplemente no se llevan bien.\n", + "Spanish Prediction: tom y mary ee aoeaente lo ca maaga tconn.\n", + "Evaluation translation (should we go to the mall?) : ('¿de qué lo que tom que tom estoy estoy?',)\n", + "-------------------------------------------\n", + "Iteration 2800 : 1.120163917541504\n", + "English: tom couldn't get in touch with mary.\n", + "Spanish Translation: tom no pudo ponerse en contacto con mary.\n", + "Spanish Prediction: tom no pueo eor r e ds lon a ia.con eary.\n", + "Evaluation translation (should we go to the mall?) : ('¿qué te de la me de la mary a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2900 : 1.4791144132614136\n", + "English: tom woke up with a terrible headache.\n", + "Spanish Translation: tom despertó con un terrible dolor de cabeza.\n", + "Spanish Prediction: tom secceróó aon lnaprnratiemaeso..de losara.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién está que tom que tom la casa?',)\n", + "-------------------------------------------\n", + "Iteration 3000 : 1.4083483219146729\n", + "English: do you know where he bought his camera?\n", + "Spanish Translation: ¿sabes dónde compró él su cámara de fotos?\n", + "Spanish Prediction: ¿sabes cende lunpre al?la canor ?te luro??\n", + "Evaluation translation (should we go to the mall?) : ('¿de quiere que tom quieres estoy a la con la casa?',)\n", + "-------------------------------------------\n", + "Iteration 3100 : 1.3170244693756104\n", + "English: i worked on sunday, so i had monday off.\n", + "Spanish Translation: trabajé el domingo, así que tuve el lunes libre.\n", + "Spanish Prediction: eeabaje us aesinao ¿ í eue no i tn dages.dibra.\n", + "Evaluation translation (should we go to the mall?) : ('¿de que tom que tom la mary a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3200 : 1.5733329057693481\n", + "English: this melody is familiar to many japanese.\n", + "Spanish Translation: muchos japoneses están familiarizados con esta melodía.\n", + "Spanish Prediction: eicha eupónes n ms á mavaelar oa o pon mn á dinesaa.\n", + "Evaluation translation (should we go to the mall?) : ('¿de que te que te que tom la casa?',)\n", + "-------------------------------------------\n", + "Iteration 3300 : 1.2941970825195312\n", + "English: i think this sweater will look good on you.\n", + "Spanish Translation: creo que este suéter te va a quedar muy bien.\n", + "Spanish Prediction: creo que es a debli qe qe a due ad dey puen.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién que tom que lo que lo que lo que la la la la maña?',)\n", + "-------------------------------------------\n", + "Iteration 3400 : 1.6221214532852173\n", + "English: everybody can see that he has a crush on her.\n", + "Spanish Translation: cualquiera puede ver que él está enamorado de ella.\n", + "Spanish Prediction: taan ueero eaede lendeue el en a en osi.o.ee ll a.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién estaría que tom que tom la casa?',)\n", + "-------------------------------------------\n", + "Iteration 3500 : 1.5584983825683594\n", + "English: he didn't succeed in explaining what he wanted.\n", + "Spanish Translation: no consiguió explicar lo que quería.\n", + "Spanish Prediction: éo sonte uió enplici ea que nue éa \n", + "Evaluation translation (should we go to the mall?) : ('¿quién que tom la la la mi para con la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3600 : 1.5686309337615967\n", + "English: the dampness of the weather is bad for my health.\n", + "Spanish Translation: la humedad del tiempo me hace daño a la salud.\n", + "Spanish Prediction: la cobona de arenpo de aabereera dlla celida\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres que tom que tom que tom la vez a la tom la casa?',)\n", + "-------------------------------------------\n", + "Epoch 4\n", + "Iteration 0 : 2.346325635910034\n", + "English: english\n", + "Spanish Translation: spanish\n", + "Spanish Prediction: eeeéatto i . ai n a \n", + "Evaluation translation (should we go to the mall?) : ('¿qué te de la vez que tom la vez a la vez a la casa?',)\n", + "-------------------------------------------\n", + "Iteration 100 : 1.244941234588623\n", + "English: i'm very hot.\n", + "Spanish Translation: estoy muy cachondo.\n", + "Spanish Prediction: estoy cey basao..o.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién está tom?',)\n", + "-------------------------------------------\n", + "Iteration 200 : 1.264838695526123\n", + "English: i have nothing.\n", + "Spanish Translation: no tengo nada.\n", + "Spanish Prediction: no tengo noda.\n", + "Evaluation translation (should we go to the mall?) : ('¿qué te está a tom?',)\n", + "-------------------------------------------\n", + "Iteration 300 : 1.2962186336517334\n", + "English: there's no rush.\n", + "Spanish Translation: no hay prisa.\n", + "Spanish Prediction: eo hay eromtd\n", + "Evaluation translation (should we go to the mall?) : ('¿quién es eso?',)\n", + "-------------------------------------------\n", + "Iteration 400 : 0.9494853615760803\n", + "English: tom is too picky.\n", + "Spanish Translation: tomás es muy mañoso.\n", + "Spanish Prediction: tom s es uuy puro.o.\n", + "Evaluation translation (should we go to the mall?) : ('¿qué debe está el casa?',)\n", + "-------------------------------------------\n", + "Iteration 500 : 1.1761512756347656\n", + "English: tom was terrified.\n", + "Spanish Translation: tom estaba aterrorizado.\n", + "Spanish Prediction: tom estaba emrnra..aado.\n", + "Evaluation translation (should we go to the mall?) : ('¿dónde está la tom?',)\n", + "-------------------------------------------\n", + "Iteration 600 : 1.0902546644210815\n", + "English: tom ate your candy.\n", + "Spanish Translation: tom se comió tus dulces.\n", + "Spanish Prediction: tom ce doneó ar tcerci..\n", + "Evaluation translation (should we go to the mall?) : ('¿con que está eso?',)\n", + "-------------------------------------------\n", + "Iteration 700 : 1.2282122373580933\n", + "English: may i eat something?\n", + "Spanish Translation: ¿puedo comer algo?\n", + "Spanish Prediction: ¿muedo eome elgo?\n", + "Evaluation translation (should we go to the mall?) : ('¿quién está el esto?',)\n", + "-------------------------------------------\n", + "Iteration 800 : 1.0719865560531616\n", + "English: i met mary yesterday.\n", + "Spanish Translation: ayer me encontré con mary.\n", + "Spanish Prediction: m er ae ms anaea mam mily.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién esta tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 900 : 1.4386036396026611\n", + "English: everybody likes money.\n", + "Spanish Translation: a todo el mundo le gusta el dinero.\n", + "Spanish Prediction: t todoses gecdi eo musta ms minero.\n", + "Evaluation translation (should we go to the mall?) : ('¿debes está la tom?',)\n", + "-------------------------------------------\n", + "Iteration 1000 : 1.0910907983779907\n", + "English: we're all from boston.\n", + "Spanish Translation: todos somos de boston.\n", + "Spanish Prediction: eomos eomos ee moston.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién está la tom?',)\n", + "-------------------------------------------\n", + "Iteration 1100 : 1.1590923070907593\n", + "English: she gave him a massage.\n", + "Spanish Translation: ella le dio un masaje.\n", + "Spanish Prediction: ella le dio dn bila ar\n", + "Evaluation translation (should we go to the mall?) : ('¿quién está la tom?',)\n", + "-------------------------------------------\n", + "Iteration 1200 : 1.3110504150390625\n", + "English: i hate to be a nuisance.\n", + "Spanish Translation: detesto ser una molestia.\n", + "Spanish Prediction: tebes o ueg ena einastadd\n", + "Evaluation translation (should we go to the mall?) : ('¿qué te esta la casa?',)\n", + "-------------------------------------------\n", + "Iteration 1300 : 1.2565133571624756\n", + "English: are these cups porcelain?\n", + "Spanish Translation: ¿estas tazas son de porcelana?\n", + "Spanish Prediction: ¿está een n eol fe erl atonc?\n", + "Evaluation translation (should we go to the mall?) : ('¿qué hablar está a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1400 : 1.2438312768936157\n", + "English: this baby is 3 weeks old.\n", + "Spanish Translation: este bebé tiene tres semanas.\n", + "Spanish Prediction: este cebé eieme eoan me a.a..\n", + "Evaluation translation (should we go to the mall?) : ('¿qué hablas la tom?',)\n", + "-------------------------------------------\n", + "Iteration 1500 : 1.1770192384719849\n", + "English: i'm happy to see you here.\n", + "Spanish Translation: estoy feliz de verte aquí.\n", + "Spanish Prediction: estoy puliz pe lerde p uí.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería esta la casa?',)\n", + "-------------------------------------------\n", + "Iteration 1600 : 1.157965064048767\n", + "English: he is an expert at fishing.\n", + "Spanish Translation: él es un experto pescando.\n", + "Spanish Prediction: él es un pxtlraa daraanto \n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom este a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1700 : 1.0165622234344482\n", + "English: what did you say yesterday?\n", + "Spanish Translation: ¿qué dijiste ayer?\n", + "Spanish Prediction: ¿qué hejoste eler \n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom esta con ella?',)\n", + "-------------------------------------------\n", + "Iteration 1800 : 1.2522213459014893\n", + "English: tennis is my favorite sport.\n", + "Spanish Translation: el tenis es mi deporte favorito.\n", + "Spanish Prediction: nn pingdtps uu pe e ta prvor.do.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién que tom esta con tom?',)\n", + "-------------------------------------------\n", + "Iteration 1900 : 1.0452914237976074\n", + "English: i have nothing to do with it.\n", + "Spanish Translation: no tengo nada que ver con eso.\n", + "Spanish Prediction: no tengo qida que her eon eso.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom que tom alguna?',)\n", + "-------------------------------------------\n", + "Iteration 2000 : 1.2586925029754639\n", + "English: can you speak a little slower?\n", + "Spanish Translation: ¿puede hablar un poco más despacio?\n", + "Spanish Prediction: ¿puede pablar an poco pes ae pucio?\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres que tom que tom ayudar?',)\n", + "-------------------------------------------\n", + "Iteration 2100 : 1.3303107023239136\n", + "English: tom negotiated a new contract.\n", + "Spanish Translation: tom negoció un nuevo contrato.\n", + "Spanish Prediction: tom noco ió anabaeva aontioren\n", + "Evaluation translation (should we go to the mall?) : ('¿quién que tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 2200 : 1.263771891593933\n", + "English: she is now well enough to work.\n", + "Spanish Translation: está suficientemente bien como para trabajar.\n", + "Spanish Prediction: elta naviciende e te eaen.eono tara aoaba.o..\n", + "Evaluation translation (should we go to the mall?) : ('¿quién que tom que tom esta a la casa?',)\n", + "-------------------------------------------\n", + "Iteration 2300 : 1.30619215965271\n", + "English: i need to know what's happening.\n", + "Spanish Translation: necesito saber qué ocurre.\n", + "Spanish Prediction: necesito qaber eue pcupais\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom esta a tom?',)\n", + "-------------------------------------------\n", + "Iteration 2400 : 1.4156508445739746\n", + "English: he cut down a tree in the garden.\n", + "Spanish Translation: él tumbó un árbol en el jardín.\n", + "Spanish Prediction: él sevei en blbol an el curdaa.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom que venir a la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2500 : 1.2054580450057983\n", + "English: what's your favorite ethnic food?\n", + "Spanish Translation: ¿cuál es tu comida étnica favorita?\n", + "Spanish Prediction: ¿cuál es eu pampna clriga?eavor?to?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom que tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 2600 : 1.1115771532058716\n", + "English: tom has decided to sell his house.\n", + "Spanish Translation: tom ha decidido vender su casa.\n", + "Spanish Prediction: tom ta ee idióo aerter eu pasa.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién se debería a la me a la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2700 : 1.0651459693908691\n", + "English: tom and mary just don't hit it off.\n", + "Spanish Translation: tom y mary simplemente no se llevan bien.\n", + "Spanish Prediction: tom y mary me poeaente lo pa aaaga taoen.\n", + "Evaluation translation (should we go to the mall?) : ('¿de que tom que tom que tom esta comento?',)\n", + "-------------------------------------------\n", + "Iteration 2800 : 1.0376900434494019\n", + "English: tom couldn't get in touch with mary.\n", + "Spanish Translation: tom no pudo ponerse en contacto con mary.\n", + "Spanish Prediction: tom no pudo duder e es lon iria.aon mary.\n", + "Evaluation translation (should we go to the mall?) : ('¿por qué tom le que llamara?',)\n", + "-------------------------------------------\n", + "Iteration 2900 : 1.392149567604065\n", + "English: tom woke up with a terrible headache.\n", + "Spanish Translation: tom despertó con un terrible dolor de cabeza.\n", + "Spanish Prediction: tom secperóó aon lncarlmaale cesv..ae lomaza.\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres que tom que ver al mesa?',)\n", + "-------------------------------------------\n", + "Iteration 3000 : 1.2846083641052246\n", + "English: do you know where he bought his camera?\n", + "Spanish Translation: ¿sabes dónde compró él su cámara de fotos?\n", + "Spanish Prediction: ¿sabes aende lonera dl ma hanaro?ce luro??\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom que tom la mary a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3100 : 1.2399160861968994\n", + "English: i worked on sunday, so i had monday off.\n", + "Spanish Translation: trabajé el domingo, así que tuve el lunes libre.\n", + "Spanish Prediction: eeabajo es posenao ¿síaeue to i an panes.dabro.\n", + "Evaluation translation (should we go to the mall?) : ('¿por que tom que tom la me para mary?',)\n", + "-------------------------------------------\n", + "Iteration 3200 : 1.4809056520462036\n", + "English: this melody is familiar to many japanese.\n", + "Spanish Translation: muchos japoneses están familiarizados con esta melodía.\n", + "Spanish Prediction: eeaha eapane ds á davillar oa o dom mn ásdanesaa.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién que te debería el para la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 3300 : 1.1831337213516235\n", + "English: i think this sweater will look good on you.\n", + "Spanish Translation: creo que este suéter te va a quedar muy bien.\n", + "Spanish Prediction: creo que es a le ler de de a due aráauy duen.\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres que tom que ver a la me de la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 3400 : 1.5294259786605835\n", + "English: everybody can see that he has a crush on her.\n", + "Spanish Translation: cualquiera puede ver que él está enamorado de ella.\n", + "Spanish Prediction: taadquiere eoedenlerteue el es a en os .o.ee ls a.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién se que tom que tom esta vez a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3500 : 1.4522336721420288\n", + "English: he didn't succeed in explaining what he wanted.\n", + "Spanish Translation: no consiguió explicar lo que quería.\n", + "Spanish Prediction: éo tomfitunó enplicí dasque nue ía \n", + "Evaluation translation (should we go to the mall?) : ('¿quién que tom se que tom para mary a mary?',)\n", + "-------------------------------------------\n", + "Iteration 3600 : 1.4946131706237793\n", + "English: the dampness of the weather is bad for my health.\n", + "Spanish Translation: la humedad del tiempo me hace daño a la salud.\n", + "Spanish Prediction: ea pieoni de prenpo se daberderosd ma mulida\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres que tom que tom la me de la me a la mesa?',)\n", + "-------------------------------------------\n", + "Epoch 5\n", + "Iteration 0 : 2.0834202766418457\n", + "English: english\n", + "Spanish Translation: spanish\n", + "Spanish Prediction: eeeéaéao . .\n", + "Evaluation translation (should we go to the mall?) : ('¿quién que tom que tom que tom esta vez a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 100 : 1.2160675525665283\n", + "English: i'm very hot.\n", + "Spanish Translation: estoy muy cachondo.\n", + "Spanish Prediction: estoy eue eanao..o.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién tom?',)\n", + "-------------------------------------------\n", + "Iteration 200 : 1.1601660251617432\n", + "English: i have nothing.\n", + "Spanish Translation: no tengo nada.\n", + "Spanish Prediction: to tengo eoda.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién a tom?',)\n", + "-------------------------------------------\n", + "Iteration 300 : 1.2059688568115234\n", + "English: there's no rush.\n", + "Spanish Translation: no hay prisa.\n", + "Spanish Prediction: eo eay eaema.\n", + "Evaluation translation (should we go to the mall?) : ('¿qué está el a tom?',)\n", + "-------------------------------------------\n", + "Iteration 400 : 0.8648290634155273\n", + "English: tom is too picky.\n", + "Spanish Translation: tomás es muy mañoso.\n", + "Spanish Prediction: tom s es uiy pata...\n", + "Evaluation translation (should we go to the mall?) : ('¿quién está el a tom?',)\n", + "-------------------------------------------\n", + "Iteration 500 : 1.0599507093429565\n", + "English: tom was terrified.\n", + "Spanish Translation: tom estaba aterrorizado.\n", + "Spanish Prediction: tom fstaba a rrro..dado.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién está el a tom?',)\n", + "-------------------------------------------\n", + "Iteration 600 : 1.014646291732788\n", + "English: tom ate your candy.\n", + "Spanish Translation: tom se comió tus dulces.\n", + "Spanish Prediction: tom se conió ar celoat.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería está tom?',)\n", + "-------------------------------------------\n", + "Iteration 700 : 1.1173269748687744\n", + "English: may i eat something?\n", + "Spanish Translation: ¿puedo comer algo?\n", + "Spanish Prediction: ¿puedo eomi elgo?\n", + "Evaluation translation (should we go to the mall?) : ('¿quién está el allí?',)\n", + "-------------------------------------------\n", + "Iteration 800 : 0.9688370227813721\n", + "English: i met mary yesterday.\n", + "Spanish Translation: ayer me encontré con mary.\n", + "Spanish Prediction: myer me dsfantra don malí.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom a tom?',)\n", + "-------------------------------------------\n", + "Iteration 900 : 1.3297449350357056\n", + "English: everybody likes money.\n", + "Spanish Translation: a todo el mundo le gusta el dinero.\n", + "Spanish Prediction: t todo ls micdo ea dusta mn cinero.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién está el camina?',)\n", + "-------------------------------------------\n", + "Iteration 1000 : 0.979780375957489\n", + "English: we're all from boston.\n", + "Spanish Translation: todos somos de boston.\n", + "Spanish Prediction: eodos eimos de multon.\n", + "Evaluation translation (should we go to the mall?) : ('¿quiénes que tom?',)\n", + "-------------------------------------------\n", + "Iteration 1100 : 1.1021934747695923\n", + "English: she gave him a massage.\n", + "Spanish Translation: ella le dio un masaje.\n", + "Spanish Prediction: ella le dio anameri or\n", + "Evaluation translation (should we go to the mall?) : ('¿quién se que tom?',)\n", + "-------------------------------------------\n", + "Iteration 1200 : 1.1936171054840088\n", + "English: i hate to be a nuisance.\n", + "Spanish Translation: detesto ser una molestia.\n", + "Spanish Prediction: oecesto uer un canertadn\n", + "Evaluation translation (should we go to the mall?) : ('¿quiere que tom a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1300 : 1.1655044555664062\n", + "English: are these cups porcelain?\n", + "Spanish Translation: ¿estas tazas son de porcelana?\n", + "Spanish Prediction: ¿está eenan per pe prl itoncn\n", + "Evaluation translation (should we go to the mall?) : ('¿quién me gusta a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1400 : 1.1567267179489136\n", + "English: this baby is 3 weeks old.\n", + "Spanish Translation: este bebé tiene tres semanas.\n", + "Spanish Prediction: este lubé eieme eras memasa..\n", + "Evaluation translation (should we go to the mall?) : ('¿quién que tom a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1500 : 1.0818170309066772\n", + "English: i'm happy to see you here.\n", + "Spanish Translation: estoy feliz de verte aquí.\n", + "Spanish Prediction: estoy eeliz ae terde equí.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom esta casa?',)\n", + "-------------------------------------------\n", + "Iteration 1600 : 1.0739024877548218\n", + "English: he is an expert at fishing.\n", + "Spanish Translation: él es un experto pescando.\n", + "Spanish Prediction: él estun asplrie darcando \n", + "Evaluation translation (should we go to the mall?) : ('¿quiere que tom a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1700 : 0.8985356688499451\n", + "English: what did you say yesterday?\n", + "Spanish Translation: ¿qué dijiste ayer?\n", + "Spanish Prediction: ¿qué qijoste s er?\n", + "Evaluation translation (should we go to the mall?) : ('¿quiere que tom estar a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1800 : 1.1187254190444946\n", + "English: tennis is my favorite sport.\n", + "Spanish Translation: el tenis es mi deporte favorito.\n", + "Spanish Prediction: ¿l pinedtps ui pe erta puvor.aor\n", + "Evaluation translation (should we go to the mall?) : ('¿quién se que te a la casa?',)\n", + "-------------------------------------------\n", + "Iteration 1900 : 0.9419654011726379\n", + "English: i have nothing to do with it.\n", + "Spanish Translation: no tengo nada que ver con eso.\n", + "Spanish Prediction: no tengo qada que her eon eso.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién que te a la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2000 : 1.1723580360412598\n", + "English: can you speak a little slower?\n", + "Spanish Translation: ¿puede hablar un poco más despacio?\n", + "Spanish Prediction: ¿puedessablar an poco dás ae pecio?\n", + "Evaluation translation (should we go to the mall?) : ('¿quiere que te a la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2100 : 1.1968010663986206\n", + "English: tom negotiated a new contract.\n", + "Spanish Translation: tom negoció un nuevo contrato.\n", + "Spanish Prediction: tom necu ió anacueve aon iara \n", + "Evaluation translation (should we go to the mall?) : ('¿quiénes que te algo de la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2200 : 1.1923997402191162\n", + "English: she is now well enough to work.\n", + "Spanish Translation: está suficientemente bien como para trabajar.\n", + "Spanish Prediction: el á nipreiende ente qien.lono qura lrabajo..\n", + "Evaluation translation (should we go to the mall?) : ('¿quién quería a la mi a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2300 : 1.191548228263855\n", + "English: i need to know what's happening.\n", + "Spanish Translation: necesito saber qué ocurre.\n", + "Spanish Prediction: necesito saber eué e urris\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom la me a la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2400 : 1.3155711889266968\n", + "English: he cut down a tree in the garden.\n", + "Spanish Translation: él tumbó un árbol en el jardín.\n", + "Spanish Prediction: él nevbr un arbol en el aurden.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que le dijo a la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2500 : 1.1292449235916138\n", + "English: what's your favorite ethnic food?\n", + "Spanish Translation: ¿cuál es tu comida étnica favorita?\n", + "Spanish Prediction: ¿cuál es tu pomida clrica ervorito?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom que tom para casa?',)\n", + "-------------------------------------------\n", + "Iteration 2600 : 1.0217827558517456\n", + "English: tom has decided to sell his house.\n", + "Spanish Translation: tom ha decidido vender su casa.\n", + "Spanish Prediction: tom ta ee idióo eertor lu aasa.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién se que tom de la mesa mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2700 : 0.9962669610977173\n", + "English: tom and mary just don't hit it off.\n", + "Spanish Translation: tom y mary simplemente no se llevan bien.\n", + "Spanish Prediction: tom y mary sunpietorte co eu caava.tdien.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que llegar a la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2800 : 0.9496597051620483\n", + "English: tom couldn't get in touch with mary.\n", + "Spanish Translation: tom no pudo ponerse en contacto con mary.\n", + "Spanish Prediction: tom no podi eedes e dn con irta don mary.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién que tom le de la me de la matal?',)\n", + "-------------------------------------------\n", + "Iteration 2900 : 1.3414239883422852\n", + "English: tom woke up with a terrible headache.\n", + "Spanish Translation: tom despertó con un terrible dolor de cabeza.\n", + "Spanish Prediction: tom sesperóó aon lnaarlrobie cero..ae lomaza.\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres que lo que vaya a la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 3000 : 1.2300065755844116\n", + "English: do you know where he bought his camera?\n", + "Spanish Translation: ¿sabes dónde compró él su cámara de fotos?\n", + "Spanish Prediction: ¿sabes aónde compra dl eu camiri le luto??\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom que llamara tom la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3100 : 1.1682852506637573\n", + "English: i worked on sunday, so i had monday off.\n", + "Spanish Translation: trabajé el domingo, así que tuve el lunes libre.\n", + "Spanish Prediction: erabajé an memiréo ¿ í eue to isan danes.dabro.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién que tom que tom me podría mary?',)\n", + "-------------------------------------------\n", + "Iteration 3200 : 1.4498120546340942\n", + "English: this melody is familiar to many japanese.\n", + "Spanish Translation: muchos japoneses están familiarizados con esta melodía.\n", + "Spanish Prediction: eeaha euma e ms á mrmilla oa o domomn abdánisan.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién que te que llama llama la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3300 : 1.114243507385254\n", + "English: i think this sweater will look good on you.\n", + "Spanish Translation: creo que este suéter te va a quedar muy bien.\n", + "Spanish Prediction: creo que el a le li ado daya tue a áeay huen.\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres que tom que llama la me gusta la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3400 : 1.4658693075180054\n", + "English: everybody can see that he has a crush on her.\n", + "Spanish Translation: cualquiera puede ver que él está enamorado de ella.\n", + "Spanish Prediction: taan uiero eeede ler eue el es a en áre oree ls a.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién se que lleva a la me de la mary media?',)\n", + "-------------------------------------------\n", + "Iteration 3500 : 1.390209674835205\n", + "English: he didn't succeed in explaining what he wanted.\n", + "Spanish Translation: no consiguió explicar lo que quería.\n", + "Spanish Prediction: éo sonse uaó enplica ea que nue éa \n", + "Evaluation translation (should we go to the mall?) : ('¿quién que tom se llegar la me de la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3600 : 1.4289673566818237\n", + "English: the dampness of the weather is bad for my health.\n", + "Spanish Translation: la humedad del tiempo me hace daño a la salud.\n", + "Spanish Prediction: la paeena de peenpr de dabereera d la mulada\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres que tom que le de la llegar a la maría?',)\n", + "-------------------------------------------\n", + "Epoch 6\n", + "Iteration 0 : 1.9990354776382446\n", + "English: english\n", + "Spanish Translation: spanish\n", + "Spanish Prediction: eoeéatta a ...... ... ...\n", + "Evaluation translation (should we go to the mall?) : ('¿quién se que tom que tom la mary a la mary a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 100 : 1.1111493110656738\n", + "English: i'm very hot.\n", + "Spanish Translation: estoy muy cachondo.\n", + "Spanish Prediction: estoy euy cosao..o.\n", + "Evaluation translation (should we go to the mall?) : ('¿de vender?',)\n", + "-------------------------------------------\n", + "Iteration 200 : 1.090507984161377\n", + "English: i have nothing.\n", + "Spanish Translation: no tengo nada.\n", + "Spanish Prediction: to tengo eada.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién está a la la caminar?',)\n", + "-------------------------------------------\n", + "Iteration 300 : 1.0927894115447998\n", + "English: there's no rush.\n", + "Spanish Translation: no hay prisa.\n", + "Spanish Prediction: so hay arima.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién está ella?',)\n", + "-------------------------------------------\n", + "Iteration 400 : 0.8216661810874939\n", + "English: tom is too picky.\n", + "Spanish Translation: tomás es muy mañoso.\n", + "Spanish Prediction: tom s us uiy pata...\n", + "Evaluation translation (should we go to the mall?) : ('¿quién esta eso?',)\n", + "-------------------------------------------\n", + "Iteration 500 : 1.009582281112671\n", + "English: tom was terrified.\n", + "Spanish Translation: tom estaba aterrorizado.\n", + "Spanish Prediction: tom estaba dcarri..cado.\n", + "Evaluation translation (should we go to the mall?) : ('¿debía estar algo?',)\n", + "-------------------------------------------\n", + "Iteration 600 : 0.9640610218048096\n", + "English: tom ate your candy.\n", + "Spanish Translation: tom se comió tus dulces.\n", + "Spanish Prediction: tom ne conió ur cerci..\n", + "Evaluation translation (should we go to the mall?) : ('¿debería está todo?',)\n", + "-------------------------------------------\n", + "Iteration 700 : 1.016850471496582\n", + "English: may i eat something?\n", + "Spanish Translation: ¿puedo comer algo?\n", + "Spanish Prediction: ¿puedo eomer elgo?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería estar a la tom?',)\n", + "-------------------------------------------\n", + "Iteration 800 : 0.8932834267616272\n", + "English: i met mary yesterday.\n", + "Spanish Translation: ayer me encontré con mary.\n", + "Spanish Prediction: myer me mstantra man laly.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién me gusta con la camina?',)\n", + "-------------------------------------------\n", + "Iteration 900 : 1.256630301475525\n", + "English: everybody likes money.\n", + "Spanish Translation: a todo el mundo le gusta el dinero.\n", + "Spanish Prediction: t todosls mendo ea musta.mn minero.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería estar a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1000 : 0.9019444584846497\n", + "English: we're all from boston.\n", + "Spanish Translation: todos somos de boston.\n", + "Spanish Prediction: sodos eomos ae poston.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién se que tom?',)\n", + "-------------------------------------------\n", + "Iteration 1100 : 1.0217701196670532\n", + "English: she gave him a massage.\n", + "Spanish Translation: ella le dio un masaje.\n", + "Spanish Prediction: ella le gio un cenaser\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que ir a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1200 : 1.0943143367767334\n", + "English: i hate to be a nuisance.\n", + "Spanish Translation: detesto ser una molestia.\n", + "Spanish Prediction: tetesto qer cn cacactod.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom?',)\n", + "-------------------------------------------\n", + "Iteration 1300 : 1.0536324977874756\n", + "English: are these cups porcelain?\n", + "Spanish Translation: ¿estas tazas son de porcelana?\n", + "Spanish Prediction: ¿eltás san n pen pe cal atoscs\n", + "Evaluation translation (should we go to the mall?) : ('¿quién se que hablar a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1400 : 1.1080735921859741\n", + "English: this baby is 3 weeks old.\n", + "Spanish Translation: este bebé tiene tres semanas.\n", + "Spanish Prediction: este tebé eoene bras uemana..\n", + "Evaluation translation (should we go to the mall?) : ('¿quién se que tom?',)\n", + "-------------------------------------------\n", + "Iteration 1500 : 1.001197338104248\n", + "English: i'm happy to see you here.\n", + "Spanish Translation: estoy feliz de verte aquí.\n", + "Spanish Prediction: estoy teliz ae terde.aluí.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1600 : 0.9707476496696472\n", + "English: he is an expert at fishing.\n", + "Spanish Translation: él es un experto pescando.\n", + "Spanish Prediction: él es un psplrie drraando.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que hablar a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1700 : 0.8405545949935913\n", + "English: what did you say yesterday?\n", + "Spanish Translation: ¿qué dijiste ayer?\n", + "Spanish Prediction: ¿qué dijiste e er?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom estar a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1800 : 1.0557594299316406\n", + "English: tennis is my favorite sport.\n", + "Spanish Translation: el tenis es mi deporte favorito.\n", + "Spanish Prediction: ll pi gstes mi pe orta puvor.ao.\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres que vaya la la la mary?',)\n", + "-------------------------------------------\n", + "Iteration 1900 : 0.8438462615013123\n", + "English: i have nothing to do with it.\n", + "Spanish Translation: no tengo nada que ver con eso.\n", + "Spanish Prediction: no tengo nada lue hir eon éso.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2000 : 1.0811728239059448\n", + "English: can you speak a little slower?\n", + "Spanish Translation: ¿puede hablar un poco más despacio?\n", + "Spanish Prediction: ¿puede hablar an poco dás de pucion\n", + "Evaluation translation (should we go to the mall?) : ('¿queré debería que vaya medir?',)\n", + "-------------------------------------------\n", + "Iteration 2100 : 1.1366139650344849\n", + "English: tom negotiated a new contract.\n", + "Spanish Translation: tom negoció un nuevo contrato.\n", + "Spanish Prediction: tom nucó ió an cuevo uonsaara.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que vaya a tom?',)\n", + "-------------------------------------------\n", + "Iteration 2200 : 1.1294913291931152\n", + "English: she is now well enough to work.\n", + "Spanish Translation: está suficientemente bien como para trabajar.\n", + "Spanish Prediction: eltá nepiciende ente luen.eonp hara loabajo..\n", + "Evaluation translation (should we go to the mall?) : ('¿quién querés a la la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2300 : 1.1090084314346313\n", + "English: i need to know what's happening.\n", + "Spanish Translation: necesito saber qué ocurre.\n", + "Spanish Prediction: necesito saber eué ecurris\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que vaya me a la matar a tom?',)\n", + "-------------------------------------------\n", + "Iteration 2400 : 1.2384765148162842\n", + "English: he cut down a tree in the garden.\n", + "Spanish Translation: él tumbó un árbol en el jardín.\n", + "Spanish Prediction: él nevbr unaanbol en el turdea.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que vendrá el menos de la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2500 : 1.0890356302261353\n", + "English: what's your favorite ethnic food?\n", + "Spanish Translation: ¿cuál es tu comida étnica favorita?\n", + "Spanish Prediction: ¿cuál es tu paneda elriga?davor?to?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que lo que vaya a tom?',)\n", + "-------------------------------------------\n", + "Iteration 2600 : 0.9639005064964294\n", + "English: tom has decided to sell his house.\n", + "Spanish Translation: tom ha decidido vender su casa.\n", + "Spanish Prediction: tom ha cecidióa derder su casa.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que le de la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2700 : 0.9146358966827393\n", + "English: tom and mary just don't hit it off.\n", + "Spanish Translation: tom y mary simplemente no se llevan bien.\n", + "Spanish Prediction: tom y mary so poetante do su poaganteocn.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que le dijo a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2800 : 0.8872530460357666\n", + "English: tom couldn't get in touch with mary.\n", + "Spanish Translation: tom no pudo ponerse en contacto con mary.\n", + "Spanish Prediction: tom no podo nodir e pn lonticta.mon mary.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que le dijo a la mente a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2900 : 1.2528363466262817\n", + "English: tom woke up with a terrible headache.\n", + "Spanish Translation: tom despertó con un terrible dolor de cabeza.\n", + "Spanish Prediction: tom sejperóó con ln arnribie aenaj.de losaza.\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres que vaya a la mary media?',)\n", + "-------------------------------------------\n", + "Iteration 3000 : 1.1245968341827393\n", + "English: do you know where he bought his camera?\n", + "Spanish Translation: ¿sabes dónde compró él su cámara de fotos?\n", + "Spanish Prediction: ¿sabes aónde lonpoa el eeecamiri?ce taros?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom que vive a todo de la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3100 : 1.0739731788635254\n", + "English: i worked on sunday, so i had monday off.\n", + "Spanish Translation: trabajé el domingo, así que tuve el lunes libre.\n", + "Spanish Prediction: tratajé an eimiego, ¿ í eue tovisdn dunes.domro.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom le gusta mary me gusta mary?',)\n", + "-------------------------------------------\n", + "Iteration 3200 : 1.3889578580856323\n", + "English: this melody is familiar to many japanese.\n", + "Spanish Translation: muchos japoneses están familiarizados con esta melodía.\n", + "Spanish Prediction: eeeha datane a ms á mamilla oa a dom ml asmunosea.\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres que te que vive a la menos llamara?',)\n", + "-------------------------------------------\n", + "Iteration 3300 : 1.0349704027175903\n", + "English: i think this sweater will look good on you.\n", + "Spanish Translation: creo que este suéter te va a quedar muy bien.\n", + "Spanish Prediction: creo que es a le ri mae diya tue arlcay hiens\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom que le de la menos la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3400 : 1.4173303842544556\n", + "English: everybody can see that he has a crush on her.\n", + "Spanish Translation: cualquiera puede ver que él está enamorado de ella.\n", + "Spanish Prediction: taaneuiera eoese len eue el enta en or .osee ll a.\n", + "Evaluation translation (should we go to the mall?) : ('¿quieres que tom la me de la mary me de la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3500 : 1.3193843364715576\n", + "English: he didn't succeed in explaining what he wanted.\n", + "Spanish Translation: no consiguió explicar lo que quería.\n", + "Spanish Prediction: éo sonsu uió cnpeacín easque nuería \n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom lo que llegará a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3600 : 1.3740407228469849\n", + "English: the dampness of the weather is bad for my health.\n", + "Spanish Translation: la humedad del tiempo me hace daño a la salud.\n", + "Spanish Prediction: la coeena de crenpo senpabe derosa la mulid.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería a la con la la llegar a la mary la maría?',)\n", + "-------------------------------------------\n", + "Epoch 7\n", + "Iteration 0 : 1.7325479984283447\n", + "English: english\n", + "Spanish Translation: spanish\n", + "Spanish Prediction: eeeégsto ..aa aa..a.a.......a..............a.. ..a .... . a.. .r... . ..a . . aa ..aa a a.a a . .a. . . .a . ... .. .. a a. \n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom que tom la la la la la la la mary?',)\n", + "-------------------------------------------\n", + "Iteration 100 : 1.0316486358642578\n", + "English: i'm very hot.\n", + "Spanish Translation: estoy muy cachondo.\n", + "Spanish Prediction: estoy cuy tonio..o.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería a la casa?',)\n", + "-------------------------------------------\n", + "Iteration 200 : 1.035288691520691\n", + "English: i have nothing.\n", + "Spanish Translation: no tengo nada.\n", + "Spanish Prediction: to tengo nada.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería a la la con a la la casa?',)\n", + "-------------------------------------------\n", + "Iteration 300 : 1.0153948068618774\n", + "English: there's no rush.\n", + "Spanish Translation: no hay prisa.\n", + "Spanish Prediction: eo hay erima.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería está a la camina?',)\n", + "-------------------------------------------\n", + "Iteration 400 : 0.7414162755012512\n", + "English: tom is too picky.\n", + "Spanish Translation: tomás es muy mañoso.\n", + "Spanish Prediction: tom s es uiy pana...\n", + "Evaluation translation (should we go to the mall?) : ('¿debería estar a la casa?',)\n", + "-------------------------------------------\n", + "Iteration 500 : 0.9147159457206726\n", + "English: tom was terrified.\n", + "Spanish Translation: tom estaba aterrorizado.\n", + "Spanish Prediction: tom estaba acrrrin.cado.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería estar al con él?',)\n", + "-------------------------------------------\n", + "Iteration 600 : 0.8803373575210571\n", + "English: tom ate your candy.\n", + "Spanish Translation: tom se comió tus dulces.\n", + "Spanish Prediction: tom se pompó ur tceecit.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería eso?',)\n", + "-------------------------------------------\n", + "Iteration 700 : 0.9197513461112976\n", + "English: may i eat something?\n", + "Spanish Translation: ¿puedo comer algo?\n", + "Spanish Prediction: ¿puedo uomer e go?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al con él?',)\n", + "-------------------------------------------\n", + "Iteration 800 : 0.8427671790122986\n", + "English: i met mary yesterday.\n", + "Spanish Translation: ayer me encontré con mary.\n", + "Spanish Prediction: myer me mntontra mon liry.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería tom que tom?',)\n", + "-------------------------------------------\n", + "Iteration 900 : 1.1932986974716187\n", + "English: everybody likes money.\n", + "Spanish Translation: a todo el mundo le gusta el dinero.\n", + "Spanish Prediction: t todosls mendo eo musta mn minero.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1000 : 0.8248985409736633\n", + "English: we're all from boston.\n", + "Spanish Translation: todos somos de boston.\n", + "Spanish Prediction: sedos somos de moston.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al con tom?',)\n", + "-------------------------------------------\n", + "Iteration 1100 : 0.9513902068138123\n", + "English: she gave him a massage.\n", + "Spanish Translation: ella le dio un masaje.\n", + "Spanish Prediction: ella le dio un gera et\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la con tom?',)\n", + "-------------------------------------------\n", + "Iteration 1200 : 1.0184427499771118\n", + "English: i hate to be a nuisance.\n", + "Spanish Translation: detesto ser una molestia.\n", + "Spanish Prediction: tetesto uer ena cinestad.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que tom de a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1300 : 1.018519639968872\n", + "English: are these cups porcelain?\n", + "Spanish Translation: ¿estas tazas son de porcelana?\n", + "Spanish Prediction: ¿hltás san n eon fe pal alost?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a con tom?',)\n", + "-------------------------------------------\n", + "Iteration 1400 : 1.0644750595092773\n", + "English: this baby is 3 weeks old.\n", + "Spanish Translation: este bebé tiene tres semanas.\n", + "Spanish Prediction: este lubé eoene eras do ana..\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la casa?',)\n", + "-------------------------------------------\n", + "Iteration 1500 : 0.9866442680358887\n", + "English: i'm happy to see you here.\n", + "Spanish Translation: estoy feliz de verte aquí.\n", + "Spanish Prediction: estoy deliz ae aerde aquí.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la media?',)\n", + "-------------------------------------------\n", + "Iteration 1600 : 0.9282341599464417\n", + "English: he is an expert at fishing.\n", + "Spanish Translation: él es un experto pescando.\n", + "Spanish Prediction: él es un pxperia daraando.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al con tom?',)\n", + "-------------------------------------------\n", + "Iteration 1700 : 0.7673040628433228\n", + "English: what did you say yesterday?\n", + "Spanish Translation: ¿qué dijiste ayer?\n", + "Spanish Prediction: ¿qué tijiste dñer?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al me al mente?',)\n", + "-------------------------------------------\n", + "Iteration 1800 : 0.954107403755188\n", + "English: tennis is my favorite sport.\n", + "Spanish Translation: el tenis es mi deporte favorito.\n", + "Spanish Prediction: ll virestes mi pe orta puvor.ta.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al me al mesa?',)\n", + "-------------------------------------------\n", + "Iteration 1900 : 0.7930289506912231\n", + "English: i have nothing to do with it.\n", + "Spanish Translation: no tengo nada que ver con eso.\n", + "Spanish Prediction: no tengo nada que hir con éso.\n", + "Evaluation translation (should we go to the mall?) : ('¿quién que ir al mente a la media?',)\n", + "-------------------------------------------\n", + "Iteration 2000 : 1.0262192487716675\n", + "English: can you speak a little slower?\n", + "Spanish Translation: ¿puede hablar un poco más despacio?\n", + "Spanish Prediction: ¿puedeshablar an poco dás ae pucio?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la matar a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2100 : 1.0350511074066162\n", + "English: tom negotiated a new contract.\n", + "Spanish Translation: tom negoció un nuevo contrato.\n", + "Spanish Prediction: tom lecrcid un cuevo uontraro.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al con la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2200 : 1.0628077983856201\n", + "English: she is now well enough to work.\n", + "Spanish Translation: está suficientemente bien como para trabajar.\n", + "Spanish Prediction: el á nepiciende ente suen.lomp sara erabajo..\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mi la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2300 : 1.0535069704055786\n", + "English: i need to know what's happening.\n", + "Spanish Translation: necesito saber qué ocurre.\n", + "Spanish Prediction: necesito saber eué pcurris\n", + "Evaluation translation (should we go to the mall?) : ('¿debería que va a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2400 : 1.2128291130065918\n", + "English: he cut down a tree in the garden.\n", + "Spanish Translation: él tumbó un árbol en el jardín.\n", + "Spanish Prediction: él novbr yn prbo tn el tardea.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir algo de la mente a la media?',)\n", + "-------------------------------------------\n", + "Iteration 2500 : 1.0205272436141968\n", + "English: what's your favorite ethnic food?\n", + "Spanish Translation: ¿cuál es tu comida étnica favorita?\n", + "Spanish Prediction: ¿cuál es tu ponida elraga drvorito?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al con mi cartamente?',)\n", + "-------------------------------------------\n", + "Iteration 2600 : 0.8993284106254578\n", + "English: tom has decided to sell his house.\n", + "Spanish Translation: tom ha decidido vender su casa.\n", + "Spanish Prediction: tom ha decidióo aerder au casa.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mucho todo a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2700 : 0.872901976108551\n", + "English: tom and mary just don't hit it off.\n", + "Spanish Translation: tom y mary simplemente no se llevan bien.\n", + "Spanish Prediction: tom y mary so poeaente eo su doavontdien.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al me gusta la mente?',)\n", + "-------------------------------------------\n", + "Iteration 2800 : 0.8034117221832275\n", + "English: tom couldn't get in touch with mary.\n", + "Spanish Translation: tom no pudo ponerse en contacto con mary.\n", + "Spanish Prediction: tom no pudo ioder e es lon icto.aon mary.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la llamar a la media?',)\n", + "-------------------------------------------\n", + "Iteration 2900 : 1.2028985023498535\n", + "English: tom woke up with a terrible headache.\n", + "Spanish Translation: tom despertó con un terrible dolor de cabeza.\n", + "Spanish Prediction: tom sejperóó cun ln prnrobiemderor.de subeza.\n", + "Evaluation translation (should we go to the mall?) : ('¿deberíamos a la la mary a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3000 : 1.0457249879837036\n", + "English: do you know where he bought his camera?\n", + "Spanish Translation: ¿sabes dónde compró él su cámara de fotos?\n", + "Spanish Prediction: ¿sabes cónde lumpra el euecorara?eelcrto??\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la la mary mucho todo de la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3100 : 1.0347756147384644\n", + "English: i worked on sunday, so i had monday off.\n", + "Spanish Translation: trabajé el domingo, así que tuve el lunes libre.\n", + "Spanish Prediction: trabajé nn dímieao ¿ í eue lo i en dunes.dumre.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la mary llama la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3200 : 1.3397021293640137\n", + "English: this melody is familiar to many japanese.\n", + "Spanish Translation: muchos japoneses están familiarizados con esta melodía.\n", + "Spanish Prediction: eeeho mapanertjtms á eavilia oada pomtms ádmano.ín.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al con la mary mediando de la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3300 : 0.9594873785972595\n", + "English: i think this sweater will look good on you.\n", + "Spanish Translation: creo que este suéter te va a quedar muy bien.\n", + "Spanish Prediction: creo que es a ee lenaqe veya tue artcec huen.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la la la menos la menos la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3400 : 1.3532086610794067\n", + "English: everybody can see that he has a crush on her.\n", + "Spanish Translation: cualquiera puede ver que él está enamorado de ella.\n", + "Spanish Prediction: taanquiera coesenaen eue hl esta en ora.o.ee ll a.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al con la menos llamarme a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3500 : 1.2728064060211182\n", + "English: he didn't succeed in explaining what he wanted.\n", + "Spanish Translation: no consiguió explicar lo que quería.\n", + "Spanish Prediction: éo srnse uió dnpeicad da que nuería.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la llegar a la mediate a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3600 : 1.3107061386108398\n", + "English: the dampness of the weather is bad for my health.\n", + "Spanish Translation: la humedad del tiempo me hace daño a la salud.\n", + "Spanish Prediction: lo moeoni ode trenpo ae ca eree osd ma miluda\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al con la última la mente a la mary?',)\n", + "-------------------------------------------\n", + "Epoch 8\n", + "Iteration 0 : 1.6128370761871338\n", + "English: english\n", + "Spanish Translation: spanish\n", + "Spanish Prediction: eoeéesao . a . .....r. . .............................ta.. . .t.. ..... .aaa...\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al con la llamarme al mediatemente?',)\n", + "-------------------------------------------\n", + "Iteration 100 : 0.9515244960784912\n", + "English: i'm very hot.\n", + "Spanish Translation: estoy muy cachondo.\n", + "Spanish Prediction: estoy cey tanio..o.\n", + "Evaluation translation (should we go to the mall?) : ('¿debe estaría?',)\n", + "-------------------------------------------\n", + "Iteration 200 : 0.9644163846969604\n", + "English: i have nothing.\n", + "Spanish Translation: no tengo nada.\n", + "Spanish Prediction: to tengo nada.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir?',)\n", + "-------------------------------------------\n", + "Iteration 300 : 1.0017051696777344\n", + "English: there's no rush.\n", + "Spanish Translation: no hay prisa.\n", + "Spanish Prediction: so hay erima.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería estar a la casa?',)\n", + "-------------------------------------------\n", + "Iteration 400 : 0.6878519058227539\n", + "English: tom is too picky.\n", + "Spanish Translation: tomás es muy mañoso.\n", + "Spanish Prediction: tom s es uay cata...\n", + "Evaluation translation (should we go to the mall?) : ('¿deberíamos alto?',)\n", + "-------------------------------------------\n", + "Iteration 500 : 0.8670902848243713\n", + "English: tom was terrified.\n", + "Spanish Translation: tom estaba aterrorizado.\n", + "Spanish Prediction: tom estaba dfrrri..aa.o.\n", + "Evaluation translation (should we go to the mall?) : ('¿deberíamos alto?',)\n", + "-------------------------------------------\n", + "Iteration 600 : 0.8075338006019592\n", + "English: tom ate your candy.\n", + "Spanish Translation: tom se comió tus dulces.\n", + "Spanish Prediction: tom ne comió er aelce..\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al con él?',)\n", + "-------------------------------------------\n", + "Iteration 700 : 0.8750878572463989\n", + "English: may i eat something?\n", + "Spanish Translation: ¿puedo comer algo?\n", + "Spanish Prediction: ¿puedo vomer elgo?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al algo?',)\n", + "-------------------------------------------\n", + "Iteration 800 : 0.7724956274032593\n", + "English: i met mary yesterday.\n", + "Spanish Translation: ayer me encontré con mary.\n", + "Spanish Prediction: myen mi dxcontré aan luyy.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la me digar?',)\n", + "-------------------------------------------\n", + "Iteration 900 : 1.1281754970550537\n", + "English: everybody likes money.\n", + "Spanish Translation: a todo el mundo le gusta el dinero.\n", + "Spanish Prediction: t todosll mendo eo musta en dinero.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1000 : 0.7626785039901733\n", + "English: we're all from boston.\n", + "Spanish Translation: todos somos de boston.\n", + "Spanish Prediction: eodos somos pe loston.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al casa?',)\n", + "-------------------------------------------\n", + "Iteration 1100 : 0.8788660764694214\n", + "English: she gave him a massage.\n", + "Spanish Translation: ella le dio un masaje.\n", + "Spanish Prediction: ella le dio un mora er\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mesa?',)\n", + "-------------------------------------------\n", + "Iteration 1200 : 0.9835538864135742\n", + "English: i hate to be a nuisance.\n", + "Spanish Translation: detesto ser una molestia.\n", + "Spanish Prediction: decento eer un conertacn\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1300 : 0.968766450881958\n", + "English: are these cups porcelain?\n", + "Spanish Translation: ¿estas tazas son de porcelana?\n", + "Spanish Prediction: ¿hltas senan por pe pal alosos\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la medir?',)\n", + "-------------------------------------------\n", + "Iteration 1400 : 1.0015884637832642\n", + "English: this baby is 3 weeks old.\n", + "Spanish Translation: este bebé tiene tres semanas.\n", + "Spanish Prediction: este tibéseaene moas me ana..\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mesa?',)\n", + "-------------------------------------------\n", + "Iteration 1500 : 0.8921286463737488\n", + "English: i'm happy to see you here.\n", + "Spanish Translation: estoy feliz de verte aquí.\n", + "Spanish Prediction: estoy eeliz ae aerde aquí.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mesa?',)\n", + "-------------------------------------------\n", + "Iteration 1600 : 0.833597719669342\n", + "English: he is an expert at fishing.\n", + "Spanish Translation: él es un experto pescando.\n", + "Spanish Prediction: él es un pxperae dertondo.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mentira con me al mestar?',)\n", + "-------------------------------------------\n", + "Iteration 1700 : 0.7129554748535156\n", + "English: what did you say yesterday?\n", + "Spanish Translation: ¿qué dijiste ayer?\n", + "Spanish Prediction: ¿qué dijoste ayer?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mentirlo?',)\n", + "-------------------------------------------\n", + "Iteration 1800 : 0.9459905028343201\n", + "English: tennis is my favorite sport.\n", + "Spanish Translation: el tenis es mi deporte favorito.\n", + "Spanish Prediction: el voristes mi pe ortanpovor.to.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mentira la martel?',)\n", + "-------------------------------------------\n", + "Iteration 1900 : 0.7678104639053345\n", + "English: i have nothing to do with it.\n", + "Spanish Translation: no tengo nada que ver con eso.\n", + "Spanish Prediction: no tengo nada que vir eon eso.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mentiras la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2000 : 0.9973265528678894\n", + "English: can you speak a little slower?\n", + "Spanish Translation: ¿puede hablar un poco más despacio?\n", + "Spanish Prediction: ¿puede hablar dn poco más te pucao?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al matar a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2100 : 1.0044807195663452\n", + "English: tom negotiated a new contract.\n", + "Spanish Translation: tom negoció un nuevo contrato.\n", + "Spanish Prediction: tom necó id unabuevo uon raro.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir algo de la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2200 : 1.0165092945098877\n", + "English: she is now well enough to work.\n", + "Spanish Translation: está suficientemente bien como para trabajar.\n", + "Spanish Prediction: eltá ne iciende ente luen eono sara drabaja..\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mentar al mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2300 : 0.996376097202301\n", + "English: i need to know what's happening.\n", + "Spanish Translation: necesito saber qué ocurre.\n", + "Spanish Prediction: necesito saber eué ecurris\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al tom?',)\n", + "-------------------------------------------\n", + "Iteration 2400 : 1.1387913227081299\n", + "English: he cut down a tree in the garden.\n", + "Spanish Translation: él tumbó un árbol en el jardín.\n", + "Spanish Prediction: él nevbi nnaerbol en el rurden.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al algo de la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2500 : 0.9836024045944214\n", + "English: what's your favorite ethnic food?\n", + "Spanish Translation: ¿cuál es tu comida étnica favorita?\n", + "Spanish Prediction: ¿cuál es tu pomiea dlrico drvorito?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al matar a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2600 : 0.890747606754303\n", + "English: tom has decided to sell his house.\n", + "Spanish Translation: tom ha decidido vender su casa.\n", + "Spanish Prediction: tom ha decidido aerder su casa.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al a llamar a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2700 : 0.808067798614502\n", + "English: tom and mary just don't hit it off.\n", + "Spanish Translation: tom y mary simplemente no se llevan bien.\n", + "Spanish Prediction: tom y mary so poesente eo so poavanteicn.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al menos a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2800 : 0.7531886696815491\n", + "English: tom couldn't get in touch with mary.\n", + "Spanish Translation: tom no pudo ponerse en contacto con mary.\n", + "Spanish Prediction: tom no pudo aoder elcn eon icta.con mary.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la llamar a la media?',)\n", + "-------------------------------------------\n", + "Iteration 2900 : 1.1368921995162964\n", + "English: tom woke up with a terrible headache.\n", + "Spanish Translation: tom despertó con un terrible dolor de cabeza.\n", + "Spanish Prediction: tom sejperóó con un arlrobae delor de labaza.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al alguna al mente a la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3000 : 0.9834263920783997\n", + "English: do you know where he bought his camera?\n", + "Spanish Translation: ¿sabes dónde compró él su cámara de fotos?\n", + "Spanish Prediction: ¿sabes cónde lunpra el eu camara?ce luro??\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al alto de la la mary?',)\n", + "-------------------------------------------\n", + "Iteration 3100 : 0.9632750153541565\n", + "English: i worked on sunday, so i had monday off.\n", + "Spanish Translation: trabajé el domingo, así que tuve el lunes libre.\n", + "Spanish Prediction: trabajo an domingo ysí yue yovi yn dunes.dumre.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la mary la mentira la media?',)\n", + "-------------------------------------------\n", + "Iteration 3200 : 1.2938730716705322\n", + "English: this melody is familiar to many japanese.\n", + "Spanish Translation: muchos japoneses están familiarizados con esta melodía.\n", + "Spanish Prediction: eeeha eumóne aj ds á eamilia oa . pom ml álmunasan.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al menos la mary la media?',)\n", + "-------------------------------------------\n", + "Iteration 3300 : 0.923974335193634\n", + "English: i think this sweater will look good on you.\n", + "Spanish Translation: creo que este suéter te va a quedar muy bien.\n", + "Spanish Prediction: creo que es á ee lammqo vaya tue artcac huen.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al con la mediano me al media?',)\n", + "-------------------------------------------\n", + "Iteration 3400 : 1.2940101623535156\n", + "English: everybody can see that he has a crush on her.\n", + "Spanish Translation: cualquiera puede ver que él está enamorado de ella.\n", + "Spanish Prediction: toanquieroncoede cer eue el ts a en or .o.de llla.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al menos la mente a la mediato?',)\n", + "-------------------------------------------\n", + "Iteration 3500 : 1.1858989000320435\n", + "English: he didn't succeed in explaining what he wanted.\n", + "Spanish Translation: no consiguió explicar lo que quería.\n", + "Spanish Prediction: éo donsiguió enpeicar ea que nuería \n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al con la mary la mediante a la todo?',)\n", + "-------------------------------------------\n", + "Iteration 3600 : 1.246580719947815\n", + "English: the dampness of the weather is bad for my health.\n", + "Spanish Translation: la humedad del tiempo me hace daño a la salud.\n", + "Spanish Prediction: ea momini ole peenpospe dabereerosd la malad \n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al menos a la leyer a la mediatemente?',)\n", + "-------------------------------------------\n", + "Epoch 9\n", + "Iteration 0 : 1.5067658424377441\n", + "English: english\n", + "Spanish Translation: spanish\n", + "Spanish Prediction: eoee lta t..t ..r.t...t.....a..................t.........\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al tom la la la la la la la la la la la todo?',)\n", + "-------------------------------------------\n", + "Iteration 100 : 0.8969992995262146\n", + "English: i'm very hot.\n", + "Spanish Translation: estoy muy cachondo.\n", + "Spanish Prediction: estoy cuy conio..o.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería a la con él?',)\n", + "-------------------------------------------\n", + "Iteration 200 : 0.9071938395500183\n", + "English: i have nothing.\n", + "Spanish Translation: no tengo nada.\n", + "Spanish Prediction: no tengo nada.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir?',)\n", + "-------------------------------------------\n", + "Iteration 300 : 0.9792503118515015\n", + "English: there's no rush.\n", + "Spanish Translation: no hay prisa.\n", + "Spanish Prediction: no hay drima.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir?',)\n", + "-------------------------------------------\n", + "Iteration 400 : 0.6600550413131714\n", + "English: tom is too picky.\n", + "Spanish Translation: tomás es muy mañoso.\n", + "Spanish Prediction: tom s es uay cipa...\n", + "Evaluation translation (should we go to the mall?) : ('¿deberíamos a casa?',)\n", + "-------------------------------------------\n", + "Iteration 500 : 0.8140755295753479\n", + "English: tom was terrified.\n", + "Spanish Translation: tom estaba aterrorizado.\n", + "Spanish Prediction: tom estaba dcerroriaado.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mesta casa?',)\n", + "-------------------------------------------\n", + "Iteration 600 : 0.7485374808311462\n", + "English: tom ate your candy.\n", + "Spanish Translation: tom se comió tus dulces.\n", + "Spanish Prediction: tom ce comió co aercet.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al con él?',)\n", + "-------------------------------------------\n", + "Iteration 700 : 0.8142881393432617\n", + "English: may i eat something?\n", + "Spanish Translation: ¿puedo comer algo?\n", + "Spanish Prediction: ¿puedo eomer elgo?\n", + "Evaluation translation (should we go to the mall?) : ('¿deberíamos a la mentir?',)\n", + "-------------------------------------------\n", + "Iteration 800 : 0.7537399530410767\n", + "English: i met mary yesterday.\n", + "Spanish Translation: ayer me encontré con mary.\n", + "Spanish Prediction: myer mi mscantra aon miyy.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a casa?',)\n", + "-------------------------------------------\n", + "Iteration 900 : 1.05964195728302\n", + "English: everybody likes money.\n", + "Spanish Translation: a todo el mundo le gusta el dinero.\n", + "Spanish Prediction: t todosll mundo mo musta mn dinero.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a casa?',)\n", + "-------------------------------------------\n", + "Iteration 1000 : 0.7155493497848511\n", + "English: we're all from boston.\n", + "Spanish Translation: todos somos de boston.\n", + "Spanish Prediction: eodos eomos de boston.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a casa?',)\n", + "-------------------------------------------\n", + "Iteration 1100 : 0.8740732669830322\n", + "English: she gave him a massage.\n", + "Spanish Translation: ella le dio un masaje.\n", + "Spanish Prediction: ella le aio un merajer\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 1200 : 0.9596523642539978\n", + "English: i hate to be a nuisance.\n", + "Spanish Translation: detesto ser una molestia.\n", + "Spanish Prediction: oetesto eer cna canettadn\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la matera?',)\n", + "-------------------------------------------\n", + "Iteration 1300 : 0.9518008232116699\n", + "English: are these cups porcelain?\n", + "Spanish Translation: ¿estas tazas son de porcelana?\n", + "Spanish Prediction: ¿eltás lanos con pe crl ul?cts\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la casa?',)\n", + "-------------------------------------------\n", + "Iteration 1400 : 0.9683906435966492\n", + "English: this baby is 3 weeks old.\n", + "Spanish Translation: este bebé tiene tres semanas.\n", + "Spanish Prediction: este tebé eaene mrec de ana..\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mesa?',)\n", + "-------------------------------------------\n", + "Iteration 1500 : 0.8280206322669983\n", + "English: i'm happy to see you here.\n", + "Spanish Translation: estoy feliz de verte aquí.\n", + "Spanish Prediction: estoy peliz ae aerde aquí.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mesa?',)\n", + "-------------------------------------------\n", + "Iteration 1600 : 0.8105170130729675\n", + "English: he is an expert at fishing.\n", + "Spanish Translation: él es un experto pescando.\n", + "Spanish Prediction: él es un pxperia paraando.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al me al mediar a tom?',)\n", + "-------------------------------------------\n", + "Iteration 1700 : 0.6855104565620422\n", + "English: what did you say yesterday?\n", + "Spanish Translation: ¿qué dijiste ayer?\n", + "Spanish Prediction: ¿qué dijiste qyer?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mes?',)\n", + "-------------------------------------------\n", + "Iteration 1800 : 0.8440108895301819\n", + "English: tennis is my favorite sport.\n", + "Spanish Translation: el tenis es mi deporte favorito.\n", + "Spanish Prediction: el virestes mi pe rrta pulorito.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al alto de la la media?',)\n", + "-------------------------------------------\n", + "Iteration 1900 : 0.7059794664382935\n", + "English: i have nothing to do with it.\n", + "Spanish Translation: no tengo nada que ver con eso.\n", + "Spanish Prediction: no tengo nada que hon con éso.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al me de la la todo?',)\n", + "-------------------------------------------\n", + "Iteration 2000 : 0.9101716876029968\n", + "English: can you speak a little slower?\n", + "Spanish Translation: ¿puede hablar un poco más despacio?\n", + "Spanish Prediction: ¿puede hablar cn poco más te cocao?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al al al alto?',)\n", + "-------------------------------------------\n", + "Iteration 2100 : 0.9328427314758301\n", + "English: tom negotiated a new contract.\n", + "Spanish Translation: tom negoció un nuevo contrato.\n", + "Spanish Prediction: tom secoció unacuevo uoncraro.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al mente a la mesa?',)\n", + "-------------------------------------------\n", + "Iteration 2200 : 0.9680002331733704\n", + "English: she is now well enough to work.\n", + "Spanish Translation: está suficientemente bien como para trabajar.\n", + "Spanish Prediction: eltá nepiciente ente pien.qomp sara srabajor.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al al al al al al media?',)\n", + "-------------------------------------------\n", + "Iteration 2300 : 0.9715321660041809\n", + "English: i need to know what's happening.\n", + "Spanish Translation: necesito saber qué ocurre.\n", + "Spanish Prediction: necesito saber pué pcurri.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al tom en la llamar?',)\n", + "-------------------------------------------\n", + "Iteration 2400 : 1.0654603242874146\n", + "English: he cut down a tree in the garden.\n", + "Spanish Translation: él tumbó un árbol en el jardín.\n", + "Spanish Prediction: él pevpr qnaarbol en ll carden.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al alguien alto?',)\n", + "-------------------------------------------\n", + "Iteration 2500 : 0.951488196849823\n", + "English: what's your favorite ethnic food?\n", + "Spanish Translation: ¿cuál es tu comida étnica favorita?\n", + "Spanish Prediction: ¿cuál es tu pamiea dlriga?drvorito?\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al todo a la la medio?',)\n", + "-------------------------------------------\n", + "Iteration 2600 : 0.8184033632278442\n", + "English: tom has decided to sell his house.\n", + "Spanish Translation: tom ha decidido vender su casa.\n", + "Spanish Prediction: tom da dicidido derdrr lu casa.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al alto de la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2700 : 0.7460845708847046\n", + "English: tom and mary just don't hit it off.\n", + "Spanish Translation: tom y mary simplemente no se llevan bien.\n", + "Spanish Prediction: tom y mary do poeaonte co su foananteien.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al algo de la la la media?',)\n", + "-------------------------------------------\n", + "Iteration 2800 : 0.6891043782234192\n", + "English: tom couldn't get in touch with mary.\n", + "Spanish Translation: tom no pudo ponerse en contacto con mary.\n", + "Spanish Prediction: tom no podo aoddr elcn con icta con mary.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la llamarme a la la la la la la la mary?',)\n", + "-------------------------------------------\n", + "Iteration 2900 : 1.088558316230774\n", + "English: tom woke up with a terrible headache.\n", + "Spanish Translation: tom despertó con un terrible dolor de cabeza.\n", + "Spanish Prediction: tom sesperóó con ln prrroble aelaroae labaza.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al algo de la media?',)\n", + "-------------------------------------------\n", + "Iteration 3000 : 0.9312800765037537\n", + "English: do you know where he bought his camera?\n", + "Spanish Translation: ¿sabes dónde compró él su cámara de fotos?\n", + "Spanish Prediction: ¿sabes dónde lumpra el ei cámara?ce curo??\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al alto de la la la media?',)\n", + "-------------------------------------------\n", + "Iteration 3100 : 0.9070402383804321\n", + "English: i worked on sunday, so i had monday off.\n", + "Spanish Translation: trabajé el domingo, así que tuve el lunes libre.\n", + "Spanish Prediction: trabajé ns domingo, ¿ í eue to i dn dunes.dubro.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir a la mentir a la mediante?',)\n", + "-------------------------------------------\n", + "Iteration 3200 : 1.233055591583252\n", + "English: this melody is familiar to many japanese.\n", + "Spanish Translation: muchos japoneses están familiarizados con esta melodía.\n", + "Spanish Prediction: eechas eurane tñ mstá mamilia oano jom us acjudanea.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al alguna la la media?',)\n", + "-------------------------------------------\n", + "Iteration 3300 : 0.8720663189888\n", + "English: i think this sweater will look good on you.\n", + "Spanish Translation: creo que este suéter te va a quedar muy bien.\n", + "Spanish Prediction: creo que este qu lelope pa i cue astaac buen.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al algo de la por la pelotamente?',)\n", + "-------------------------------------------\n", + "Iteration 3400 : 1.2379230260849\n", + "English: everybody can see that he has a crush on her.\n", + "Spanish Translation: cualquiera puede ver que él está enamorado de ella.\n", + "Spanish Prediction: taanquiera eeedenler eue el tsta el morado.de ll a.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al todo la la la la la la la la la todo?',)\n", + "-------------------------------------------\n", + "Iteration 3500 : 1.156657338142395\n", + "English: he didn't succeed in explaining what he wanted.\n", + "Spanish Translation: no consiguió explicar lo que quería.\n", + "Spanish Prediction: éo considuió enplicad easque yue ía \n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al alguna por la mediante a la pelotal?',)\n", + "-------------------------------------------\n", + "Iteration 3600 : 1.1946765184402466\n", + "English: the dampness of the weather is bad for my health.\n", + "Spanish Translation: la humedad del tiempo me hace daño a la salud.\n", + "Spanish Prediction: lo moeenadode paenpo pu da e de o p ma malud.\n", + "Evaluation translation (should we go to the mall?) : ('¿debería ir al menos la leche a la leche?',)\n", + "-------------------------------------------\n" + ] + } + ], + "source": [ + "transformer.train()\n", + "transformer.to(device)\n", + "total_loss = 0\n", + "num_epochs = 10\n", + "\n", + "for epoch in range(num_epochs):\n", + " print(f\"Epoch {epoch}\")\n", + " iterator = iter(train_loader)\n", + " for batch_num, batch in enumerate(iterator):\n", + " transformer.train()\n", + " eng_batch, es_batch = batch\n", + " encoder_self_attention_mask, decoder_self_attention_mask, decoder_cross_attention_mask = create_masks(eng_batch, es_batch)\n", + " optim.zero_grad()\n", + " es_predictions = transformer(eng_batch,\n", + " es_batch,\n", + " encoder_self_attention_mask.to(device), \n", + " decoder_self_attention_mask.to(device), \n", + " decoder_cross_attention_mask.to(device),\n", + " enc_start_token=False,\n", + " enc_end_token=False,\n", + " dec_start_token=True,\n", + " dec_end_token=True)\n", + " labels = transformer.decoder.sentence_embedding.batch_tokenize(es_batch, start_token=False, end_token=True)\n", + " loss = criterian(\n", + " es_predictions.view(-1, es_vocab_size).to(device),\n", + " labels.view(-1).to(device)\n", + " ).to(device)\n", + " valid_indicies = torch.where(labels.view(-1) == spanish_to_index[PADDING_TOKEN], False, True)\n", + " loss = loss.sum() / valid_indicies.sum()\n", + " loss.backward()\n", + " optim.step()\n", + " #train_losses.append(loss.item())\n", + " if batch_num % 100 == 0:\n", + " print(f\"Iteration {batch_num} : {loss.item()}\")\n", + " print(f\"English: {eng_batch[0]}\")\n", + " print(f\"Spanish Translation: {es_batch[0]}\")\n", + " es_sentence_predicted = torch.argmax(es_predictions[0], axis=1)\n", + " predicted_sentence = \"\"\n", + " for idx in es_sentence_predicted:\n", + " if idx == spanish_to_index[END_TOKEN]:\n", + " break\n", + " predicted_sentence += index_to_spanish[idx.item()]\n", + " print(f\"Spanish Prediction: {predicted_sentence}\")\n", + "\n", + "\n", + " transformer.eval()\n", + " es_sentence = (\"\",)\n", + " eng_sentence = (\"should we go to the mall?\",)\n", + " for word_counter in range(max_sequence_length):\n", + " encoder_self_attention_mask, decoder_self_attention_mask, decoder_cross_attention_mask= create_masks(eng_sentence, es_sentence)\n", + " predictions = transformer(eng_sentence,\n", + " es_sentence,\n", + " encoder_self_attention_mask.to(device), \n", + " decoder_self_attention_mask.to(device), \n", + " decoder_cross_attention_mask.to(device),\n", + " enc_start_token=False,\n", + " enc_end_token=False,\n", + " dec_start_token=True,\n", + " dec_end_token=False)\n", + " next_token_prob_distribution = predictions[0][word_counter] # not actual probs\n", + " next_token_index = torch.argmax(next_token_prob_distribution).item()\n", + " next_token = index_to_spanish[next_token_index]\n", + " es_sentence = (es_sentence[0] + next_token, )\n", + " if next_token == END_TOKEN:\n", + " break\n", + " \n", + " print(f\"Evaluation translation (should we go to the mall?) : {es_sentence}\")\n", + " print(\"-------------------------------------------\")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "1nosVPGVijId" + }, + "source": [ + "## Inference" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "id": "ZOQe-juylBiJ" + }, + "outputs": [], + "source": [ + "transformer.eval()\n", + "def translate(eng_sentence):\n", + " eng_sentence = (eng_sentence,)\n", + " es_sentence = (\"\",)\n", + " for word_counter in range(max_sequence_length):\n", + " encoder_self_attention_mask, decoder_self_attention_mask, decoder_cross_attention_mask= create_masks(eng_sentence, es_sentence)\n", + " predictions = transformer(eng_sentence,\n", + " es_sentence,\n", + " encoder_self_attention_mask.to(device), \n", + " decoder_self_attention_mask.to(device), \n", + " decoder_cross_attention_mask.to(device),\n", + " enc_start_token=False,\n", + " enc_end_token=False,\n", + " dec_start_token=True,\n", + " dec_end_token=False)\n", + " next_token_prob_distribution = predictions[0][word_counter]\n", + " next_token_index = torch.argmax(next_token_prob_distribution).item()\n", + " next_token = index_to_spanish[next_token_index]\n", + " es_sentence = (es_sentence[0] + next_token, )\n", + " if next_token == END_TOKEN:\n", + " break\n", + " return es_sentence[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [], + "source": [ + "torch.save(transformer.state_dict(), 'englishTOspanish.pt')" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "transformer.load_state_dict(torch.load(\"englishTOspanish.pt\"))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#i'm happy to see you here\n", + "#i have nothing to do with it\n", + "#what did you say yesterday?" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "BDVH_YsxlK6q", + "outputId": "83c47f99-53c0-4c2d-c26a-aaa426f50563" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "¿qué deberías cuando el días días días?\n" + ] + } + ], + "source": [ + "translation = translate(\"what should we do when the day starts?\")\n", + "print(translation)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "sJuJKHqFldW3", + "outputId": "71aa2c6c-ec77-4b02-d39b-bd724012fb53" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "no puedo estaba de la lentiempo de la las las las informa.\n" + ] + } + ], + "source": [ + "translation = translate(\"i cannot stand this smell\")\n", + "print(translation)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "accelerator": "GPU", + "colab": { + "provenance": [] + }, + "gpuClass": "standard", + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.3" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +}