Natural Language Processing in Action, Second Edition cover
welcome to this free extract from
an online version of the Manning book.
to read more
or

5 Word brain (neural networks)

 

This chapter covers

  • Building a base layer for your neural networks
  • Understanding backpropagation to train neural networks
  • Implementing a basic neural network in Python
  • Implementing a scalable neural network in PyTorch
  • Stacking network layers for better data representation
  • Tuning up your neural network for better performance

When you read the title of this chapter, "word brain", the neurons in your brain started firing, reminding you where you’d heard something like that before. And now that you read the word "heard", your neurons might be connecting the words in the title to the part of your brain that processes the sound of words. And maybe, the neurons in your audio cortex are starting to connect the phrase "word brain" to common phrases that rhyme with it, such as "bird brain."

Even if my brain didn’t predict your brain very well, you’re about to build a small brain yourself. And the "word brain" you are about to build will be a lot better than both of our human brains, at least for some particularly hard NLP tasks. You’re going to build a tiny brain that can process a single word and predict something about what it means. And a neural net can do this when the word it is processing is a person’s name and it doesn’t seem to mean anything at all to a human.

5.1 Why neural networks?

5.1.1 Neural networks for words

5.1.2 Neurons as feature engineers

5.1.3 Biological neurons

5.1.4 Perceptron

5.1.5 A Python perceptron

5.2 Example logistic neuron

5.2.1 The logistics of clickbait

5.2.2 Sex education

5.2.3 Pronouns

5.2.4 Sex Logistics

5.2.5 Sexy logistic regressions

5.2.6 Sexy neurons

5.2.7 A Pythonic neuron

5.2.8 Let’s go skiing—the error surface

sitemap