diff --git a/docs/tutorials/text_classification_rnn.ipynb b/docs/tutorials/text_classification_rnn.ipynb index 61538bf5e..f2ee7c458 100644 --- a/docs/tutorials/text_classification_rnn.ipynb +++ b/docs/tutorials/text_classification_rnn.ipynb @@ -449,7 +449,7 @@ "\n", "sample_text = ('The movie was cool. The animation and the graphics '\n", " 'were out of this world. I would recommend this movie.')\n", - "predictions = model.predict(np.array([sample_text]))\n", + "predictions = model.predict(tf.constant([sample_text]))\n", "print(predictions[0])" ] }, @@ -473,7 +473,7 @@ "# predict on a sample text with padding\n", "\n", "padding = \"the \" * 2000\n", - "predictions = model.predict(np.array([sample_text, padding]))\n", + "predictions = model.predict(tf.constant([sample_text, padding]))\n", "print(predictions[0])" ] }, @@ -573,7 +573,7 @@ "source": [ "sample_text = ('The movie was cool. The animation and the graphics '\n", " 'were out of this world. I would recommend this movie.')\n", - "predictions = model.predict(np.array([sample_text]))" + "predictions = model.predict(tf.constant([sample_text]))" ] }, { @@ -675,7 +675,7 @@ "\n", "sample_text = ('The movie was not good. The animation and the graphics '\n", " 'were terrible. I would not recommend this movie.')\n", - "predictions = model.predict(np.array([sample_text]))\n", + "predictions = model.predict(tf.constant([sample_text]))\n", "print(predictions)" ] },