AI Module V
AI Module V
Can work on the smaller amount of dataset Requires the larger volume of dataset
compared to machine learning
Better for the low-label task. Better for complex task like image
processing, natural language processing,
etc.
Takes less time to train the model. Takes more time to train the model.
A model is created by relevant features which Relevant features are automatically
are manually extracted from images to detect extracted from images. It is an end-to-end
an object in the image. learning process.
Less complex and easy to interpret the result. More complex, it works like the black box
interpretations of the result are not easy.
Parameters:
● x = inputs training vector x=(x1,x2,…………xn).
● t = target vector t=(t1,t2……………tn).
● δk = error at output unit.
● δj = error at hidden layer.
● α = learning rate.
● V0j = bias of hidden unit j.
Training Algorithm:
Step 1: Initialize weight to small random values.
Step 2: While the stepsstopping condition is to be false do step 3 to 10.
Step 3: For each training pair do step 4 to 9 (Feed-Forward).
Step 4: Each input unit receives the signal unit and transmitsthe signal xi signal to all the units.
Step 5 : Each hidden unit Zj (z=1 to a) sums its weighted input signal to calculate its net input
zinj = v0j + Σxivij ( i=1 to n)
Applying activation function zj = f(zinj) and sends this signals to all units in the layer
about i.e output units
For each output l=unit yk = (k=1 to m) sums its weighted input signals.
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
yink = w0k + Σ ziwjk (j=1 to a) and applies its
activation function to calculate the output signals. yk =
f(yink)
Backpropagation Error:
Step 6: Each output unit yk (k=1 to n) receives a target pattern corresponding to an input pattern
then error is calculated as:
δk = ( tk – yk ) + yink
Step 7: Each hidden unit Zj (j=1 to a) sums its input from all units in the layer above
δinj = Σ δj wjk
The error information term is calculated as:
δj = δinj + zinj
Updation of weight and bias:
Step 8: Each output unit yk (k=1 to m) updates its bias and weight (j=1 to a). The weight
correction term is given by:
Δ wjk = α δk zj and the bias
correction term is given by Δwk = α δk.
therefore wjk(new) = wjk(old) + Δ wjk
for each hidden unit zj (j=1 to a) update its bias and weights (i=0 to n) the weight
connection term
Δ vij = α δj xi
and the bias connection on term
Δ v0j = α δj
Therefore vij(new) = vij(old) + Δvij
layers.Flatten(), layers.Dense(64,
activation='relu'), layers.Dense(10,
activation='softmax')
])
It also offers the Core Layers class, which contains the classes required to generate core layers
such as Dense, Activation, and Embedding. Convolution Layers can be created in a variety of
ways using the Convolution Layer class. The Pooling Layers class contains the methods
required for Max Pooling, Average Pooling, Global Max Pooling, and Global Average
Pooling, as well as other types of pooling. Neural Network Callbacks
Callbacks are a way of tracking the model’s training. You can do a variety of activities before
or after an epoch or batch ends if Callback is enabled.
You can also utilise callbacks:
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
• Stopping after a specified number of epochs if the loss does not decrease significantly.
• While a model is being trained, you may see its internal states and statistics.
A callback is a type of object that can be used to accomplish tasks at different points of the
training process (i.e at the start /end of an epoch, before/after a single batch).
Callbacks can be used to:
To keep track of your measurements, keep TensorBoard logs after each batch of training.
Save your model to disc on a regular basis. Make an early stop.
During training, get a glimpse of a model’s internal states and statistics.
Preprocessing of Datasets
Data preprocessing is being defined as the procedure for preparing raw information for
machine learning/ deep learning models.
It is not always the norm that we come across clean and prepared data when working on a
machine learning project.
Real-world data sometimes contains noise, missing data, and is in an unsatisfactory format
that cannot be used effectively in machine learning models. Data preprocessing is an
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
extremely important/noteworthy job for cleaning data and making it suitable for machine
learning/ deep learning models, thus improving the model’s accuracy and efficiency. The data
is usually in raw format and structured in directories, and it must be preprocessed before it
can be supplied to the model for fitting. The Image Data Preprocessing class contains many
of these particular functions. The photo data, for example, must be an integer array, which may
be done with the img to array method. We may also use the image dataset from the directory
function if the images are in a directory and subfolders.
There are further classes for Time Series data and text data in the Data Preprocessing API.
Deep Learning Optimizers
The core of any neural network is the optimizer. In order to determine the appropriate
weights for prediction, each neural network optimises a loss function. There are several
different types of optimizers, each with a somewhat different technique to identifying the
optimal weights.
Optimizers are procedures or methodologies for minimising an error function as well as
increasing production efficiency. Optimizers are computational models that are built on the
learnable parameters of a model, such as Weights and Biases. Optimizers assist in determining
how to adjust the weights and learning rate of a neural network in order to minimise losses.
In layman’s terms, optimizers tinker with the weights to shape and mould your model into the
most accurate form possible. The loss function serves as a road map for the optimizer,
indicating whether it is travelling in the correct or wrong path.
Types of Optimizers:
1. Gradient Descent
2. Stochastic Gradient Descent.
3. Mini-Batch Gradient Descent.
4. Momentum Based Gradient Descent.
5. Nesterov Accelerated Gradient
6. Adagrad.
7. RMSProp
model.compile(
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
loss=‘categorical_crossentropy’,
optimizer=‘adam’,
metrics=[‘accuracy’]
)
Losses in Neural Network
Loss functions are required while compiling a model. This loss function would be optimised
by the optimizer, which was also specified as a parameter in the compilation procedure.
Probabilistic losses, regression losses, and hinge losses are the three types of losses. One of the
most key aspects of Neural Networks is the Loss Function. Loss is nothing more than a
Neural Net prediction error. Loss Function is the way for computing the loss. To put it another
way, the gradients are calculated using the Loss. Gradients are also utilised
to update the Neural Net’s weights.
Keras and Tensorflow have a variety of loss functions built-in for varied goals.
It’s a method of determining how effectively your algorithm models the data. Your loss
function will produce a greater value if your forecasts are completely wrong. If they’re
decent, it’ll give you a lower number. Your loss function will inform you if you’re making
progress as you tweak parts of your algorithm to try to enhance your model.
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
Loading a model(pre-trained)
import keras import numpy
as np
Let us Consider the MNIST dataset, which is included in Keras’ datasets class. For categorising
handwritten images of digits 0-9, we’ll build a basic sequential Convolutional Neural Network.
from keras.preprocessing.image import ImageDataGenerator
datagen = ImageDataGenerator( rotation_range=10,
zoom_range=0.1, width_shift_range=0.1,
height_shift_range=0.1
)
epochs = 10
batch_size = 32 history = model.fit_generator(datagen.flow(x_train, y_train,
batch_size=batch_size), epochs=epochs, validation_data=(x_test, y_test),
steps_per_epoch=x_train.shape[0]//batch_size
)
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
output:
Epoch 1/10
1563/1563 [==============================] - 55s 33ms/step - loss: 1.6791 -
accuracy: 0.3891
Epoch 2/10
1563/1563 [==============================] - 63s 40ms/step - loss: 1.1319 -
accuracy: 0.60360s - loss:
Epoch 3/10
1563/1563 [==============================] - 66s 42ms/step - loss: 0.9915 -
accuracy: 0.6533
Epoch 4/10
1563/1563 [==============================] - 70s 45ms/step - loss: 0.8963 -
accuracy: 0.6883
Epoch 5/10
1563/1563 [==============================] - 69s 44ms/step - loss: 0.8192 -
accuracy: 0.7159
Epoch 6/10
1563/1563 [==============================] - 62s 39ms/step - loss: 0.7695 -
accuracy: 0.73471s
Epoch 7/10
1563/1563 [==============================] - 62s 39ms/step - loss: 0.7071 -
accuracy: 0.7542
Epoch 8/10
1563/1563 [==============================] - 62s 40ms/step - loss: 0.6637 -
accuracy: 0.76941s - l
Epoch 9/10
1563/1563 [==============================] - 60s 38ms/step - loss: 0.6234 -
accuracy: 0.7840
Epoch 10/10
1563/1563 [==============================] - 58s 37ms/step - loss: 0.5810 -
accuracy: 0.7979
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
Regularization
Before we deep dive into the topic, take a look at this image:
Have you seen this image before? As we move towards the right in this image, our model tries
to learn too well the details and the noise from the training data, which ultimately results in
poor performance on the unseen data.
In other words, while going towards the right, the complexity of the model increases such that
the training error reduces but the testing error doesn’t. This is shown in the image below.
If you’ve built a neural network before, you know how complex they are. This makes them
more prone to overfitting.
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
Regularization is a technique which makes slight modifications to the learning algorithm such
that the model generalizes better. This in turn improves the model’s performance on the unseen
data as well.
How does Regularization help reduce Overfitting?
Let’s consider a neural network which is overfitting on the training data.
If you have studied the concept of regularization in machine learning, you will have a fair idea
that regularization penalizes the coefficients. In deep learning, it actually penalizes the
weight matrices of the nodes.
Assume that our regularization coefficient is so high that some of the weight matrices are nearly
equal to zero. This will result in a much simpler linear network and slight underfitting of the
training data.
Such a large value of the regularization coefficient is not that useful. We need to optimize the
value of regularization coefficient in order to obtain a well-fitted model as shown in the image
below.
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
In L2, we have:
Here, lambda is the regularization parameter. It is the hyperparameter whose value is
optimized for better results. L2 regularization is also known as weight decay as it forces the
weights to decay towards zero (but not exactly zero).
In L1, we have:
In this, we penalize the absolute value of the weights. Unlike L2, the weights may be reduced
to zero here. Hence, it is very useful when we are trying to compress our model. Otherwise,
we usually prefer L2 over it.
Dropout
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
This is the one of the most interesting types of regularization techniques. It also produces very
good results and is consequently the most frequently used regularization technique in the field
of deep learning.
To understand dropout, let’s say our neural network structure is akin to the one shown below:
So what does dropout do? At every iteration, it randomly selects some nodes and removes them
along with all of their incoming and outgoing connections as shown below.
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
So each iteration has a different set of nodes and this results in a different set of outputs. It can
also be thought of as an ensemble technique in machine learning.
Ensemble models usually perform better than a single model as they capture more randomness.
Similarly, dropout also performs better than a normal neural network model.
This probability of choosing how many nodes should be dropped is the hyperparameter of the
dropout function. As seen in the image above, dropout can be applied to both the hidden layers
as well as the input layers.
Due to these reasons, dropout is usually preferred when we have a large neural network
structure in order to introduce more randomness.
In keras, we can implement dropout using the keras layer. Below is the Dropout
Implementation. I have introduced a dropout of 0.2 as the probability of dropping in my neural
network architecture after the last hidden layer having 64 kernels and after the first dense layer
having 500 neurons. Batch Normalization
Generally, when we input the data to a machine or deep learning algorithm we tend to change
the values to a balanced scale. The reason we normalize is partly to ensure that our model
can generalize appropriately.
Now coming back to Batch normalization, it is a process to make neural networks faster and
more stable through adding extra layers in a deep neural network. The new layer performs the
standardizing and normalizing operations on the input of a layer coming from a previous layer.
But what is the reason behind the term “Batch” in batch normalization? A typical neural
network is trained using a collected set of input data called batch. Similarly, the normalizing
process in batch normalization takes place in batches, not as a single input.
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
Normalization of the Input
Normalization is the process of transforming the data to have a mean zero and standard
deviation one. In this step we have our batch input from layer h, first, we need to calculate the
mean of this hidden activation.
Further, as we have the mean and the standard deviation ready. We will normalize the hidden
activations using these values. For this, we will subtract the mean from each input and divide
the whole value with the sum of standard deviation and the smoothing term (ε).
The smoothing term(ε) assures numerical stability within the operation by stopping a division
by a zero value.
Rescaling of Offsetting
In the final operation, the re-scaling and offsetting of the input take place. Here two components
of the BN algorithm come into the picture, γ(gamma) and β (beta). These parameters are used
for re-scaling (γ) and shifting(β) of the vector containing values from the previous operations.
These two are learnable parameters, during the training neural network ensures the optimal
values of γ and β are used. That will enable the accurate normalization of each batch.
Advantages of Batch Normalization
Now let’s look into the advantages the BN process offers.
Speed Up the Training
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
By Normalizing the hidden layer activation the Batch normalization speeds up the training
process.
Handles internal covariate shift
It solves the problem of internal covariate shift. Through this, we ensure that the input for every
layer is distributed around the same mean and standard deviation. If you are unaware of what
is an internal covariate shift, look at the following example.
Internal covariate shift
Suppose we are training an image classification model, that classifies the images into Dog or
Not Dog. Let’s say we have the images of white dogs only, these images will have certain
distribution as well. Using these images model will update its parameters.
later, if we get a new set of images, consisting of non-white dogs. These new images will have
a slightly different distribution from the previous images. Now the model will change its
parameters according to these new images. Hence the distribution of the hidden activation will
also change. This change in hidden activation is known as an internal covariate shift.
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
Introduction to Convolution Neural Network
A Convolutional Neural Network (CNN) is a type of Deep Learning neural network
architecture commonly used in Computer Vision. Computer vision is a field of Artificial
Intelligence that enables a computer to understand and interpret the image or visual data.
When it comes to Machine Learning, Artificial Neural Networks perform really well. Neural
Networks are used in various datasets like images, audio, and text. Different types of Neural
Networks are used for different purposes, for example for predicting the sequence of words we
use Recurrent Neural Networks more precisely an LSTM, similarly for image classification
we use Convolution Neural networks. In this blog, we are going to build a basic building block
for CNN.
In a regular Neural Network there are three types of layers:
1. Input Layers: It’s the layer in which we give input to our model. The number of
neurons in this layer is equal to the total number of features in our data (number of
pixels in the case of an image).
2. Hidden Layer: The input from the Input layer is then fed into the hidden layer. There
can be many hidden layers depending on our model and data size. Each hidden layer
can have different numbers of neurons which are generally greater than the number of
features. The output from each layer is computed by matrix multiplication of the output
of the previous layer with learnable weights of that layer and then by the addition of
learnable biases followed by activation function which makes the network nonlinear.
3. Output Layer: The output from the hidden layer is then fed into a logistic function like
sigmoid or softmax which converts the output of each class into the probability score
of each class.
The data is fed into the model and output from each layer is obtained from the above step is
called feedforward, we then calculate the error using an error function, some common error
functions are cross-entropy, square loss error, etc. The error function measures how well the
network is performing. After that, we backpropagate into the model by calculating the
derivatives. This step is called Backpropagation which basically is used to minimize the loss.
Convolution Neural Network
Convolutional Neural Network (CNN) is the extended version of artificial neural networks
(ANN) which is predominantly used to extract the feature from the grid-like matrix dataset.
For example, visual datasets like images or videos where data patterns play an extensive role.
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
CNN architecture
Convolutional Neural Network consists of multiple layers like the input layer, Convolutional
layer, Pooling layer, and fully connected layers.
Now imagine taking a small patch of this image and running a small neural network, called a
filter or kernel on it, with say, K outputs and representing them vertically. Now slide that neural
network across the whole image, as a result, we will get another image with different widths,
heights, and depths. Instead of just R, G, and B channels now we have more channels but lesser
width and height. This operation is called Convolution. If the patch size is the same as that of
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
the image it will be a regular neural network. Because of this small patch, we have fewer
weights.
Now let’s talk about a bit of mathematics that is involved in the whole convolution process.
● Convolution layers consist of a set of learnable filters (or kernels) having small widths
and heights and the same depth as that of input volume (3 if the input layer is image
input).
● For example, if we have to run convolution on an image with dimensions 34x34x3. The
possible size of filters can be axax3, where ‘a’ can be anything like 3, 5, or 7 but smaller
as compared to the image dimension.
● During the forward pass, we slide each filter across the whole input volume step by step
where each step is called stride (which can have a value of 2, 3, or even 4 for
highdimensional images) and compute the dot product between the kernel weights and
patch from input volume.
● As we slide our filters we’ll get a 2-D output for each filter and we’ll stack them together
as a result, we’ll get output volume having a depth equal to the number of filters. The
network will learn all the filters.
Layers used to build ConvNets
A complete Convolution Neural Networks architecture is also known as covnets. A covnets is
a sequence of layers, and every layer transforms one volume to another through a differentiable
function.
Types of layers:
Datasets, Let’s take an example by running a covnets on of image of dimension 32 x 32 x 3.
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
● Input Layers: It’s the layer in which we give input to our model. In CNN, Generally,
the input will be an image or a sequence of images. This layer holds the raw input of
the image with width 32, height 32, and depth 3.
● Convolutional Layers: This is the layer, which is used to extract the feature from the
input dataset. It applies a set of learnable filters known as the kernels to the input
images. The filters/kernels are smaller matrices usually 2×2, 3×3, or 5×5 shape. it slides
over the input image data and computes the dot product between kernel weight and the
corresponding input image patch. The output of this layer is referred ad feature maps.
Suppose we use a total of 12 filters for this layer we’ll get an output volume of
dimension 32 x 32 x 12.
● Activation Layer: By adding an activation function to the output of the preceding
layer, activation layers add nonlinearity to the network. It will apply an element-wise
activation function to the output of the convolution layer. Some common activation
functions are RELU: max(0, x), Tanh, Leaky RELU, etc. The volume remains
unchanged hence output volume will have dimensions 32 x 32 x 12.
● Pooling layer: This layer is periodically inserted in the covnets and its main function
is to reduce the size of volume which makes the computation fast reduces memory and
also prevents overfitting. Two common types of pooling layers are max pooling and
average pooling. If we use a max pool with 2 x 2 filters and stride 2, the resultant
volume will be of dimension 16x16x12.
● Flattening: The resulting feature maps are flattened into a one-dimensional vector after
the convolution and pooling layers so they can be passed into a completely linked layer
for categorization or regression.
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
● Fully Connected Layers: It takes the input from the previous layer and computes the
● Output Layer: The output from the fully connected layers is then fed into a logistic
function for classification tasks like sigmoid or softmax which converts the output of
each class into the probability score of each class.
Introduction to Natural Language Processing
Natural language processing (NLP) is a subfield of Artificial Intelligence (AI). This is a widely
used technology for personal assistants that are used in various business fields/areas. This
technology works on the speech provided by the user breaks it down for proper understanding
and processes it accordingly. This is a very recent and effective approach due to which it has a
really high demand in today’s market. Natural Language Processing is an upcoming field where
already many transitions such as compatibility with smart devices, and interactive talks with a
human have been made possible. Knowledge representation, logical reasoning, and constraint
satisfaction were the emphasis of AI applications in NLP. Here first it was applied to semantics
and later to grammar. In the last decade, a significant change in NLP research has resulted in
the widespread use of statistical approaches such as machine learning and data mining on a
massive scale. The need for automation is never-ending courtesy of the amount of work
required to be done these days. NLP is a very favourable, but aspect when it comes to
automated applications. The applications of NLP have led it to be one of the most sought-after
methods of implementing machine learning. Natural Language Processing (NLP) is a field that
combines computer science, linguistics, and machine learning to study how computers and
humans communicate in natural language. The goal of NLP is for computers to be able to
interpret and generate human language. This not only improves the efficiency of work done by
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2024-2025
humans but also helps in interacting with the machine. NLP bridges the gap of interaction
between humans and electronic devices.
Natural Language Processing (NLP) is a subfield of artificial intelligence that deals with the
interaction between computers and humans in natural language. It involves the use of
computational techniques to process and analyze natural language data, such as text and
speech, with the goal of understanding the meaning behind the language.
NLP is used in a wide range of applications, including machine translation, sentiment analysis,
speech recognition, chatbots, and text classification. Some common techniques used in NLP
include:
1. Tokenization: the process of breaking text into individual words or phrases.
2. Part-of-speech tagging: the process of labeling each word in a sentence with its
grammatical part of speech.
3. Named entity recognition: the process of identifying and categorizing named entities,
such as people, places, and organizations, in text.
4. Sentiment analysis: the process of determining the sentiment of a piece of text, such as
whether it is positive, negative, or neutral.
5. Machine translation: the process of automatically translating text from one language to
another.
6. Text classification: the process of categorizing text into predefined categories or topics.
Recent advances in deep learning, particularly in the area of neural networks, have led
to significant improvements in the performance of NLP systems. Deep learning
techniques such as Convolutional Neural Networks (CNNs) and Recurrent Neural
Networks (RNNs) have been applied to tasks such as sentiment analysis and machine
translation, achieving state-of-the-art results.
Overall, NLP is a rapidly evolving field that has the potential to revolutionize the way we
interact with computers and the world around us.
Natural Language Processing
Natural Language Processing (NLP) is a field of Artificial Intelligence (AI) and Computer
Science that is concerned with the interactions between computers and humans in natural
language. The goal of NLP is to develop algorithms and models that enable computers to
understand, interpret, generate, and manipulate human languages.
Common Natural Language Processing (NLP) Task:
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2023-2024
First, the computer must take natural language and convert it into machine-readable
language. This is what speech recognition or speech-to-text does. This is the first step
of NLU.
• Hidden Markov Models (HMMs) are used in the majority of voice recognition systems
nowadays. These are statistical models that use mathematical calculations to determine
what you said in order to convert your speech to text.
• HMMs do this by listening to you talk, breaking it down into small units (typically
1020 milliseconds), and comparing it to pre-recorded speech to figure out which
phoneme you uttered in each unit (a phoneme is the smallest unit of speech). The
program then examines the sequence of phonemes and uses statistical analysis to
determine the most likely words and sentences you were speaking.
Natural Language Understanding (NLU):
The next and hardest step of NLP is the understanding part.
• First, the computer must comprehend the meaning of each word. It tries to figure out
whether the word is a noun or a verb, whether it’s in the past or present tense, and so
on. This is called Part-of-Speech tagging (POS).
• A lexicon (a vocabulary) and a set of grammatical rules are also built into NLP systems.
The most difficult part of NLP is understanding.
• The machine should be able to grasp what you said by the conclusion of the process.
There are several challenges in accomplishing this when considering problems such as
words having several meanings (polysemy) or different words having similar meanings
(synonymy), but developers encode rules into their NLU systems and train them to
learn to apply the rules correctly.
Natural Language Generation (NLG):
NLG is much simpler to accomplish. NLG converts a computer’s machine-readable language
into text and can also convert that text into audible speech using text-to-speech technology.
• First, the NLP system identifies what data should be converted to text. If you asked the
computer a question about the weather, it most likely did an online search to find your
answer, and from there it decides that the temperature, wind, and humidity are the
factors that should be read aloud to you.
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2023-2024
• Then, it organizes the structure of how it’s going to say it. This is similar to NLU except
backward. NLG system can construct full sentences using a lexicon and a set of
grammar rules.
Finally, text-to-speech takes over. The text-to-speech engine uses a prosody model to
evaluate the text and identify breaks, duration, and pitch. The engine then combines all
the recorded phonemes into one cohesive string of speech using a speech database.
Some common roles in Natural Language Processing (NLP) include:
• NLP engineer: designing and implementing NLP systems and models
• NLP researcher: conducting research on NLP techniques and algorithms
• ML engineer: Designing and deployment of various machine learning models
including NLP.
• NLP data scientist: analyzing and interpreting NLP data
• NLP consultant: providing expertise in NLP to organizations and businesses. Working
in NLP can be both challenging and rewarding as it requires a good understanding of
both computational and linguistic principles. NLP is a fast-paced and rapidly changing
field, so it is important for individuals working in NLP to stay up-to-date with the latest
developments and advancements.
Technologies related to Natural Language Processing
There are a variety of technologies related to natural language processing (NLP) that are used
to analyze and understand human language. Some of the most common include:
1. Machine learning: NLP relies heavily on machine learning techniques such as
supervised and unsupervised learning, deep learning, and reinforcement learning to
train models to understand and generate human language.
2. Natural Language Toolkits (NLTK) and other libraries: NLTK is a popular
opensource library in Python that provides tools for NLP tasks such as tokenization,
stemming, and part-of-speech tagging. Other popular libraries include spaCy,
OpenNLP, and CoreNLP.
3. Parsers: Parsers are used to analyze the syntactic structure of sentences, such as
dependency parsing and constituency parsing.
B.Tech CSE AIML, 5th Semester
Artificial Intelligence for Real World Application
(PCC-CSM 503)
2023-2024