{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "3UeycYCyxDfE"
      },
      "source": [
        "# TRANSLATOR"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "8BfUjVxBcz5N"
      },
      "source": [
        "## instalation"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "WXqM38xBRHu2",
        "outputId": "075e90fc-7ba6-4b54-9bb9-414037cc352e"
      },
      "outputs": [],
      "source": [
        "%%time\n",
        "!pip install -q -U tensorflow-text\n",
        "!pip install datasets\n",
        "!pip install -q tensorflow_datasets\n",
        "!pip install pydot\n",
        "!pip install tensorflow\n",
        "!pip install numpy\n",
        "!cd /content\n",
        "!clear"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "Ukvs1XfMG7aG"
      },
      "outputs": [],
      "source": [
        "import tensorflow as tf\n",
        "import tensorflow_text as tf_text\n",
        "import tensorflow_datasets as tfds\n",
        "import numpy as np\n",
        "import matplotlib.pyplot as plt\n",
        "import requests\n",
        "import functools\n",
        "import collections\n",
        "import os\n",
        "import pathlib\n",
        "import re\n",
        "import string\n",
        "import tempfile\n",
        "import time\n",
        "import matplotlib.pyplot as plt\n",
        "import os\n",
        "import re\n",
        "import shutil\n",
        "import string\n",
        "import tensorflow as tf\n",
        "\n",
        "from tensorflow.keras import layers\n",
        "from tensorflow.keras import losses\n",
        "import pydot"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "7V7igFwpc6Hs"
      },
      "source": [
        "## dataset"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 280,
          "referenced_widgets": [
            "a5b60d70fc784178aae195ba50aa17fb",
            "2f81a198eff14fd9baf1c44eba10e66a",
            "da5df7f8dc8b4efa9ef1fe766fda07e4",
            "3cbdaac2925e4f259f8daa74f4a4b0e7",
            "131339a75d4f4b10900f433780ceda69",
            "684fe6b833ae4964952c6480fae46f57",
            "895fece0320d4e4c80971bb9341e4e1c",
            "25efff7c11d3468fb91d922a42371142",
            "1641d12ee23646c5bc9f59438ca76468",
            "89a141e6736947538de57a715aca30bd",
            "da1528b34ff745e3b7cc2363dd9dea69",
            "ffcb28bfdc0d4341a5cb2fe0b14d3657",
            "37a47c1b7eac4d4fb3ee224fdf0392ee",
            "18e9a5f3d42f4a93b003876b7bcd199c",
            "9842e84a76e64f1e862bc39a06582a71",
            "52fd339b0e944e74b7df1b176ee90f5b",
            "78a4e11bb5f742a4b755cd60137b65c4",
            "c646272c9a86474c9bda867e57035aaf",
            "1840095e6efe495a960a1fd6d3060f1c",
            "c832fdd570f4460c8f37640c20db5089",
            "9a29068ca9fd478ab4b2b64b29a30452",
            "617134a74765472b9d621d8d806e6f90",
            "f1cd45d36c604216bd526f4ee135edcc",
            "bf7382bdfe9c46c39cc0e48487aa3e7e",
            "ee55c21104a548938945911d1be5e8bd",
            "e793e43e37b14498bc34c4f36296d2ac",
            "0433034eb2744785b33f79961a2c04e4",
            "8b1fd60dc6fb4094bfecc63c824cdda5",
            "17879bad90954e9cb888b3675c472f9b",
            "df815e17a0014f94b2ed81fdca2b8a30",
            "7b1e2448b06e4235b8502ed17084482a",
            "cedda31df2a34e97935d72c8dfd5da74",
            "a4d33f99d00348a6a733e8936feac62c"
          ]
        },
        "id": "ZaMtoUtAREzs",
        "outputId": "f8dadd74-5e04-4fa6-9392-6ccd6b2cb458"
      },
      "outputs": [],
      "source": [
        "from datasets import load_dataset\n",
        "\n",
        "dataset = load_dataset(\"Helsinki-NLP/opus_books\", \"en-fr\")\n",
        "data = dataset[\"train\"]\n",
        "\n",
        "french_sentences = [example[\"fr\"] for example in data[\"translation\"][:127085]]\n",
        "english_sentences = [example[\"en\"] for example in data[\"translation\"][:127085]]\n",
        "dataset = tf.data.Dataset.from_tensor_slices((french_sentences, english_sentences))\n",
        "\n",
        "french_sentences_decoded = []\n",
        "english_sentences_decoded = []\n",
        "\n",
        "for french_sentence, english_sentence in dataset.take(12708):\n",
        "    french_sentences_decoded.append(\"b '\"+french_sentence.numpy().decode('utf-8'))\n",
        "    english_sentences_decoded.append(\"b '\"+english_sentence.numpy().decode('utf-8'))\n",
        "\n",
        "print(\"Nombre de phrases en français :\", len(french_sentences_decoded))\n",
        "print(\"Nombre de phrases en anglais :\", len(english_sentences_decoded))"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "2tb7H5uFQoBA"
      },
      "outputs": [],
      "source": [
        "train_fr = french_sentences\n",
        "train_en = english_sentences"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "NzS8h0budHWv"
      },
      "source": [
        "## vocab"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "72uMXsQhFIx8"
      },
      "outputs": [],
      "source": [
        "from tensorflow_text.tools.wordpiece_vocab import bert_vocab_from_dataset as bert_vocab\n",
        "\n",
        "bert_tokenizer_params = dict(lower_case=True)\n",
        "reserved_tokens = [\"[PAD]\", \"[UNK]\", \"[START]\", \"[END]\"]\n",
        "\n",
        "bert_vocab_args = {\n",
        "    'vocab_size': 8000,\n",
        "    'reserved_tokens': reserved_tokens,\n",
        "    'bert_tokenizer_params': bert_tokenizer_params,\n",
        "    'learn_params': {},\n",
        "}\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "q6f3mrA-DK0n",
        "outputId": "b5413b20-51a6-4b79-9bad-ae1aeae4cf42"
      },
      "outputs": [],
      "source": [
        "%%time\n",
        "en_vocab = bert_vocab.bert_vocab_from_dataset(\n",
        "    tf.data.Dataset.from_tensor_slices(english_sentences).batch(1000).prefetch(2),\n",
        "    **bert_vocab_args\n",
        ")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "EJZzz1x5YY0x",
        "outputId": "64c27808-53ad-48b9-9a08-ee65c322a6e4"
      },
      "outputs": [],
      "source": [
        "%%time\n",
        "fr_vocab = bert_vocab.bert_vocab_from_dataset(\n",
        "    tf.data.Dataset.from_tensor_slices(french_sentences).batch(1000).prefetch(2),\n",
        "    **bert_vocab_args\n",
        ")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "1hmXuHHNcBHg"
      },
      "outputs": [],
      "source": [
        "def write_vocab_file(filepath, vocab):\n",
        "  with open(filepath, 'w') as f:\n",
        "    for token in vocab:\n",
        "      print(token, file=f)\n",
        "write_vocab_file('en_vocab.txt', en_vocab)\n",
        "write_vocab_file('fr_vocab.txt', fr_vocab)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "kLTf_mEvfNR9"
      },
      "source": [
        "#` TOKENIZER `\n",
        "\n",
        "\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "jGshnQ2idy8I"
      },
      "outputs": [],
      "source": [
        "fr_tokenizer = tf_text.BertTokenizer('fr_vocab.txt', **bert_tokenizer_params)\n",
        "en_tokenizer = tf_text.BertTokenizer('en_vocab.txt', **bert_tokenizer_params)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "bbQyYKhHkkDe",
        "outputId": "ef6ba4a4-7bab-432e-adcf-6a85440f2c22"
      },
      "outputs": [],
      "source": [
        "# Tokenize the examples -> (batch, word, word-piece)\n",
        "en_tokenizere = en_tokenizer.tokenize(\"hello how are you Vadim\")\n",
        "# Merge the word and word-piece axes -> (batch, tokens)\n",
        "en_tokenizere= en_tokenizere.merge_dims(-2,-1)\n",
        "\n",
        "for ex in en_tokenizere.to_list():\n",
        "  print(ex)\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "k0m1461Gwy3e"
      },
      "outputs": [],
      "source": [
        "words = en_tokenizer.detokenize(token_batch)\n",
        "tf.strings.reduce_join(words, separator=' ', axis=-1)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "BjoPdwoxBWw2"
      },
      "source": [
        "## model"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "7OqoDOybbwi6"
      },
      "outputs": [],
      "source": [
        "max_length = 200\n",
        "\n",
        "fr_sequences = [fr_tokenizer.tokenize(french_sentence.numpy().decode('utf-8')).merge_dims(-2,-1)\n",
        "                for french_sentence, _ in dataset.take(2000)]\n",
        "fr_ragged = tf.ragged.stack(fr_sequences)\n",
        "fr_padded = fr_ragged.to_tensor(default_value=0, shape=[None, None, max_length])\n",
        "\n",
        "fr_sequencesdeocde = [fr_tokenizer.tokenize(\"[START]\"+french_sentence.numpy().decode('utf-8')+\"[END]\").merge_dims(-2,-1)\n",
        "                for french_sentence, _ in dataset.take(2000)]\n",
        "fr_raggeddecode = tf.ragged.stack(fr_sequences)\n",
        "fr_paddeddecode = fr_ragged.to_tensor(default_value=0, shape=[None, None, max_length])\n",
        "\n",
        "en_sequences = [en_tokenizer.tokenize(english_sentence.numpy().decode('utf-8')).merge_dims(-2,-1)\n",
        "                for _, english_sentence in dataset.take(2000)]\n",
        "en_ragged = tf.ragged.stack(en_sequences)\n",
        "en_padded = en_ragged.to_tensor(default_value=0, shape=[None, None, max_length])\n",
        "\n",
        "x_train = fr_padded\n",
        "x2_train = fr_paddeddecode\n",
        "y_train = en_padded\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 493
        },
        "id": "FIp6S-MR7Pls",
        "outputId": "8f187fbe-4f57-4a4f-bb91-c1dc9e098552"
      },
      "outputs": [],
      "source": [
        "inputs = tf.keras.Input(shape=(1,200))\n",
        "embedding_dim = 512\n",
        "lstm_units = 1024\n",
        "vocab_size_en = len(en_vocab) + len(reserved_tokens)\n",
        "vocab_size_fr = len(fr_vocab) + len(reserved_tokens)\n",
        "\n",
        "encoder_inputs = tf.keras.layers.Input(shape=(200,))\n",
        "encoder_embedding = tf.keras.layers.Embedding(input_dim=vocab_size_en, output_dim=embedding_dim, mask_zero=True)(encoder_inputs)\n",
        "encoder_outputs, state_h, state_c = tf.keras.layers.LSTM(lstm_units, return_state=True)(encoder_embedding)\n",
        "encoder_states = [state_h, state_c]\n",
        "\n",
        "decoder_inputs = tf.keras.layers.Input(shape=(200,))\n",
        "decoder_embedding = tf.keras.layers.Embedding(input_dim=vocab_size_fr, output_dim=embedding_dim, mask_zero=True)(decoder_inputs)\n",
        "decoder_lstm = tf.keras.layers.LSTM(lstm_units, return_sequences=True, return_state=True)\n",
        "decoder_outputs, _, _ = decoder_lstm(decoder_embedding, initial_state=encoder_states)\n",
        "decoder_dense = tf.keras.layers.Dense(vocab_size_fr, activation='softmax')\n",
        "decoder_outputs = decoder_dense(decoder_outputs)\n",
        "model = tf.keras.models.Model(inputs=[encoder_inputs, decoder_inputs], outputs=decoder_outputs)\n",
        "model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])\n",
        "\n",
        "\n",
        "model.summary()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "YOryNiyc15Tf"
      },
      "outputs": [],
      "source": [
        "def format_sequences(tokenizer, sentences, max_length):\n",
        "    sequences = tokenizer.tokenize(sentences).merge_dims(-2, -1)\n",
        "    padded_sequences = sequences.to_tensor(default_value=0, shape=[None, max_length])\n",
        "    return padded_sequences\n",
        "\n",
        "encoder_input_data = format_sequences(en_tokenizer, train_en, max_length)\n",
        "decoder_input_data = format_sequences(fr_tokenizer, [\"[START] \" + sentence for sentence in train_fr], max_length)\n",
        "decoder_target_data = format_sequences(fr_tokenizer, [sentence + \" [END]\" for sentence in train_fr], max_length)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "0oKPxeCMPcsF",
        "outputId": "0a2d9241-1984-4aa7-c1d1-c5a8d982e542"
      },
      "outputs": [],
      "source": [
        "batch_size = 2\n",
        "epochs = 3\n",
        "\n",
        "model.fit([encoder_input_data, decoder_input_data], decoder_target_data,\n",
        "          batch_size=batch_size,\n",
        "          epochs=epochs,\n",
        "          validation_split=0.2)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "avXVDSHx18KC"
      },
      "outputs": [],
      "source": [
        "encoder_model = tf.keras.models.Model(encoder_inputs, encoder_states)\n",
        "\n",
        "decoder_state_input_h = tf.keras.Input(shape=(lstm_units,))\n",
        "decoder_state_input_c = tf.keras.Input(shape=(lstm_units,))\n",
        "decoder_states_inputs = [decoder_state_input_h, decoder_state_input_c]\n",
        "\n",
        "decoder_outputs, state_h, state_c = decoder_lstm(\n",
        "    decoder_embedding, initial_state=decoder_states_inputs)\n",
        "decoder_states = [state_h, state_c]\n",
        "decoder_outputs = decoder_dense(decoder_outputs)\n",
        "\n",
        "decoder_model = tf.keras.models.Model(\n",
        "    [decoder_inputs] + decoder_states_inputs,\n",
        "    [decoder_outputs] + decoder_states)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "tu-NqIEA19if"
      },
      "outputs": [],
      "source": [
        "def translate(input_sentence):\n",
        "    # Prepare the input sentence\n",
        "    input_seq = format_sequences(en_tokenizer, [input_sentence], max_length)\n",
        "    states_value = encoder_model.predict(input_seq)\n",
        "\n",
        "    # Generate empty target sequence of length 1 with only the start token\n",
        "    target_seq = np.zeros((1, 1))\n",
        "    target_seq[0, 0] = fr_tokenizer.vocab['[START]']\n",
        "\n",
        "    # Sampling loop for a batch of sequences\n",
        "    stop_condition = False\n",
        "    decoded_sentence = ''\n",
        "    while not stop_condition:\n",
        "        output_tokens, h, c = decoder_model.predict([target_seq] + states_value)\n",
        "\n",
        "        # Sample a token and add the corresponding character to the decoded sentence\n",
        "        sampled_token_index = np.argmax(output_tokens[0, -1, :])\n",
        "        sampled_char = fr_tokenizer.detokenize([[sampled_token_index]]).numpy()[0].decode('utf-8')\n",
        "        decoded_sentence += sampled_char + ' '\n",
        "\n",
        "        # Exit condition: either hit max length or find stop token.\n",
        "        if (sampled_char == '[END]' or len(decoded_sentence) > max_length):\n",
        "            stop_condition = True\n",
        "\n",
        "        # Update the target sequence (length 1).\n",
        "        target_seq = np.zeros((1, 1))\n",
        "        target_seq[0, 0] = sampled_token_index\n",
        "\n",
        "        # Update states\n",
        "        states_value = [h, c]\n",
        "\n",
        "    return decoded_sentence"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 447
        },
        "id": "KimJ6ANPMz6r",
        "outputId": "95dcfad1-3d7f-410d-ac24-adcc3215741f"
      },
      "outputs": [],
      "source": [
        "history = model.fit([x_train,x2_train], y_train, epochs=10, batch_size=2)"
      ]
    }
  ],
  "metadata": {
    "colab": {
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3",
      "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.11.9"
    },
    "widgets": {
      "application/vnd.jupyter.widget-state+json": {
        "0433034eb2744785b33f79961a2c04e4": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "131339a75d4f4b10900f433780ceda69": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "1641d12ee23646c5bc9f59438ca76468": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "ProgressStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "17879bad90954e9cb888b3675c472f9b": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "1840095e6efe495a960a1fd6d3060f1c": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "18e9a5f3d42f4a93b003876b7bcd199c": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "FloatProgressModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_1840095e6efe495a960a1fd6d3060f1c",
            "max": 20985324,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_c832fdd570f4460c8f37640c20db5089",
            "value": 20985324
          }
        },
        "25efff7c11d3468fb91d922a42371142": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "2f81a198eff14fd9baf1c44eba10e66a": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_684fe6b833ae4964952c6480fae46f57",
            "placeholder": "​",
            "style": "IPY_MODEL_895fece0320d4e4c80971bb9341e4e1c",
            "value": "Downloading readme: 100%"
          }
        },
        "37a47c1b7eac4d4fb3ee224fdf0392ee": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_78a4e11bb5f742a4b755cd60137b65c4",
            "placeholder": "​",
            "style": "IPY_MODEL_c646272c9a86474c9bda867e57035aaf",
            "value": "Downloading data: 100%"
          }
        },
        "3cbdaac2925e4f259f8daa74f4a4b0e7": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_89a141e6736947538de57a715aca30bd",
            "placeholder": "​",
            "style": "IPY_MODEL_da1528b34ff745e3b7cc2363dd9dea69",
            "value": " 28.1k/28.1k [00:00&lt;00:00, 1.51MB/s]"
          }
        },
        "52fd339b0e944e74b7df1b176ee90f5b": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "617134a74765472b9d621d8d806e6f90": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "684fe6b833ae4964952c6480fae46f57": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "78a4e11bb5f742a4b755cd60137b65c4": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "7b1e2448b06e4235b8502ed17084482a": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "ProgressStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "895fece0320d4e4c80971bb9341e4e1c": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "89a141e6736947538de57a715aca30bd": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "8b1fd60dc6fb4094bfecc63c824cdda5": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "9842e84a76e64f1e862bc39a06582a71": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_9a29068ca9fd478ab4b2b64b29a30452",
            "placeholder": "​",
            "style": "IPY_MODEL_617134a74765472b9d621d8d806e6f90",
            "value": " 21.0M/21.0M [00:00&lt;00:00, 29.9MB/s]"
          }
        },
        "9a29068ca9fd478ab4b2b64b29a30452": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "a4d33f99d00348a6a733e8936feac62c": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "a5b60d70fc784178aae195ba50aa17fb": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HBoxModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_2f81a198eff14fd9baf1c44eba10e66a",
              "IPY_MODEL_da5df7f8dc8b4efa9ef1fe766fda07e4",
              "IPY_MODEL_3cbdaac2925e4f259f8daa74f4a4b0e7"
            ],
            "layout": "IPY_MODEL_131339a75d4f4b10900f433780ceda69"
          }
        },
        "bf7382bdfe9c46c39cc0e48487aa3e7e": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_8b1fd60dc6fb4094bfecc63c824cdda5",
            "placeholder": "​",
            "style": "IPY_MODEL_17879bad90954e9cb888b3675c472f9b",
            "value": "Generating train split: 100%"
          }
        },
        "c646272c9a86474c9bda867e57035aaf": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "c832fdd570f4460c8f37640c20db5089": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "ProgressStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "cedda31df2a34e97935d72c8dfd5da74": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "da1528b34ff745e3b7cc2363dd9dea69": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "da5df7f8dc8b4efa9ef1fe766fda07e4": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "FloatProgressModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_25efff7c11d3468fb91d922a42371142",
            "max": 28064,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_1641d12ee23646c5bc9f59438ca76468",
            "value": 28064
          }
        },
        "df815e17a0014f94b2ed81fdca2b8a30": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "e793e43e37b14498bc34c4f36296d2ac": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_cedda31df2a34e97935d72c8dfd5da74",
            "placeholder": "​",
            "style": "IPY_MODEL_a4d33f99d00348a6a733e8936feac62c",
            "value": " 127085/127085 [00:00&lt;00:00, 284966.50 examples/s]"
          }
        },
        "ee55c21104a548938945911d1be5e8bd": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "FloatProgressModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_df815e17a0014f94b2ed81fdca2b8a30",
            "max": 127085,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_7b1e2448b06e4235b8502ed17084482a",
            "value": 127085
          }
        },
        "f1cd45d36c604216bd526f4ee135edcc": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HBoxModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_bf7382bdfe9c46c39cc0e48487aa3e7e",
              "IPY_MODEL_ee55c21104a548938945911d1be5e8bd",
              "IPY_MODEL_e793e43e37b14498bc34c4f36296d2ac"
            ],
            "layout": "IPY_MODEL_0433034eb2744785b33f79961a2c04e4"
          }
        },
        "ffcb28bfdc0d4341a5cb2fe0b14d3657": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HBoxModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_37a47c1b7eac4d4fb3ee224fdf0392ee",
              "IPY_MODEL_18e9a5f3d42f4a93b003876b7bcd199c",
              "IPY_MODEL_9842e84a76e64f1e862bc39a06582a71"
            ],
            "layout": "IPY_MODEL_52fd339b0e944e74b7df1b176ee90f5b"
          }
        }
      }
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}


