Skip to content

Commit 8d768db

Browse files
MarkDaoustseanpmorgan
authored andcommitted
Update site (#840)
* Some fixes for republishing tensorflow.org
1 parent 4997d70 commit 8d768db

File tree

3 files changed

+790
-711
lines changed

3 files changed

+790
-711
lines changed

docs/tutorials/losses_triplet.ipynb

Lines changed: 411 additions & 446 deletions
Large diffs are not rendered by default.

docs/tutorials/networks_seq2seq_nmt.ipynb

Lines changed: 58 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,34 @@
55
"colab": {
66
"name": "networks_seq2seq_nmt.ipynb",
77
"provenance": [],
8+
"private_outputs": true,
89
"collapsed_sections": [],
910
"toc_visible": true
1011
},
1112
"kernelspec": {
12-
"name": "python3",
13-
"display_name": "Python 3"
13+
"display_name": "Python 3",
14+
"language": "python",
15+
"name": "python3"
16+
},
17+
"language_info": {
18+
"codemirror_mode": {
19+
"name": "ipython",
20+
"version": 3
21+
},
22+
"file_extension": ".py",
23+
"mimetype": "text/x-python",
24+
"name": "python",
25+
"nbconvert_exporter": "python",
26+
"pygments_lexer": "ipython3",
27+
"version": "3.7.3rc1"
1428
}
1529
},
1630
"cells": [
1731
{
1832
"cell_type": "code",
1933
"metadata": {
20-
"id": "bl9GdT7h0Hxk",
2134
"colab_type": "code",
35+
"id": "bl9GdT7h0Hxk",
2236
"colab": {}
2337
},
2438
"source": [
@@ -40,8 +54,8 @@
4054
{
4155
"cell_type": "markdown",
4256
"metadata": {
43-
"id": "WhwgQAn50EZp",
44-
"colab_type": "text"
57+
"colab_type": "text",
58+
"id": "WhwgQAn50EZp"
4559
},
4660
"source": [
4761
"# TensorFlow Addons Networks : Sequence-to-Sequence NMT \n",
@@ -65,8 +79,8 @@
6579
{
6680
"cell_type": "markdown",
6781
"metadata": {
68-
"id": "ip0n8178Fuwm",
69-
"colab_type": "text"
82+
"colab_type": "text",
83+
"id": "ip0n8178Fuwm"
7084
},
7185
"source": [
7286
"# **Overview**\n",
@@ -87,8 +101,8 @@
87101
{
88102
"cell_type": "markdown",
89103
"metadata": {
90-
"id": "YNiadLKNLleD",
91-
"colab_type": "text"
104+
"colab_type": "text",
105+
"id": "YNiadLKNLleD"
92106
},
93107
"source": [
94108
"# **Setup**"
@@ -97,8 +111,8 @@
97111
{
98112
"cell_type": "code",
99113
"metadata": {
100-
"id": "1bUHYPhlF-Ql",
101114
"colab_type": "code",
115+
"id": "1bUHYPhlF-Ql",
102116
"colab": {}
103117
},
104118
"source": [
@@ -110,8 +124,8 @@
110124
{
111125
"cell_type": "code",
112126
"metadata": {
113-
"id": "jw044zGCZp-K",
114127
"colab_type": "code",
128+
"id": "jw044zGCZp-K",
115129
"colab": {}
116130
},
117131
"source": [
@@ -120,6 +134,7 @@
120134
"except:\n",
121135
" pass\n",
122136
"!pip install -q --no-deps tensorflow-addons~=0.6\n",
137+
"!pip install nltk\n",
123138
"import tensorflow as tf\n",
124139
"import tensorflow_addons as tfa"
125140
],
@@ -129,8 +144,8 @@
129144
{
130145
"cell_type": "markdown",
131146
"metadata": {
132-
"id": "82GcQTsGf414",
133-
"colab_type": "text"
147+
"colab_type": "text",
148+
"id": "82GcQTsGf414"
134149
},
135150
"source": [
136151
"## **Additional Resources:**\n",
@@ -150,8 +165,8 @@
150165
{
151166
"cell_type": "code",
152167
"metadata": {
153-
"id": "5OIlpST_6ga-",
154168
"colab_type": "code",
169+
"id": "5OIlpST_6ga-",
155170
"colab": {}
156171
},
157172
"source": [
@@ -166,8 +181,8 @@
166181
{
167182
"cell_type": "code",
168183
"metadata": {
169-
"id": "co6-YpBwL-4d",
170184
"colab_type": "code",
185+
"id": "co6-YpBwL-4d",
171186
"colab": {}
172187
},
173188
"source": [
@@ -181,7 +196,6 @@
181196
"from tensorflow.keras.preprocessing.text import Tokenizer\n",
182197
"from tensorflow.keras.preprocessing.sequence import pad_sequences\n",
183198
"from tensorflow.keras.utils import to_categorical\n",
184-
"from keras.utils.vis_utils import plot_model\n",
185199
"from tensorflow.keras.models import Sequential\n",
186200
"from tensorflow.keras.layers import LSTM\n",
187201
"from tensorflow.keras.layers import Dense\n",
@@ -192,7 +206,6 @@
192206
"from pickle import load\n",
193207
"from numpy import array\n",
194208
"from numpy import argmax\n",
195-
"from keras.models import load_model\n",
196209
"from nltk.translate.bleu_score import corpus_bleu"
197210
],
198211
"execution_count": 0,
@@ -201,8 +214,8 @@
201214
{
202215
"cell_type": "markdown",
203216
"metadata": {
204-
"id": "q7gjUT_9XSoj",
205-
"colab_type": "text"
217+
"colab_type": "text",
218+
"id": "q7gjUT_9XSoj"
206219
},
207220
"source": [
208221
"## **Data Cleaning**\n",
@@ -213,8 +226,8 @@
213226
{
214227
"cell_type": "code",
215228
"metadata": {
216-
"id": "6ZIu-TNqKFsd",
217229
"colab_type": "code",
230+
"id": "6ZIu-TNqKFsd",
218231
"colab": {}
219232
},
220233
"source": [
@@ -269,8 +282,8 @@
269282
{
270283
"cell_type": "markdown",
271284
"metadata": {
272-
"id": "eXpft1qQknO8",
273-
"colab_type": "text"
285+
"colab_type": "text",
286+
"id": "eXpft1qQknO8"
274287
},
275288
"source": [
276289
"## **Saving the Cleaned Dataset**"
@@ -279,8 +292,8 @@
279292
{
280293
"cell_type": "code",
281294
"metadata": {
282-
"id": "GMxdlVU1X8yI",
283295
"colab_type": "code",
296+
"id": "GMxdlVU1X8yI",
284297
"colab": {}
285298
},
286299
"source": [
@@ -301,8 +314,8 @@
301314
{
302315
"cell_type": "markdown",
303316
"metadata": {
304-
"id": "Cfb66QxWYr6A",
305-
"colab_type": "text"
317+
"colab_type": "text",
318+
"id": "Cfb66QxWYr6A"
306319
},
307320
"source": [
308321
"## **Data Preparation**"
@@ -311,8 +324,8 @@
311324
{
312325
"cell_type": "code",
313326
"metadata": {
314-
"id": "3oq60MBPSanQ",
315327
"colab_type": "code",
328+
"id": "3oq60MBPSanQ",
316329
"colab": {}
317330
},
318331
"source": [
@@ -342,8 +355,8 @@
342355
{
343356
"cell_type": "code",
344357
"metadata": {
345-
"id": "XH5oSRNeSc1s",
346358
"colab_type": "code",
359+
"id": "XH5oSRNeSc1s",
347360
"colab": {}
348361
},
349362
"source": [
@@ -378,8 +391,8 @@
378391
{
379392
"cell_type": "markdown",
380393
"metadata": {
381-
"id": "UQRgJcYgapqE",
382-
"colab_type": "text"
394+
"colab_type": "text",
395+
"id": "UQRgJcYgapqE"
383396
},
384397
"source": [
385398
"## **Defining NMT Model**"
@@ -388,8 +401,8 @@
388401
{
389402
"cell_type": "code",
390403
"metadata": {
391-
"id": "sGdakRtjaokF",
392404
"colab_type": "code",
405+
"id": "sGdakRtjaokF",
393406
"colab": {}
394407
},
395408
"source": [
@@ -409,8 +422,8 @@
409422
{
410423
"cell_type": "markdown",
411424
"metadata": {
412-
"id": "NPwcfddTa0oB",
413-
"colab_type": "text"
425+
"colab_type": "text",
426+
"id": "NPwcfddTa0oB"
414427
},
415428
"source": [
416429
"## **Tokenization**"
@@ -419,8 +432,8 @@
419432
{
420433
"cell_type": "code",
421434
"metadata": {
422-
"id": "x1BEqVyra2jW",
423435
"colab_type": "code",
436+
"id": "x1BEqVyra2jW",
424437
"colab": {}
425438
},
426439
"source": [
@@ -453,8 +466,8 @@
453466
{
454467
"cell_type": "markdown",
455468
"metadata": {
456-
"id": "v5uzLcu2bNX3",
457-
"colab_type": "text"
469+
"colab_type": "text",
470+
"id": "v5uzLcu2bNX3"
458471
},
459472
"source": [
460473
"## **Training**"
@@ -463,8 +476,8 @@
463476
{
464477
"cell_type": "code",
465478
"metadata": {
466-
"id": "PvfD2SknWrt6",
467479
"colab_type": "code",
480+
"id": "PvfD2SknWrt6",
468481
"colab": {}
469482
},
470483
"source": [
@@ -483,8 +496,8 @@
483496
{
484497
"cell_type": "markdown",
485498
"metadata": {
486-
"id": "nDyK-EGqbN5r",
487-
"colab_type": "text"
499+
"colab_type": "text",
500+
"id": "nDyK-EGqbN5r"
488501
},
489502
"source": [
490503
"## **Evaluation based on BLEU scores**"
@@ -493,8 +506,8 @@
493506
{
494507
"cell_type": "code",
495508
"metadata": {
496-
"id": "y98sfom7SuGy",
497509
"colab_type": "code",
510+
"id": "y98sfom7SuGy",
498511
"colab": {}
499512
},
500513
"source": [
@@ -542,8 +555,8 @@
542555
{
543556
"cell_type": "markdown",
544557
"metadata": {
545-
"id": "iodjSItQds1t",
546-
"colab_type": "text"
558+
"colab_type": "text",
559+
"id": "iodjSItQds1t"
547560
},
548561
"source": [
549562
"## **Final Translation**"
@@ -552,8 +565,8 @@
552565
{
553566
"cell_type": "code",
554567
"metadata": {
555-
"id": "K6aWFB5IWlH2",
556568
"colab_type": "code",
569+
"id": "K6aWFB5IWlH2",
557570
"colab": {}
558571
},
559572
"source": [
@@ -582,8 +595,8 @@
582595
{
583596
"cell_type": "code",
584597
"metadata": {
585-
"id": "sp3trjITtq95",
586598
"colab_type": "code",
599+
"id": "sp3trjITtq95",
587600
"colab": {}
588601
},
589602
"source": [
@@ -595,8 +608,8 @@
595608
{
596609
"cell_type": "markdown",
597610
"metadata": {
598-
"id": "g6Av-oPWvRc4",
599-
"colab_type": "text"
611+
"colab_type": "text",
612+
"id": "g6Av-oPWvRc4"
600613
},
601614
"source": [
602615
"### The accuracy can be improved by implementing:\n",

0 commit comments

Comments
 (0)