Natural Language Processing with TensorFlow 2 – Beginner's Course

Share it with your friends Like

Thanks! Share it with your friends!


This course is a practical introduction to natural language processing with TensorFlow 2.0. In this tutorial you will go from having zero knowledge to writing an artificial intelligence that can compose Shakespearean prose.

No prior experience with deep learning is required, though it is always helpful to have more background information. We’ll use a combination of embedding layers, recurrent neural networks, and fully connected layers to perform the classification.

⭐️Course Contents ⭐️
⌨️ (01:16) Getting Started with Word Embeddings
⌨️ (33:25) How to Perform Sentiment Analysis on Movie Reviews
⌨️ (59:32) Let’s Write An AI That Writes Shakespeare

⭐️Course Description ⭐️
The basic idea behind natural language processing is that we start out with words, i.e. strings of characters, that are almost impossible for the computer to meaningfully parse. We can transform these strings into a vector in a higher dimensional space. Different words will be represented as vectors of different lengths and directions in this space, and this allows us to find relationships between words by finding the component of one vector along another. Don’t worry, the TensorFlow library handles all of this, we just have to have some basic idea of how it works.

Since this is a type of supervised learning, we also have labels for our text. This allows the AI to compare the relationships between words to the training labels, and learn which sequences of words represent good and bad movie reviews. This would also work for finding toxic comments, fake product reviews… just about anything for which we need a multiclass classification of text – provided we have enough training data and labels.

The last step in complexity is to change the final layer that handles the classification. This allows us to actually output text that the AI thinks is meaningful. What’s really special about this is that the neural network starts out not even knowing that letters are a thing, or that we use spaces and punctuation, to producing something that approximates human level writing.

⭐️Code ⭐️
🔗Word Embeddings:
🔗Text Classification:
🔗Text Generation:

⭐️Resources ⭐️
As stated in the videos, these are from the official TensorFlow tutorials. You can find them here:

This course was created by Phil Tabor. If you’d like to see more deep learning, reinforcement learning, and artificial intelligence content, please check out his channel:

Learn to code for free and get a developer job:

Read hundreds of articles on programming:

And subscribe for new videos on technology every day:


Machine Learning with Phil says:

Questions, comments? Leave a comment below! For more deep learning content check out my channel. Thanks for watching!

Kin Wong says:

41:36 so cute lol
Went through this tutorial after finished Patrick Loeber's TF playlist. Imo Patrick's code is friendlier to read.
This is probably not a good tutorial for TF beginners, but a great one after you learn the basics of TF.

Abrar Fahim says:

Not for beginners. :/

Tuna Özateş says:

I think this requires some background, I do not know much about TF and in first 15 minutes, I did not understand what is going on.

The Unknown Evidence says:

It's really annoying that you keep mentioning the typos.

Rodolfo Vitangcol says:

Business Opportunity in Ruvol

I have invented a Board Game [still unpublished and not yet out in the market] that I believe is guaranteed to be as challenging and exciting as CHESS. I called it “RUVOL.”

It is my hope that one day Ruvol may surpass chess as the “Number One Board Game in the World.”

The weakness of chess is it always starts in fixed positions that the opening moves become “memorizable.” In fact, not a few have so mastered the moves that they can play against their opponents “blindfolded.” It is for this very reason that the great Bobby Fischer introduced his so-called “Fischer Random Chess,” where the starting position of the pieces is “randomized” to make the memorization of openings impracticable. Fortunately, it is also for this reason that I invented Ruvol where “every game” has been calculated to be a challenging one to play.


I detailed everything in my YouTube video. Here is the link:


It is worthwhile to note that the people who play chess will be the same people who will play Ruvol. In my Google search, I learned there are around 800 million chess players in the world. Even just a small percentage of these 800 million is good enough to earn big money from Ruvol either as an ONLINE GAME BUSINESS or as a PHYSICAL PRODUCT DISTRIBUTOR.

You may contact me at:

Thanks and God bless!

The Ruvol Inventor

Rakibul Hasan says:

Not a good tutorial for beginners, No explanation is provided! Wasted my 2 hours

Aritra Karmakar says:

This video is not for beginners at all.

Jeet Shah says:

You are using tensorflow with GPU or without???

Parakeet Basmati says:

That's a garbage tutorial. The code you're using is not generalizeable at all. When people inevitably deal with data that isn't from Tensorflow Datasets, how are they going to replace "encoder = info.features['text'].encoder". I have no idea what it does: it's Tensorflow specific. You should have turned the Tensorflow dataset into a Numpy array or a list immediately.

iKostanCom says:

Extremely unclear, it seems like there must be some preparation course in order to understand what this dude is doing…

Robert Hinson says:

What editor are you using? Looks like vi.

Jack says:

is it normal for the training to take a long time for the text generation

Wizartar says:

very good video to get an overview of this stuff, but aren't uncompiled languages just so much fun to work with!!

Tristan Rinehart says:

This is not a beginner's course.

Muhammad Anas says:

I am getting a ConnectionResetError in tfds.load method in the code shown at 10:30 in the video. I can't seem to find any help on stackoverflow or any other site. has anyone got this problem and figured it out? please help with this, thanks

Muthu says:

Unity tutorial please

Ivan Yosifov says:

This is definitely not for beginners. Knowing Python is not enough. You also need to know TensorFlow.

Aditya Shukla says:

I think it's GPT3

Syed Aqib says:

I am new to Python…And know all basic of Python…Is this video worth ??? Viewer please answer me

Nikos Ellinas says:

Hello, have you explored how to build a custom encoder decoder architecture with tf2? For example machine translation, but to be able to run with variable length sequences, not just pad to maximum overall length.

EarlZMoade says:

For vim you should have a look at the coc.nvim plugin with the coc-python extension. It'll prevent you missing syntax errors before running the file.


I really wish freeCodeCamp would bring back the Shirts and Hoodies in their store!

Phillip Brown says:

You're not really explaining what you're doing as you're going… Which is a shame. Appreciate there's a lot of documentation to refer to, but 'beginners course' is a bit of a misnomer

Write a comment


Area 51