dataset example :
id
stringlengths
230.1%
translation
translation
0	
{ "en": "The Wanderer", "fr": "Le grand Meaulnes" }
1	
{ "en": "Alain-Fournier", "fr": "Alain-Fournier" }
2	
{ "en": "First Part", "fr": "PREMIÈRE PARTIE" }
3	
{ "en": "I", "fr": "CHAPITRE PREMIER" }
4	
{ "en": "THE BOARDER", "fr": "LE PENSIONNAIRE" }
5	
{ "en": "He arrived at our home on a Sunday of November, 189-.", "fr": "Il arriva chez nous un dimanche de novembre 189-…" }
6	
{ "en": "I still say 'our home,' although the house no longer belongs to us.", "fr": "Je continue à dire « chez nous », bien que la maison ne nous appartienne plus." }
7	
{ "en": "We left that part of the country nearly fifteen years ago and shall certainly never go back to it.", "fr": "Nous avons quitté le pays depuis bientôt quinze ans et nous n’y reviendrons certainement jamais." }
8	
{ "en": "We were living in the building of the Higher Elementary Classes at Sainte-Agathe's School.", "fr": "Nous habitions les bâtiments du Cours Supérieur de Sainte-Agathe." }
9	
{ "en": "My father, whom I used to call M. Seurel as did other pupils, was head of the Middle School and also of the Higher Elementary classes where pupils worked for the preliminary teacher's examination.", "fr": "Mon père, que j’appelais M. Seurel, comme les autres élèves, y dirigeait à la fois le Cours Supérieur, où l’on préparait le brevet d’instituteur, et le Cours Moyen." }
10	
{ "en": "My mother taught the infants.", "fr": "Ma mère faisait la petite classe." }
11	
{ "en": "At the extreme end of the small town, a long red house with five glass doors and a Virginia creeper upon its walls ; an immense courtyard with shelters, a washhouse and a huge gateway, on the side looking towards the village; on the north side, a small gate opening on the road leading to the station three kilometres off; on the south, at the back of the house, fields, gardens, meadows joining the outskirts...such is the simple plan of this dwelling where I spent the most troubled but the most happy days of my life - the house from which we launched our adventures and to which they returned to break themselves like waves on a bare rock.", "fr": "Une longue maison rouge, avec cinq portes vitrées, sous des vignes vierges, à l’extrémité du bourg ; une cour immense avec préaux et buanderie, qui ouvrait en avant sur le village par un grand portail ; sur le côté nord, la route où donnait une petite grille et qui menait vers La Gare, à trois kilomètres ; au sud et par derrière, des champs, des jardins et des prés qui rejoignaient les faubourgs… tel est le plan sommaire de cette demeure où s’écoulèrent les jours les plus tourmentés et les plus chers de ma vie – demeure d’où partirent et où revinrent se briser, comme des vagues sur un rocher désert, nos aventures." }
12	
{ "en": "At the time of some new 'appointments,' a whim of fate, due to some inspector or to the Prefect, had led us there.", "fr": "Le hasard des « changements », une décision d’inspecteur ou de préfet nous avaient conduits là." }
13	
{ "en": "Towards the end of the summer holidays, a long time ago, a peasant cart, preceding our household goods, deposited my mother and myself before the little rusty gate.", "fr": "Vers la fin des vacances, il y a bien longtemps, une voiture de paysan, qui précédait notre ménage, nous avait déposés, ma mère et moi, devant la petite grille rouillée." }
14	
{ "en": "Urchins who were stealing peaches in the garden silently escaped through holes in the hedge . . . My mother, whom we used to call Millie and who was the most methodical housekeeper I ever knew, had at once gone into the rooms full of dusty straw, and had declared with much consternation - as was her custom at each 'removal' - that our furniture would never fit in a house so badly built. . .", "fr": "Des gamins qui volaient des pêches dans le jardin s’étaient enfuis silencieusement par les trous de la haie… Ma mère, que nous appelions Millie, et qui était bien la ménagère la plus méthodique que j’aie jamais connue, était entrée aussitôt dans les pièces remplies de paille poussiéreuse, et tout de suite elle avait constaté avec désespoir, comme à chaque « déplacement », que nos meubles ne tiendraient jamais dans une maison si mal construite… Elle était sortie pour me confier sa détresse." }
15	
{ "en": "She had come out to impart her trouble to me. While speaking she had, with her handkerchief, gently wiped my face blackened by the journey.", "fr": "Tout en me parlant, elle avait essuyé doucement avec son mouchoir ma figure d’enfant noircie par le voyage." }
16	
{ "en": "Then she had gone back to consider what doors and windows would have to be blocked to make the place habitable ... As for me, wearing a big straw hat with streamers, I was left alone on the gravel of that strange playground, waiting for her, prying shyly around the well and under the cart-shed.", "fr": "Puis elle était rentrée faire le compte de toutes les ouvertures qu’il allait falloir condamner pour rendre le logement habitable… Quant à moi, coiffé d’un grand chapeau de paille à rubans, j’étais resté là, sur le gravier de cette cour étrangère, à attendre, à fureter petitement autour du puits et sous le hangar." }
17	
{ "en": "Thus to-day I picture our arrival.", "fr": "C’est ainsi, du moins, que j’imagine aujourd’hui notre arrivée." }
18	
{ "en": "For as soon as I wish to bring back the distant memory of that first evening when I waited in out playground at Sainte-Agathe, at once it is another kind of waiting which I recall, at once I see myself again, both hands pressed to the bars of the front gate, anxiously watching for some one who will soon come down the High Street.", "fr": "Car aussitôt que je veux retrouver le lointain souvenir de cette première soirée d’attente dans notre cour de Sainte-Agathe, déjà ce sont d’autres attentes que je me rappelle ; déjà, les deux mains appuyées aux barreaux du portail, je me vois épiant avec anxiété quelqu’un qui va descendre la grand’rue." }
19	
{ "en": "If I try to imagine that first night which I must have spent in my attic, amidst the lumber-rooms on the upper storey, I recall other nights; I am no longer alone in that room; a tall, restless, and friendly shadow moves along its walls and walks to and fro.", "fr": "Et si j’essaie d’imaginer la première nuit que je dus passer dans ma mansarde, au milieu des greniers du premier étage, déjà ce sont d’autres nuits que je me rappelle ; je ne suis plus seul dans cette chambre ; une grande ombre inquiète et amie passe le long des murs et se promène." }
20	
{ "en": "And that quiet countryside - the school, old Father Martin's field, with its three walnut trees, the garden daily invaded on the stroke of four by women paying calls - all this is, in my memory, forever stirred and transformed by the presence of him who upset all our youth and whose sudden flight even did not leave us in peace.", "fr": "Tout ce paysage paisible – l’école, le champ du père Martin, avec ses trois noyers, le jardin dès quatre heures envahi chaque jour par des femmes en visite – est à jamais, dans ma mémoire, agité, transformé par la présence de celui qui bouleversa toute notre adolescence et dont la fuite même ne nous a pas laissé de repos." }
21	
{ "en": "Yet we had already been ten years in that district when Meaulnes arrived.", "fr": "Nous étions pourtant depuis dix ans dans ce pays lorsque Meaulnes arriva." }
22	
{ "en": "I was fifteen.", "fr": "J’avais quinze ans." }
23	
{ "en": "It was a cold Sunday of November, the first day of autumn to make one think of winter.", "fr": "C’était un froid dimanche de novembre, le premier jour d’automne qui fît songer à l’hiver." }
24	
{ "en": "All day Millie had waited for the station omnibus to bring her a hat for the bad weather.", "fr": "Toute la journée, Millie avait attendu une voiture de La Gare qui devait lui apporter un chapeau pour la mauvaise saison." }
25	
{ "en": "That morning she missed Mass, and right up to the sermon, from my place in the choir with the other children, I looked anxiously towards the door to see her come to church wearing her new hat.", "fr": "Le matin, elle avait manqué la messe ; et jusqu’au sermon, assis dans le chœur avec les autres enfants, j’avais regardé anxieusement du côté des cloches, pour la voir entrer avec son chapeau neuf." }
26	
{ "en": "In the afternoon, I had to go to vespers alone.", "fr": "Après midi, je dus partir seul à vêpres." }
27	
{ "en": "'Anyhow,' she said to comfort me, brushing my little suit with her hand, 'even if it had come, this precious hat, I should have had to spend my Sunday making it up again.'", "fr": "– D’ailleurs, me dit-elle, pour me consoler, en brossant de sa main mon costume d’enfant, même s’il était arrivé, ce chapeau, il aurait bien fallu, sans doute, que je passe mon dimanche à le refaire." }
28	
{ "en": "This is how our winter Sundays were often spent.", "fr": "Souvent nos dimanches d’hiver se passaient ainsi." }
29	
{ "en": "In the early morning Father went off to some misty pond to jack-fish from a boat, and Mother retired till nightfall into her dark bedroom, to remake her simple dresses.", "fr": "Dès le matin, mon père s’en allait au loin, sur le bord de quelque étang couvert de brume, pêcher le brochet dans une barque ; et ma mère, retirée jusqu’à la nuit dans sa chambre obscure, rafistolait d’humbles toilettes." }
30	
{ "en": "She shut herself up in that way for fear some lady visitor, as poor as herself and as proud, might surprise her at the job.", "fr": "Elle s’enfermait ainsi de crainte qu’une dame de ses amies, aussi pauvre qu’elle mais aussi fière, vînt la surprendre." }
31	
{ "en": "As for me, vespers over, I waited, reading in the cold dining-room, until she opened the door to show me how she was getting on.", "fr": "Et moi, les vêpres finies, j’attendais, en lisant dans la froide salle à manger, qu’elle ouvrît la porte pour me montrer comment ça lui allait." }
32	
{ "en": "That Sunday, a little excitement in front of the church kept me out-of-doors after vespers.", "fr": "Ce dimanche-là, quelque animation devant l’église me retint dehors après vêpres." }
33	
{ "en": "A christening, under the porch, had attracted a crowd of urchins.", "fr": "Un baptême, sous le porche, avait attroupé des gamins." }
34	
{ "en": "In the square a few villagers had put on their firemen's jackets and piled their arms ; stiff and stamping their feet with cold, they were listening to Boujardon, the corporal, losing himself in theory ...", "fr": "Sur la place, plusieurs hommes du bourg avaient revêtu leurs vareuses de pompiers ; et, les faisceaux formés, transis et battant la semelle, ils écoutaient Boujardon, le brigadier, s’embrouiller dans la théorie…" }
35	
{ "en": "The christening bells stopped suddenly, like festive chimes at a mistaken time and place. Boujardon and his men, rifles slung over their shoulders, dragged off the fire engine at a slow trot, and I saw them disappear at the first turning, followed by four silent urchins, crushing under their heavy boots the twigs on the frozen road, down which I dared not follow them.", "fr": "Le carillon du baptême s’arrêta soudain, comme une sonnerie de fête qui se serait trompée de jour et d’endroit ; Boujardon et ses hommes, l’arme en bandoulière, emmenèrent la pompe au petit trot ; et je les vis disparaître au premier tournant, suivis de quatre gamins silencieux, écrasant de leurs grosses semelles les brindilles de la route givrée où je n’osais pas les suivre." }
36	
{ "en": "In the village the only place left alive was the Café Daniel, from which I heard the murmurs of the drinkers' talk rise and fall, and hugging the low wall of the big playground which separated our house from the village, I came, rather anxious at being late, to the small gate.", "fr": "Dans le bourg, il n’y eut plus alors de vivant que le café Daniel, où j’entendais sourdement monter puis s’apaiser les discussions des buveurs. Et, frôlant le mur bas de la grande cour qui isolait notre maison du village, j’arrivai, un peu anxieux de mon retard, à la petite grille." }
37	
{ "en": "It was ajar and I saw at once that something unusual was happening.", "fr": "Elle était entr’ouverte et je vis aussitôt qu’il se passait quelque chose d’insolite." }
38	
{ "en": "In fact, there stood, outside the dining-room door - the nearest of the five glass doors opening on the playground - a grey-headed woman, leaning forward and trying to look through the curtains.", "fr": "En effet, à la porte de la salle à manger – la plus rapprochée des cinq portes vitrées qui donnaient sur la cour – une femme aux cheveux gris, penchée, cherchait à voir au travers des rideaux." }
39	
{ "en": "She was small and wore a black old- fashioned velvet bonnet.", "fr": "Elle était petite, coiffée d’une capote de velours noir à l’ancienne mode." }
40	
{ "en": "Her face was thin and refined, but worn with anxiety, and, at sight of her, I do not know what misgiving made me stand still on the first step, in front of the gate.", "fr": "Elle avait un visage maigre et fin, mais ravagé par l’inquiétude ; et je ne sais quelle appréhension, à sa vue, m’arrêta sur la première marche, devant la grille." }
41	
{ "en": "'My goodness, where's he gone!' she was muttering to herself.", "fr": "– Où est-il passé ? mon Dieu ! disait-elle à mi-voix." }
42	
{ "en": "'He was with me a moment ago.", "fr": "Il était avec moi tout à l’heure." }
43	
{ "en": "He must have gone all round the house already.", "fr": "Il a déjà fait le tour de la maison." }
44	
{ "en": "Perhaps he's run away ...'", "fr": "Il s’est peut-être sauvé…" }
45	
{ "en": "And after each sentence she gave three barely perceptible little taps on the window-pane.", "fr": "Et, entre chaque phrase, elle frappait au carreau trois petits coups à peine perceptibles." }
46	
{ "en": "No one came to let in the unknown visitor.", "fr": "Personne ne venait ouvrir à la visiteuse inconnue." }
47	
{ "en": "Without any doubt Millie had received her hat from the station, and, hearing nothing, at the end of the red bedroom, before a bed bestrewed with old ribbons and uncurled feathers, she was stitching, undoing, and remaking her modest headgear. In fact, as soon as I came into the dining-room, followed closely by the visitor, Mother appeared, both her hands to her head, holding wires, ribbons, and feathers which were not yet perfectly secured.", "fr": "Millie, sans doute, avait reçu le chapeau de La Gare, et sans rien entendre, au fond de la chambre rouge, devant un lit semé de vieux rubans et de plumes défrisées, elle cousait, décousait, rebâtissait sa médiocre coiffure… En effet, lorsque j’eus pénétré dans la salle à manger, immédiatement suivi de la visiteuse, ma mère apparut tenant à deux mains sur sa tête des fils de laiton, des rubans et des plumes, qui n’étaient pas encore parfaitement équilibrés…" }
48	
{ "en": "She smiled at me, from blue eyes tired with working till dusk, and exclaimed:", "fr": "Elle me sourit, de ses yeux bleus fatigués d’avoir travaillé à la chute du jour, et s’écria :" }
49	
{ "en": "'Look!", "fr": "– Regarde !" }
50	
{ "en": "I was waiting to show you , . .'", "fr": "Je t’attendais pour te montrer…" }
51	
{ "en": "But noticing that woman sitting in the big armchair at the other end of the room, she stopped, disconcerted.", "fr": "Mais, apercevant cette femme assise dans le grand fauteuil, au fond de la salle, elle s’arrêta, déconcertée." }
52	
{ "en": "She quickly removed her hat, and during the whole scene that followed, held it against her breast, inside out, like a nest resting in the bend of her right arm.", "fr": "Bien vite, elle enleva sa coiffure, et, durant toute la scène qui suivit, elle la tint contre sa poitrine, renversée comme un nid dans son bras droit replié." }
53	
{ "en": "The woman with the old-fashioned bonnet had begun to explain herself. She held between her knees an umbrella and a leather handbag, slightly nodding her head the while, and clicking her tongue as do village women when paying a call.", "fr": "La femme à la capote, qui gardait, entre ses genoux, un parapluie et un sac de cuir, avait commencé de s’expliquer, en balançant légèrement la tête et en faisant claquer sa langue comme une femme en visite. Elle avait repris tout son aplomb." }
54	
{ "en": "She had regained full assurance, and when she spoke of her son she even assumed a superior and mysterious manner which puzzled us.", "fr": "Elle eut même, dès qu’elle parla de son fils, un air supérieur et mystérieux qui nous intrigua." }
55	
{ "en": "They had both driven from La Ferté d'Angillon, fourteen kilometres from Sainte-Agathe.", "fr": "Ils étaient venus tous les deux, en voiture, de La Ferté-d’Angillon, à quatorze kilomètres de Sainte-Agathe." }
56	
{ "en": "Herself a widow - and very rich, as she gave us to understand - she had lost the younger of her two children, a boy called Antoine, who had suddenly died one evening, on returning from school, after bathing with his brother in a dirty pond.", "fr": "Veuve – et fort riche, à ce qu’elle nous fit comprendre – elle avait perdu le cadet de ses deux enfants, Antoine, qui était mort un soir au retour de l’école, pour s’être baigné avec son frère dans un étang malsain." }
57	
{ "en": "She had decided to let Augustin, the elder boy, board with us, that he might take the Higher Course.", "fr": "Elle avait décidé de mettre l’aîné, Augustin, en pension chez nous pour qu’il pût suivre le Cours Supérieur." }
58	
{ "en": "And forthwith she began to praise this boarder whom she was bringing us.", "fr": "Et aussitôt elle fit l’éloge de ce pensionnaire qu’elle nous amenait." }
59	
{ "en": "I could no longer recognise the grey-headed woman whom, only a minute ago, I had seen stooping in front of the door, with the piteous and haggard bearing of a hen who has lost the wildest chick in her brood.", "fr": "Je ne reconnaissais plus la femme aux cheveux gris, que j’avais vue courbée devant la porte, une minute auparavant, avec cet air suppliant et hagard de poule qui aurait perdu l’oiseau sauvage de sa couvée." }
60	
{ "en": "What she was relating with admiration about her son was surprising enough; he loved doing things to please her, he had often gone along the river-bank for miles barelegged, to bring her wild ducks' and moor hens' eggs hidden amongst the reeds ... He could set nets . . . The other night, he had found a pheasant caught in a snare, in the wood ...", "fr": "Ce qu’elle contait de son fils avec admiration était fort surprenant : il aimait à lui faire plaisir, et parfois il suivait le bord de la rivière, jambes nues, pendant des kilomètres, pour lui rapporter des œufs de poules d’eau, de canards sauvages, perdus dans les ajoncs… Il tendait aussi des nasses… L’autre nuit, il avait découvert dans le bois une faisane prise au collet…" }
61	
{ "en": "I, who hardly dared to enter the house if I had torn my overall, looked at Millie with astonishment.", "fr": "Moi qui n’osais plus rentrer à la maison quand j’avais un accroc à ma blouse, je regardais Millie avec étonnement." }
62	
{ "en": "But Mother was no longer listening.", "fr": "Mais ma mère n’écoutait plus." }
63	
{ "en": "She even motioned to the woman to be quiet; and putting down her 'nest' on the table with great care, she got up silently as if to take some one by surprise ...", "fr": "Elle fit même signe à la dame de se taire ; et déposant avec précaution son « nid » sur la table, elle se leva silencieusement comme pour aller surprendre quelqu’un…" }
64	
{ "en": "Above us, indeed, in a box-room where the blackened remains of the last fourteenth of July fireworks were piled up, an unknown step trod confidently to and fro, shaking the ceiling, crossed the huge dark lumber-rooms of the upper storey and passed at last towards the unused assistant masters' rooms, where lime tree leaves were put