Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Machine Learning with TensorFlow 1.x

You're reading from   Machine Learning with TensorFlow 1.x Second generation machine learning with Google's brainchild - TensorFlow 1.x

Arrow left icon
Product type Paperback
Published in Nov 2017
Publisher Packt
ISBN-13 9781786462961
Length 304 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (3):
Arrow left icon
Saif Ahmed Saif Ahmed
Author Profile Icon Saif Ahmed
Saif Ahmed
Quan Hua Quan Hua
Author Profile Icon Quan Hua
Quan Hua
Shams Ul Azeem Shams Ul Azeem
Author Profile Icon Shams Ul Azeem
Shams Ul Azeem
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Getting Started with TensorFlow FREE CHAPTER 2. Your First Classifier 3. The TensorFlow Toolbox 4. Cats and Dogs 5. Sequence to Sequence Models-Parlez-vous Français? 6. Finding Meaning 7. Making Money with Machine Learning 8. The Doctor Will See You Now 9. Cruise Control - Automation 10. Go Live and Go Big 11. Going Further - 21 Problems 12. Advanced Installation

Drinking from the firehose

As you did earlier, you should grab the code from https://github.com/mlwithtf/MLwithTF/.

We will be focusing on the chapter_05 subfolder that has the following three files:

  • data_utils.py
  • translate.py
  • seq2seq_model.py

The first file handles our data, so let's start with that. The prepare_wmt_dataset function handles that. It is fairly similar to how we grabbed image datasets in the past, except now we're grabbing two data subsets:

  • giga-fren.release2.fr.gz
  • giga-fren.release2.en.gz

Of course, these are the two languages we want to focus on. The beauty of our soon-to-be-built translator will be that the approach is entirely generalizable, so we can just as easily create a translator for, say, German or Spanish.

The following screenshot is the specific subset of code:

Next, we will run through the two files of interest from earlier line by...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $24.99/month. Cancel anytime