Skip to content

Commit 14c323f

Browse files
AleksMatt5-copybara
authored andcommitted
Replace unicode escaped characters in ipynb files
PiperOrigin-RevId: 854213756
1 parent cf8f1ce commit 14c323f

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

notebooks/t5-trivia.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"source": [
99
"\n",
10-
"\u003ca href=\"https://colab.research.google.com/github/google-research/text-to-text-transfer-transformer/blob/main/notebooks/t5-trivia.ipynb\" target=\"_parent\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e"
10+
"<a href=\"https://colab.research.google.com/github/google-research/text-to-text-transfer-transformer/blob/main/notebooks/t5-trivia.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
1111
]
1212
},
1313
{
@@ -55,7 +55,7 @@
5555
"## _Or: What does T5 know?_\n",
5656
"\n",
5757
"*The following tutorial guides you through the process of fine-tuning a pre-trained T5 model, evaluating its accuracy, and using it for prediction,\n",
58-
"all on a free Google Cloud TPU \u003ca href=\"https://colab.research.google.com/github/google-research/text-to-text-transfer-transformer/blob/main/notebooks/t5-trivia.ipynb\" target=\"_parent\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e.*\n",
58+
"all on a free Google Cloud TPU <a href=\"https://colab.research.google.com/github/google-research/text-to-text-transfer-transformer/blob/main/notebooks/t5-trivia.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>.*\n",
5959
"\n",
6060
"### Background\n",
6161
"\n",
@@ -102,7 +102,7 @@
102102
"id": "eDeE_yVuHMYg"
103103
},
104104
"source": [
105-
"\u003ch3\u003e\u003ca href=\"https://cloud.google.com/tpu/\"\u003e\u003cimg valign=\"middle\" src=\"https://raw.githubusercontent.com/GoogleCloudPlatform/tensorflow-without-a-phd/master/tensorflow-rl-pong/images/tpu-hexagon.png\" width=\"50\"\u003e\u003c/a\u003e \u0026nbsp;\u0026nbsp;Train on TPU\u003c/h3\u003e\n",
105+
"<h3><a href=\"https://cloud.google.com/tpu/\"><img valign=\"middle\" src=\"https://raw.githubusercontent.com/GoogleCloudPlatform/tensorflow-without-a-phd/master/tensorflow-rl-pong/images/tpu-hexagon.png\" width=\"50\"></a> &nbsp;&nbsp;Train on TPU</h3>\n",
106106
"\n",
107107
"\n",
108108
"\n",
@@ -253,7 +253,7 @@
253253
"name": "stdout",
254254
"output_type": "stream",
255255
"text": [
256-
"I1206 00:11:00.169766 248738 \u003cipython-input-3-45e03d923fbf\u003e:51] Loading NQ from cache.\n"
256+
"I1206 00:11:00.169766 248738 <ipython-input-3-45e03d923fbf>:51] Loading NQ from cache.\n"
257257
]
258258
}
259259
],
@@ -304,7 +304,7 @@
304304
" elif \"document_text\" in ex:\n",
305305
" tokens = ex[\"document_text\"].split(\" \")\n",
306306
" answer = extract_answer(tokens, answer_span)\n",
307-
" # Write this line as \u003cquestion\u003e\\t\u003canswer\u003e\n",
307+
" # Write this line as <question>\\t<answer>\n",
308308
" outfile.write(\"%s\\t%s\\n\" % (question, answer))\n",
309309
" count += 1\n",
310310
" tf.logging.log_every_n(\n",
@@ -378,7 +378,7 @@
378378
"\n",
379379
" # Load lines from the text file as examples.\n",
380380
" ds = tf.data.TextLineDataset(nq_tsv_path[split])\n",
381-
" # Split each \"\u003cquestion\u003e\\t\u003canswer\u003e\" example into (question, answer) tuple.\n",
381+
" # Split each \"<question>\\t<answer>\" example into (question, answer) tuple.\n",
382382
" ds = ds.map(\n",
383383
" functools.partial(tf.io.decode_csv, record_defaults=[\"\", \"\"],\n",
384384
" field_delim=\"\\t\", use_quote_delim=False),\n",
@@ -417,7 +417,7 @@
417417
" return text\n",
418418
"\n",
419419
" def to_inputs_and_targets(ex):\n",
420-
" \"\"\"Map {\"question\": ..., \"answer\": ...}-\u003e{\"inputs\": ..., \"targets\": ...}.\"\"\"\n",
420+
" \"\"\"Map {\"question\": ..., \"answer\": ...}->{\"inputs\": ..., \"targets\": ...}.\"\"\"\n",
421421
" return {\n",
422422
" \"inputs\":\n",
423423
" tf.strings.join(\n",
@@ -889,7 +889,7 @@
889889
"\n",
890890
"Please see our [paper on closed-book QA](https://arxiv.org/abs/2002.08910) where achieved even better results.\n",
891891
"\n",
892-
"\u003cimg src=\"https://storage.googleapis.com/t5-data/assets/t5_trivia_expected.png\"\u003e"
892+
"<img src=\"https://storage.googleapis.com/t5-data/assets/t5_trivia_expected.png\">"
893893
]
894894
},
895895
{
@@ -954,7 +954,7 @@
954954
"name": "stdout",
955955
"output_type": "stream",
956956
"text": [
957-
"\u003c== Random predictions for triviaqa_context_free using checkpoint 1100000 ==\u003e\n",
957+
"<== Random predictions for triviaqa_context_free using checkpoint 1100000 ==>\n",
958958
"\n",
959959
"Input: trivia question: jackpot counter, ghost drop and drop zone are all terms used in which uk television game show?\n",
960960
"Target: tipping point\n",
@@ -1006,7 +1006,7 @@
10061006
"Prediction: scooby-doo\n",
10071007
"Counted as Correct? False\n",
10081008
"\n",
1009-
"\u003c== Random predictions for nq_context_free using checkpoint 1100000 ==\u003e\n",
1009+
"<== Random predictions for nq_context_free using checkpoint 1100000 ==>\n",
10101010
"\n",
10111011
"Input: trivia question: who is known as the super fast boy in the series the icredible?\n",
10121012
"Target: dashiell robert parr/dash\n",
@@ -1093,7 +1093,7 @@
10931093
" tf.compat.as_text(ex[\"targets_pretokenized\"]),\n",
10941094
" pred.strip()))\n",
10951095
"\n",
1096-
" print(\"\u003c== Random predictions for %s using checkpoint %s ==\u003e\\n\" %\n",
1096+
" print(\"<== Random predictions for %s using checkpoint %s ==>\\n\" %\n",
10971097
" (task_name, \n",
10981098
" _prediction_file_to_ckpt(latest_prediction_file)))\n",
10991099
"\n",

0 commit comments

Comments
 (0)