8-Deep Learning For NLP
8-Deep Learning For NLP
Natural Language
Adama Science and Technology University
School of Electrical Engineering and Computing
Department of CSE
Dr. Mesfin Abebe Haile (2022)
Outline
Introduction
Why deep learning for NLP
Overview of the NLP
Basic Structure of NN
Different types of layers
Activation function
Types of Neural Network
Convolutional NN
Recurrent NN
01/02/23 2
Deep Learning for Natural
Language
Deep learning is an extended field of machine learning that has proven to
be highly useful in the domains of text, image, and speech, primarily.
The collection of algorithms implemented under deep learning have
similarities with the relationship between stimuli and neurons in the
human brain.
Deep learning has extensive applications in computer vision, language
translation, speech recognition, image generation, and so forth.
These sets of algorithms are simple enough to learn in both a
supervised and unsupervised fashion.
01/02/23 3
Deep Learning for Natural
Language
A majority of deep learning algorithms are based on the concept of
artificial neural networks, and the training of such algorithms in
today’s world has been made easier with the availability of abundant
data and sufficient computation resources.
With additional data, the performance of deep learning models just
keep on improving.
The term deep in deep learning refers to the depth of the artificial
neural network architecture, and learning stands for learning through
the artificial neural network itself.
01/02/23 4
Deep Learning for Natural
Language
The figure shown below is an accurate representation of
the difference between a deep and a shallow network and why the term deep learning gained currency.
01/02/23 5
Deep Learning for Natural
Language
Representation of deep and shallow networks.
01/02/23 6
Deep Learning for Natural
Language
Deep neural networks are capable of discovering latent
structures (or feature learning) from unlabeled and
unstructured data, such as images (pixel data), documents (text
data), or files (audio, video data).
What differentiates any deep neural network from an ordinary
artificial neural network is the way we use backpropagation.
In an ordinary artificial neural network, backpropagation trains
later (or end) layers more efficiently than it trains initial (or
former) layers.
Thus, as we travel back into the network, errors become
smaller and more diffused.
01/02/23 7
Deep Learning for Natural
Language
How Deep is “Deep”?
A deep neural network is simply a feed forward neural network
with multiple hidden layers.
If there are many layers in the network, then we say that the
network is deep.
01/02/23 8
Deep Learning for Natural
Language
Multiple open source platforms and libraries for deep learning.
01/02/23 9
Basic Structure of Neural Network
They take several binary inputs, x1, x2, ..., xN and produce a
single binary output if the sum is greater than the activation
potential.
The neuron is said to “fire” whenever activation potential is
exceeded and behaves as a step function.
01/02/23 10
Basic Structure of Neural Network
Biological Analogy:
ANN is a computational model that simulate some properties of
the human brain.
The neurons that fire pass along the signal to other neurons connected to their
dendrites, which, in turn, will fire, if the activation potential is exceeded, thus
producing a cascading effect.
01/02/23 12
Basic Structure of Neural Network
As not all inputs have the same emphasis, weights are attached to
each of the inputs, xi to allow the model to assign more importance
to some inputs.
01/02/23 13
Basic Structure of Neural Network
01/02/23 15
Basic Structure of Neural Network
01/02/23 16
Basic Structure of Neural Network
01/02/23 17
Basic Structure of Neural Network
01/02/23 18
Basic Structure of Neural Network
01/02/23 19
Basic Structure of Neural Network
01/02/23 20
Basic Structure of Neural Network
01/02/23 21
Basic Structure of Neural Network
ReLUs quite often face the issue of dying, especially when the
learning rate is set to a higher value, as this triggers weight
updating that doesn’t allow the activation of the specific
neurons, thereby making the gradient of that neuron forever
zero.
Another risk offered by ReLU is the explosion of the activation
function, as the input value, xj, is itself the output here.
01/02/23 22
Basic Structure of Neural Network
01/02/23 23
Basic Structure of Neural Network
01/02/23 25
Basic Structure of Neural Network
01/02/23 26
Types of Neural Network
01/02/23 27
Types of Neural Network
Inputs
.6 Output
Age 34 .
.2 4 0.6
.1 .5
Gender 2 .3 .2
.8
.7 “Probability of
4 .2 being Alive”
Stage
Independent Dependent
Weights Hidden Weights
variables variable
Layer
Prediction
01/02/23 28
Types of Neural Network
Inputs
.6 Output
Age 34
.5 0.6
.1
Gender 2
.7 .8 “Probability of
beingAlive”
Stage 4
Independent Dependent
Weights Hidden Weights
variables variable
Layer
01/02/23
Prediction 29
Types of Neural Network
Inputs
Output
Age 34
.2 .5
0.6
Gender 2 .3
“Probability of
.8
beingAlive”
Stage 4 .2
Dependent
Independent Weights Hidde Weights variable
variables Layer
01/02/23
Prediction 30
Types of Neural Network
Inputs
.6 Output
Age 34
.2 .5
.1 0.6
Gender 1 .3
.7 “Probability of
.8
beingAlive”
Stage 4 .2
Independent Dependent
Weights Hidden Weights
variables variable
Layer
Prediction
01/02/23 31
Types of Neural Network
01/02/23 32
Types of Neural Network
This leads to the use of several layers, thus these models were
the first deep learning models.
01/02/23 34
Convolution Neural Network
01/02/23 35
Convolution Neural Network
01/02/23 36
Motivation of Sequential Model
01/02/23 37
Recurrent Neural Network
01/02/23 39
Recurrent Neural Network
01/02/23 40
Recurrent Neural Network
01/02/23 41
Recurrent Neural Network
01/02/23 43
Recurrent Neural Network
01/02/23 45
Question & Answer
01/02/23 46
Thank You !!!
01/02/23 47
Individual Assignment - Four
01/02/23 48
Individual Assignment - Four