O'Reilly logo

Hands-On Natural Language Processing with Python by Rajalingappaa Shanmugamani, Rajesh Arumugam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Inference

We will now load the saved model file and test it with sample data from the input text that was not seen by the model. We will load the logits tensor from the model, and use that to infer the summary text prediction output on unseen or test data:

INFO:tensorflow:Restoring parameters from /tmp/models/best_so_far_model.ckpt

Text
Word Ids:    [33, 687, 145, 2047, 33, 5800, 1133, 2016, 19, 526, 6626, 3, 6842, 526, 1716, 5573, 11024, 128, 526, 3591, 1607, 1272, 3024, 19, 81, 8167, 19, 774, 526, 594, 1716, 65, 10590, 11026]
Input Words: a taiwan official gave a cautious welcome tuesday to the idea of having the olympic torch through the island if beijing were to be chosen to host the #### olympic games . Summary Word Ids: [687, 605, 19, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required