Skip to content

Commit 978fd9f

Browse files
Update tensorflow-text notebooks from 2.8 to 2.11
PiperOrigin-RevId: 509933115
1 parent fae2fce commit 978fd9f

10 files changed

+32
-31
lines changed

docs/guide/bert_preprocessing_guide.ipynb

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,20 @@
4343
{
4444
"cell_type": "markdown",
4545
"source": [
46-
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
47-
" <td>\n",
48-
" <a target=\"_blank\" href=\"https://www.tensorflow.org/text/guide/bert_preprocessing_guide\"><img src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" />View on TensorFlow.org</a>\n",
49-
" </td>\n",
50-
" <td>\n",
51-
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/text/blob/master/docs/guide/bert_preprocessing_guide.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
52-
" </td>\n",
53-
" <td>\n",
54-
" <a target=\"_blank\" href=\"https://github.com/tensorflow/text/blob/master/docs/guide/bert_preprocessing_guide.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View on GitHub</a>\n",
55-
" </td>\n",
56-
" <td>\n",
57-
" <a href=\"https://storage.googleapis.com/tensorflow_docs/text/docs/guide/bert_preprocessing_guide.ipynb\"><img src=\"https://www.tensorflow.org/images/download_logo_32px.png\" />Download notebook</a>\n",
58-
" </td>\n",
59-
"</table>"
46+
"\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n",
47+
" \u003ctd\u003e\n",
48+
" \u003ca target=\"_blank\" href=\"https://www.tensorflow.org/text/guide/bert_preprocessing_guide\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" /\u003eView on TensorFlow.org\u003c/a\u003e\n",
49+
" \u003c/td\u003e\n",
50+
" \u003ctd\u003e\n",
51+
" \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/text/blob/master/docs/guide/bert_preprocessing_guide.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n",
52+
" \u003c/td\u003e\n",
53+
" \u003ctd\u003e\n",
54+
" \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/text/blob/master/docs/guide/bert_preprocessing_guide.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView on GitHub\u003c/a\u003e\n",
55+
" \u003c/td\u003e\n",
56+
" \u003ctd\u003e\n",
57+
" \u003ca href=\"https://storage.googleapis.com/tensorflow_docs/text/docs/guide/bert_preprocessing_guide.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/download_logo_32px.png\" /\u003eDownload notebook\u003c/a\u003e\n",
58+
" \u003c/td\u003e\n",
59+
"\u003c/table\u003e"
6060
],
6161
"metadata": {
6262
"id": "MfBg1C5NB3X0"
@@ -119,7 +119,7 @@
119119
"cell_type": "code",
120120
"execution_count": null,
121121
"source": [
122-
"!pip install -q -U \"tensorflow-text==2.8.*\""
122+
"!pip install -q -U \"tensorflow-text==2.11.*\""
123123
],
124124
"outputs": [],
125125
"metadata": {
@@ -132,7 +132,8 @@
132132
"source": [
133133
"import tensorflow as tf\n",
134134
"import tensorflow_text as text\n",
135-
"import functools"
135+
"import functools\n",
136+
"print(\"TensorFlow version: \", tf.__version__)"
136137
],
137138
"outputs": [],
138139
"metadata": {
@@ -436,16 +437,16 @@
436437
"\n",
437438
"For `mask_token_rate` of the time, replace the item with the `[MASK]` token:\n",
438439
"\n",
439-
" \"my dog is hairy\" -> \"my dog is [MASK]\"\n",
440+
" \"my dog is hairy\" -\u003e \"my dog is [MASK]\"\n",
440441
" \n",
441442
"For `random_token_rate` of the time, replace the item with a random word:\n",
442443
"\n",
443-
" \"my dog is hairy\" -> \"my dog is apple\"\n",
444+
" \"my dog is hairy\" -\u003e \"my dog is apple\"\n",
444445
" \n",
445446
"For `1 - mask_token_rate - random_token_rate` of the time, keep the item\n",
446447
"unchanged:\n",
447448
"\n",
448-
" \"my dog is hairy\" -> \"my dog is hairy.\"\n",
449+
" \"my dog is hairy\" -\u003e \"my dog is hairy.\"\n",
449450
"\n",
450451
"[`text.MaskedValuesChooser`](https://tensorflow.org/text/api_docs/python/text/MaskValuesChooser) encapsulates this logic and can be used for our preprocessing function. Here's an example of what `MaskValuesChooser` returns given a `mask_token_rate` of 80% and default `random_token_rate`:\n"
451452
],

docs/guide/decoding_api.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
},
121121
"outputs": [],
122122
"source": [
123-
"!pip install -q -U \"tensorflow-text==2.8.*\""
123+
"!pip install -q -U \"tensorflow-text==2.11.*\""
124124
]
125125
},
126126
{

docs/guide/subwords_tokenizer.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
},
110110
"outputs": [],
111111
"source": [
112-
"!pip install -q -U \"tensorflow-text==2.8.*\""
112+
"!pip install -q -U \"tensorflow-text==2.11.*\""
113113
]
114114
},
115115
{

docs/guide/text_tf_lite.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
},
110110
"outputs": [],
111111
"source": [
112-
"!pip install -U \"tensorflow-text==2.8.*\""
112+
"!pip install -U \"tensorflow-text==2.11.*\""
113113
]
114114
},
115115
{

docs/guide/tokenizers.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
},
9696
"outputs": [],
9797
"source": [
98-
"!pip install -q \"tensorflow-text==2.8.*\""
98+
"!pip install -q \"tensorflow-text==2.11.*\""
9999
]
100100
},
101101
{

docs/tutorials/bert_glue.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
},
117117
"outputs": [],
118118
"source": [
119-
"!pip install -q -U \"tensorflow-text==2.8.*\""
119+
"!pip install -q -U \"tensorflow-text==2.11.*\""
120120
]
121121
},
122122
{
@@ -136,7 +136,7 @@
136136
},
137137
"outputs": [],
138138
"source": [
139-
"!pip install -q -U tf-models-official==2.7.0"
139+
"!pip install -q -U tf-models-official==2.11.0"
140140
]
141141
},
142142
{

docs/tutorials/classify_text_with_bert.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
"outputs": [],
110110
"source": [
111111
"# A dependency of the preprocessing for BERT inputs\n",
112-
"!pip install -q -U \"tensorflow-text==2.8.*\""
112+
"!pip install -q -U \"tensorflow-text==2.11.*\""
113113
]
114114
},
115115
{
@@ -129,7 +129,7 @@
129129
},
130130
"outputs": [],
131131
"source": [
132-
"!pip install -q tf-models-official==2.7.0"
132+
"!pip install -q tf-models-official==2.11.0"
133133
]
134134
},
135135
{

docs/tutorials/nmt_with_attention.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
},
131131
"outputs": [],
132132
"source": [
133-
"!pip install \"tensorflow-text\u003e=2.10\"\n",
133+
"!pip install \"tensorflow-text\u003e=2.11\"\n",
134134
"!pip install einops"
135135
]
136136
},

docs/tutorials/text_similarity.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
},
9393
"outputs": [],
9494
"source": [
95-
"!pip install -q \"tensorflow-text==2.8.*\""
95+
"!pip install -q \"tensorflow-text==2.11.*\""
9696
]
9797
},
9898
{

docs/tutorials/uncertainty_quantification_with_sngp_bert.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
},
112112
"outputs": [],
113113
"source": [
114-
"!pip install \"tensorflow-text==2.8.*\""
114+
"!pip install \"tensorflow-text==2.11.*\""
115115
]
116116
},
117117
{
@@ -122,7 +122,7 @@
122122
},
123123
"outputs": [],
124124
"source": [
125-
"!pip install -U tf-models-official==2.7.0"
125+
"!pip install -U tf-models-official==2.11.0"
126126
]
127127
},
128128
{

0 commit comments

Comments
 (0)