0% found this document useful (0 votes)
16 views37 pages

NLP Unit 3&4

The document provides an overview of key topics in natural language processing including information retrieval, information extraction, named entity recognition, relation extraction, and language models. It describes the general processes and techniques involved in each topic at a high level.

Uploaded by

adarsh24jdp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views37 pages

NLP Unit 3&4

The document provides an overview of key topics in natural language processing including information retrieval, information extraction, named entity recognition, relation extraction, and language models. It describes the general processes and techniques involved in each topic at a high level.

Uploaded by

adarsh24jdp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Natural Language Processing (NLP)

UNIT 3&4 Notez


[This document is made to study for CT2 and End-sem examination as notes
provided with respect to unit 3 and 4 doesn’t match the syllabus.]
[Because we all know downloading webpages as pdf doesn’t make notes.]

- Red Highlight represents uncovered topics in given notes.


- Yellow Highlight represents vaguely covered topics in given
notes.
*Non-highlighted topics are covered and I will refer them from notes
only.

Unit 5 Notes pdf by faculty covers all the topics so this pdf will not
contain Unit 5 at all.

You can ignore that one uncovered topic or look it up yourself, see it as an
optional DIY.

Made by – Utkarsh M.
UNIT – 3

Information retrieval (IR):

[Refer from ‘nlp-natural-language-processing-notes.pdf’ page- 35 (brief


ans.) or page no. 56-59 (Long answer) before ‘The Boolean Model’]

Information Extraction (IE):

The task of automatically extracting structured information from


unstructured and/or semi-structured machine-readable documents and
other electronically represented sources is known as information
extraction (IE).

Information extraction involves identifying specific entities,


relationships, and events of interest in text data, such as named
entities like people, organizations, dates and locations, and converting
them into a structured format that can be analyzed and used for
various applications.

Made by – Utkarsh M.
Information extraction is a challenging task that requires the use of
various techniques, including named entity recognition (NER), regular
expressions, and text matching, among others.

General Pipeline of the Information Extraction Process:

The following steps are often involved in extracting structured


information from unstructured texts:
1. Initial processing.
2. Proper names identification.
3. Parsing.
4. Extraction of events and relations.
5. Anaphora resolution.
6. Output result generation.

1. Initial processing
The first step is to break down a text into fragments such as zones, phrases,
segments, and tokens. This function can be performed by tokenizers, text zoners,
segmenters, and splitters, among other components.
In the initial processing stage, part-of-speech tagging, and phrasal unit
identification (noun or verb phrases) are usually the next tasks.
2. Proper names identification
One of the most important stages in the information extraction chain is the
identification of various classes of proper names, such as names of people or
organizations, dates, monetary amounts, places, addresses, and so on.
They may be found in practically any sort of text and are widely used in the
extraction process.
3. Parsing
The syntactic analysis of the sentences in the texts is done at this step. After
recognizing the fundamental entities in the previous stage, the sentences are
processed to find the noun groups that surround some of those entities and verb
groups.

Made by – Utkarsh M.
4. Extraction of events and relations
This stage establishes relations between the extracted ideas. This is
accomplished by developing and implementing extraction rules that describe
various patterns.
The text is compared to certain patterns, and if a match is discovered, the text
element is labeled and retrieved later.
5. Coreference or Anaphora resolution
Coreference resolution is used to identify all of the ways the entity is named
throughout the text. The step where noun phrases are decided if they relate to
the same entity or not is called coreference or anaphora resolution.
6. Output results generation
This stage entails converting the structures collected during the preceding
processes into output templates that follow the format defined by the user. It
might comprise a variety of normalization processes.

Named Entity Recognition (NER):

Named Entity Recognition (NER) is a sub-task of information extraction in


Natural Language Processing (NLP) that classifies named entities into
predefined categories such as person names, organizations, locations, medical
codes, time expressions, quantities, monetary values, and more.

Named Entity Recognition (NER) serves as a bridge between unstructured text


and structured data, enabling machines to sift through vast amounts of textual
information and extract nuggets of valuable data in categorized forms.

NER's primary objective is to comb through unstructured text and identify


specific chunks as named entities, subsequently classifying them into
predefined categories. This conversion of raw text into structured information
makes data more actionable, facilitating tasks like data analysis, information
retrieval, and knowledge graph construction.

Made by – Utkarsh M.
Working of NRE:

1. Tokenization - Before identifying entities, the text is split into tokens,


which can be words, phrases, or even sentences. For instance, "Steve
Jobs co-founded Apple" would be split into tokens like "Steve", "Jobs", "co-
founded", "Apple".

2. Entity identification - Using various linguistic rules or statistical methods,


potential named entities are detected. This involves recognizing patterns,
such as capitalization in names ("Steve Jobs") or specific formats (like
dates).

3. Entity classification - Once entities are identified, they are categorized


into predefined classes such as "Person", "Organization", or "Location".
This is often achieved using machine learning models trained on labeled
datasets. For our example, "Steve Jobs" would be classified as a "Person"
and "Apple" as an "Organization".

4. Contextual analysis - NER systems often consider the surrounding


context to improve accuracy. For instance, in the sentence "Apple
released a new iPhone", the context helps the system recognize "Apple"
as an organization rather than a fruit.

5. Post-processing - After initial recognition and classification, post-


processing might be applied to refine results. This could involve resolving
ambiguities, merging multi-token entities, or using knowledge bases to
enhance entity data.

Made by – Utkarsh M.
Relation Identification or Relation Extraction:

Relation Identification or Relation Extraction in natural language processing


(NLP) is a technique that helps understand the connections between entities
mentioned in text. Relationship extraction is an effective technique for organizing
information, constructing knowledge graphs, aiding information retrieval, and
supporting decision-making processes by identifying and classifying the
associations between entities.

The main goal of relationship extraction is to extract valuable insights from text
that enrich our understanding of the relationships that bind people,
organizations, concepts, etc.

Relationship Extraction (RE) is an important process in Natural Language


Processing that automatically identifies and categorizes the connections
between entities within natural language text.
These entities can encompass individuals, organizations, locations, dates, or any
other nouns or concepts mentioned in the text. The relationships denote how
these entities are related to each other, like “founder of”, “located in”, “works at”
“married to”, etc.
For instance, “John works at the company” illustrates a “works at” relationship
from John to the company. This extracted relationship serves to enrich the
semantic understanding of the text and can be organized into structured data for
various downstream applications.

Template Filling:
[I leave this topic for more big brainers as I couldn’t find a satisfactory answer.]

Made by – Utkarsh M.
Language Models in NLP:

A language model is the core component of modern Natural Language


Processing (NLP). It’s a statistical model that is designed to analyze the pattern
of human language and predict the likelihood of a sequence of words or tokens.

NLP-based applications use language models for a variety of tasks, such as


audio to text conversion, speech recognition, sentiment analysis,
summarization, spell correction, etc.

Types of Language Models:


There are primarily two types of language models:
1. Statistical Language Models
Statistical models include the development of probabilistic models that are able
to predict the next word in the sequence, given the words that precede it. A
number of statistical language models are in use already.

Types of Statistical Language Models:


I. N-Gram: This is one of the simplest approaches to language modelling.
Here, a probability distribution for a sequence of ‘n’ is created, where ‘n’
can be any number and defines the size of the gram (or sequence of words
being assigned a probability).

II. Unigram: The unigram is the simplest type of language model. It doesn't
look at any conditioning context in its calculations. It evaluates each word
or term independently. Unigram models commonly handle language
processing tasks such as information retrieval.

Made by – Utkarsh M.
The unigram is the foundation of a more specific model variant called the
query likelihood model, which uses information retrieval to examine a pool
of documents and match the most relevant one to a specific query.

III. Bidirectional: Unlike n-gram models, which analyze text in one direction
(backwards), bidirectional models analyze text in both directions,
backwards and forwards. These models can predict any word in a
sentence or body of text by using every other word in the text. Examining
text bidirectionally increases result accuracy.

IV. Exponential: This type of statistical model evaluates text by using an


equation which is a combination of n-grams and feature functions. Here
the features and parameters of the desired results are already specified.
The model is based on the principle of entropy, which states that
probability distribution with the most entropy is the best choice.

V. Continuous Space: In this type of statistical model, words are arranged


as a non-linear combination of weights in a neural network. The process of
assigning weight to a word is known as word embedding. This type of
model proves helpful in scenarios where the data set of words continues
to become large and include unique words.

2. Neural Language Models


These language models are based on neural networks and are often considered
as an advanced approach to execute NLP tasks. Neural language models
overcome the shortcomings of classical models such as n-gram and are used for
complex tasks such as speech recognition or machine translation.

Language is significantly complex and keeps on evolving. Therefore, the more


complex the language model is, the better it would be at performing NLP tasks.
Compared to the n-gram model, an exponential or continuous space model
proves to be a better option for NLP tasks because they are designed to handle
ambiguity and language variation.

Made by – Utkarsh M.
Probabilistic Language Model:

[Unsatisfactory answers; skipping; feel free to share your answers.]


N-Gram Model in NLP:

N-grams in NLP refers to contiguous sequences of n words extracted from text


for language processing and analysis. An n-gram can be as short as a single word
(unigram) or as long as multiple words (bigram, trigram, etc.). These n-grams
capture the contextual information and relationships between words in a given
text.
N-gram can be defined as the contiguous sequence of n items from a given
sample of text or speech. The items can be letters, words, or base pairs
according to the application. The N-grams typically are collected from a text or
speech corpus (A long text dataset).
N-grams in NLP can be generated by sliding a window of n words across a
sentence or text corpus. By extracting these n-grams, it becomes possible to
analyze the frequency of occurrence of certain word sequences, identify
collocations or commonly co-occurring words, and model the language patterns
in a text.
An N-gram language model predicts the probability of a given N-gram within any
sequence of words in the language. A good N-gram model can predict the next
word in the sentence i.e the value of p(w|h)
We need to calculate p(w|h), where is the candidate for the next word. For
example, in the above example, lets’ consider, we want to calculate what is the
probability of the last word being “NLP” given the previous words:

Made by – Utkarsh M.
p(NLP|this article is on)

To Calculate it we use chain rule of probablity:

Simplifying the above formula using Markov assumptions:

Hidden Markov Model:

[Refer from ‘nlp-natural-language-processing-notes.pdf’ page no. 46-49;


Below is my own answer, You can prefer either one as you wish.]

Made by – Utkarsh M.
The hidden Markov Model (HMM) is a statistical model that is used to describe
the probabilistic relationship between a sequence of observations and a
sequence of hidden states. It is often used in situations where the underlying
system or process that generates the observations is unknown or hidden, hence
it has the name “Hidden Markov Model.”
It is used to predict future observations or classify sequences, based on the
underlying hidden process that generates the data.
An HMM consists of two types of variables: hidden states and observations.
• The hidden states are the underlying variables that generate the observed
data, but they are not directly observable.
• The observations are the variables that are measured and observed.

The relationship between the hidden states and the observations is modeled
using a probability distribution.
The Hidden Markov Model (HMM) is the relationship between the hidden states
and the observations using two sets of probabilities: the transition probabilities
and the emission probabilities.
• The transition probabilities describe the probability of transitioning from
one hidden state to another.
• The emission probabilities describe the probability of observing an
output given a hidden state.

Hidden Markov Model Algorithm:


The Hidden Markov Model (HMM) algorithm can be implemented using the
following steps:

Step 1: Define the state space and observation space


The state space is the set of all possible hidden states, and the
observation space is the set of all possible observations.
Step 2: Define the initial state distribution
This is the probability distribution over the initial state.

Made by – Utkarsh M.
Step 3: Define the state transition probabilities
These are the probabilities of transitioning from one state to another. This
forms the transition matrix, which describes the probability of moving
from one state to another.
Step 4: Define the observation likelihoods:
These are the probabilities of generating each observation from each
state. This forms the emission matrix, which describes the probability of
generating each observation from each state.

Step 5: Train the model


The parameters of the state transition probabilities and the observation
likelihoods are estimated using the Baum-Welch algorithm, or the
forward-backward algorithm. This is done by iteratively updating the
parameters until convergence.
Step 6: Decode the most likely sequence of hidden states
Given the observed data, the Viterbi algorithm is used to compute the
most likely sequence of hidden states. This can be used to predict future
observations, classify sequences, or detect patterns in sequential data.
Step 7: Evaluate the model
The performance of the HMM can be evaluated using various metrics,
such as accuracy, precision, recall, or F1 score.

Topic Modelling:

Topic modelling is recognizing the words from the topics present in the
document or the corpus of data. This is useful because extracting the words
from a document takes more time and is much more complex than extracting
them from topics present in the document. For example, there are 1000

Made by – Utkarsh M.
documents and 500 words in each document. So to process this it requires
500*1000 = 500000 threads. So when you divide the document containing
certain topics then if there are 5 topics present in it, the processing is just 5*500
words = 2500 threads.

Topic modelling is done using LDA(Latent Dirichlet Allocation). Topic modelling


refers to the task of identifying topics that best describes a set of documents.
These topics will only emerge during the topic modelling process (therefore
called latent). And one popular topic modelling technique is known as Latent
Dirichlet Allocation (LDA).
Topic modelling is an unsupervised approach of recognizing or extracting the
topics by detecting the patterns like clustering algorithms which divides the data
into different parts. The same happens in Topic modelling in which we get to
know the different topics in the document. This is done by extracting the patterns
of word clusters and frequencies of words in the document.

So based on this it divides the document into different topics. As this doesn’t
have any outputs through which it can do this task hence it is an unsupervised
learning method. This type of modelling is very much useful when there are many
documents present and when we want to get to know what type of information is
present in it. This takes a lot of time when done manually and this can be done
easily in very little time using Topic modelling.

Graph Models:
[I don’t know if this is talking about GNNs or Graph Representation stuff, so
proceed with caution.]

Graphs have always formed an essential part of NLP applications ranging from
syntax-based Machine Translation, knowledge graph-based question answering,
abstract meaning representation for common sense reasoning tasks, and so on.
But with the advent of ‘end to end deep learning’ systems, there was a decrease
in such traditional parse algorithms.

Made by – Utkarsh M.
Syntactic and Semantic Parse Graphs
The image describes the parser output by the Spacy tagger. We can define every
node as a word and every edge as the dependency parse tag. Every word can
have pos tags as attributes. Some might argue that powerful attention
mechanisms can automatically learn the syntactic and semantic relationships.

Knowledge Graph
A knowledge graph represents a collection of interlinked descriptions of entities
— real-world objects, events, situations, or abstract concepts. Every node is an
entity and edges describe relations between them. Most famous KGs in NLP
include Dbpedia, WikiData, ConceptNet.

Made by – Utkarsh M.
Temporal graphs
LSTMs have been shown to be poor on long-range dependencies so connecting
words/documents through edges that depict instances in time would be one of
the solutions.

Made by – Utkarsh M.
Feature Selection and classifiers:

Feature selection is a process that chooses a subset of features from the original
features so that the feature space is optimally reduced according to a certain
criterion.
Feature selection is a critical step in the feature construction process. In text
categorization problems, some words simply do not appear very often. Perhaps
the word “groovy” appears in exactly one training document, which is positive.

Rule Based Classifiers:

Rule-based classifiers are just another type of classifier which makes the class
decision depending by using various “if..else” rules.
These rules are easily interpretable and thus these classifiers are generally used
to generate descriptive models. The condition used with “if” is called the
antecedent and the predicted class of each rule is called the consequent.
Properties of rule-based classifiers:

• Coverage: The percentage of records which satisfy the antecedent


conditions of a particular rule.

• The rules generated by the rule-based classifiers are generally not


mutually exclusive, i.e. many rules can cover the same record.

• The rules generated by the rule-based classifiers may not be exhaustive,


i.e. there may be some records which are not covered by any of the rules.

• The decision boundaries created by them is linear, but these can be much
more complex than the decision tree because the many rules are triggered
for the same record.

Made by – Utkarsh M.
Example:
Below is the dataset to classify mushrooms as edible or poisonous:

Made by – Utkarsh M.
Maximum Entropy Classifier:

The Max Entropy classifier is a probabilistic classifier which belongs to the class
of exponential models.
Unlike the Naive Bayes classifier that we discussed in the previous article, the
Max Entropy does not assume that the features are conditionally independent of
each other.
The MaxEnt is based on the Principle of Maximum Entropy and from all the
models that fit our training data, selects the one which has the largest entropy.
The Max Entropy classifier can be used to solve a large variety of text
classification problems such as language detection, topic classification,
sentiment analysis and more.

Due to the minimum assumptions that the Maximum Entropy classifier makes,
we regularly use it when we don’t know anything about the prior distributions and
when it is unsafe to make any such assumptions.
Moreover, Maximum Entropy classifier is used when we can’t assume the
conditional independence of the features. This is particularly true in Text
Classification problems where our features are usually words which obviously
are not independent.
The Max Entropy requires more time to train comparing to Naive Bayes, primarily
due to the optimization problem that needs to be solved in order to estimate the
parameters of the model.

Clustering Word:

Word clustering is a technique for partitioning sets of words into subsets of


semantically similar words and is increasingly becoming a major technique used
in a number of NLP tasks ranging from word sense or structural disambiguation
to information retrieval and filtering.

Made by – Utkarsh M.
There are two main different types of similarity have been used which can be
characterized as follows:

1. Paradigmatic, or substitutional, similarity: Two words that are


paradigmatically similar may be substituted for one another in a particular
context.

For example, in the context I read the book, the word book can be replaced
by magazine with no violation of the semantic well-formedness of the
sentence, and therefore the two words can be said to be paradigmatically
similar;

2. Syntagmatic similarity: Two words that are syntagmatically similar


significantly occur together in 2text. For instance, cut and knife are
syntagmatically similar since they typically co-occur within the same
context.

Phrase Based Clustering:

[Nai mila sarkaar, kal aana kal]

Transformer Architecture:

Transformers were first developed to solve the problem of sequence


transduction, or neural machine translation, which means they are meant to
solve any task that transforms an input sequence to an output sequence. This
is why they are called “Transformers”.

The Transformer architecture follows an encoder-decoder structure but does


not rely on recurrence and convolutions in order to generate an output.

Made by – Utkarsh M.
They are specifically designed to comprehend context and meaning by
analyzing the relationship between different elements, and they rely almost
entirely on a mathematical technique called attention to do so.

Architecture:

Made by – Utkarsh M.
The task of the encoder, on the left half of the Transformer architecture, is to map
an input sequence to a sequence of continuous representations, which is then
fed into a decoder.

The decoder, on the right half of the architecture, receives the output of the
encoder together with the decoder output at the previous time step to generate
an output sequence.

The Transformer model runs as follows:


1. Each word forming an input sequence is transformed into a 𝑑model -
dimensional embedding vector.

2. Each embedding vector representing an input word is augmented by


summing it (element-wise) to a positional encoding vector of the same
𝑑model length, hence introducing positional information into the input.

3. The augmented embedding vectors are fed into the encoder block
consisting of the two sublayers explained above.
Since the encoder attends to all words in the input sequence, irrespective if
they precede or succeed the word under consideration, then the Transformer
encoder is bidirectional.

4. The decoder receives as input its own predicted output word at time-step,
t-1.

5. The input to the decoder is also augmented by positional encoding in the


same manner done on the encoder side.

6. The augmented decoder input is fed into the three sublayers comprising
the decoder block explained above. Masking is applied in the first sublayer
in order to stop the decoder from attending to the succeeding words.

Made by – Utkarsh M.
At the second sublayer, the decoder also receives the output of the encoder,
which now allows the decoder to attend to all the words in the input
sequence.

7. The output of the decoder finally passes through a fully connected layer,
followed by a softmax layer, to generate a prediction for the next word of
the output sequence.

The following are some use cases of Transformers Architecture:

1. Natural language processing - Transformers enable machines to


understand, interpret, and generate human language in a way that's more
accurate than ever before. They can summarize large documents and
generate coherent and contextually relevant text for all kinds of use cases.

2. Machine translation - Translation applications use transformers to


provide real-time, accurate translations between languages.

3. DNA sequence analysis - By treating segments of DNA as a sequence


similar to language, transformers can predict the effects of genetic
mutations, understand genetic patterns, and help identify regions of DNA
that are responsible for certain diseases.

4. Protein structure analysis - Transformer models can process sequential


data, which makes them well suited for modeling the long chains of amino
acids that fold into complex protein structures. Understanding protein
structures is vital for drug discovery and understanding biological
processes.

Made by – Utkarsh M.
Various Transformers Models for NLP:

1. Sequence-to-Sequence Models - Sequence to Sequence Transformer


models adopt a relatively straightforward approach by embedding an entire
sequence into a higher dimension, which is then decoded by a decoder. These
were primarily designed for translation tasks, due to their excellence at mapping
sequences between languages.

2. Autoregressive Models - Autoregressive models, popularized by GPT


(Generative Pre-trained Transformer), leverage the prior tokens to predict the
next token iteratively. They employ probabilistic inference to generate text,
relying heavily on the decoder component of the transformer.

3. Autoencoding Models - Autoencoding models are specifically oriented


toward language understanding and classification tasks, aiming to capture
meaningful representations of input data in their encoded form.

Made by – Utkarsh M.
UNIT – 4

WhAt iS a pRoMpT?

An artificial intelligence (AI) prompt is a mode of interaction between a human


and a large language model that lets the model generate the intended output.
A prompt for a text-to-text language model can be a query such as "What is
Fermat's little theorem?", a command such as "write a poem about leaves
falling", or a longer statement including context, instructions, and conversation
history.
A prompt may include a few examples for a model to learn from, such as asking
the model to complete "maison → house, chat → cat, chien →" (the expected
response being dog), an approach called few-shot learning.
(Ex. What is a Shrodinger’s Cat theory? Is age really just a number? ✅)

Elements of a prompt:

A prompt contains any of the following elements:

1. Instruction - a specific task or instruction you want the model to perform

2. Context - external information or additional context that can steer the


model to better responses

3. Input Data - the input or question that we are interested to find a response
for

4. Output Indicator - the type or format of the output.

Made by – Utkarsh M.
Tips for designing a prompt:

1. Be Specific: Clearly specify the format you want the AI's response in. If
you need a particular structure, include that information in your prompt.

2. Provide Context: Especially for complex tasks, offer context to guide the
AI. You can describe previous related interactions or the current situation.
Examples are incredibly helpful. Show the AI what a correct response
looks like.

3. Iterate and Refine: After AI responds, refine your prompts. If the AI


doesn’t produce the desired output, adjust your prompts' specificity, tone,
or format. It often takes several iterations to get the best results.

4. Experiment and Learn: Effective prompt engineering involves trial and


error. Continuously test and refine your prompts. Over time, this
experimentation will lead to better outcomes.

5. Utilize Tools: There are helpful tools available, like the Prompt Perfect
plugin and prompt templates. These resources can streamline your
prompt creation process and boost creativity.

Example prompts for various use cases:

1. Write a short story about a man trapped in a haunted house in Utah.


2. Design eye catching logo for a sunglass company that mixes fashion and fun.
3. Create an abstract painting inspired by rush hour traffic in Mumbai.
4. Create a game that helps students learn the present perfect tense.
5. Write a step-by-step tutorial on how to perform an experiment. The topic is
exploring the lifecycle of a plant.

Made by – Utkarsh M.
6. Write a script for an educational video that explores the Solar System and its
role in the Milky Way.
7. Compose a persuasive essay arguing for the importance of protecting national
parks.
9. Write a speech for accepting an acting award for "Best Supporting Actor."
10. Develop an email marketing strategy to generate leads and increase
conversion rates for a tractor company. Use personalized messaging and
automated workflows.

Introduction to AI chat bots:

Artificial intelligence chatbots are chatbots trained to have human-like


conversations using a process known as natural language processing (NLP).
With NLP, the AI chatbot is able to interpret human language as it is written,
which enables them to operate more or less on their own.
In other words, AI chatbot software can understand language outside of pre-
programmed commands and provide a response based on existing data. This
allows site visitors to lead the conversation, voicing their intent in their own
words.
At the base level, an AI chatbot is fed input data which it interprets and
translates into a relevant output. So, if a site visitor asks a question, the AI
chatbot will analyze their intent, as well as other factors like tone and sentiment,
and then attempt to deliver the best possible answer.

Working of AI Chatbots:

[Refer page 4(end) and 5 from ‘What is a chatbot and How… AirDroid.pdf’ *Notes pdf*]

Made by – Utkarsh M.
Popular AI chatbots:

Made by – Utkarsh M.
ChatGPT:

ChatGPT is an artificial intelligence (AI) chatbot that uses natural language


processing to create humanlike conversational dialogue. The language model
can respond to questions and compose various written content, including
articles, social media posts, essays, code and emails.
ChatGPT is a form of generative AI -- a tool that lets users enter prompts to
receive humanlike images, text or videos that are created by AI.

Working of ChatGPT:

ChatGPT works through its Generative Pre-trained Transformer, which uses


specialized algorithms to find patterns within data sequences. ChatGPT
originally used the GPT-3 large language model, a neural network machine
learning model and the third generation of Generative Pre-trained Transformer.
The transformer pulls from a significant amount of data to formulate a response.

ChatGPT now uses the GPT-3.5 model that includes a fine-tuning process for its
algorithm. ChatGPT Plus uses GPT-4, which offers a faster response time and
internet plugins. GPT-4 can also handle more complex tasks compared with
previous models, such as describing photos, generating captions for images and
creating more detailed responses up to 25,000 words.

Architecture of ChatGPT:
ChatGPT follows a similar architecture to the original GPT models, which is
based on the transformer architecture. It uses a transformer decoder block with
a self-attention mechanism.

Flow Diagram of ChatGPT architecture:

Made by – Utkarsh M.
ChatGPT uses deep learning, a subset of machine learning, to produce
humanlike text through transformer neural networks. The transformer predicts
text -- including the next word, sentence or paragraph -- based on its training
data's typical sequence.

Made by – Utkarsh M.
Training begins with generic data, then moves to more tailored data for a specific
task. ChatGPT was trained with online text to learn the human language, and
then it used transcripts to learn the basics of conversations.

How to Use ChatGpt?

Access ChatGPT:
Go to chat.openai.com or use the mobile app and sign in or sign up.

Ask Your Question:


In the message box on the ChatGPT homepage, type your question or prompt.

Get a Response:
ChatGPT generates an answer based on your question, and it appears below
your question.

Interact:
Once you have the answer to your prompt, you can do the following:
Enter a new prompt.
Regenerate the response.
Copy the response.
Share the response.
Like or dislike the response.

Made by – Utkarsh M.
Use cases of ChatGPT for various users:

1. Content creation - ChatGPT can be used to generate high-quality content for


websites, blogs, or social media platforms in a few seconds. This includes
creating content like:
• Product description
• Blog post
• Social media post
• Draft for a business idea
• Long form content like entire articles

2. Translation - ChatGPT can be used for translation services, where it can


automatically translate text from one language to another.

3. Conversational AI - ChatGPT can be used to create intelligent chatbots that


can converse with users in natural language. These chatbots can be used for
customer service, sales, or support to produce human like responses, as well as
for personal virtual assistants.

4. Knowledge discovery - With retrieval augmented generation, businesses can


feed relevant information to ChatGPT from their databases.
With this data, ChatGPT can inform employees using that company’s private
data, helping them discover business information using natural language.

5. Writing code - ChatGPT can write code for simple or repetitive tasks, such as
file I/O operations, data manipulation, and database queries.
However, it’s important to note that its ability to write code is limited and the
generated code may not always be the accurate, optimized or desired output.

Made by – Utkarsh M.
6. Debugging - ChatGPT’s bug fixing abilities can also be a valuable tool for
programmers. It can assist in debugging code by proposing possible causes of
errors and presenting solutions to resolve them.
In September 2023, OpenAI rolled out multi-modal capabilities to ChatGPT including
image processing. So, now it can also classify image and identify objects in an image.

7. Creating emails for customers - ChatGPT can design custom email


templates for specific customers using provided customer data. When a
company needs to send an email to a customer, ChatGPT can utilize a template
to create an email that is personalized to the customer’s specific interests and
requirements.

8. Grammar and writing check - Another application of ChatGPT for educators


involves utilizing its natural language understanding capabilities to aid in the
assessment and enhancement of written work. This can be implemented in
various ways:
• Proofreading and editing
• Providing feedback to students
• Teaching writing skills

9. Grading - ChatGPT can help teachers with the grading of student essays by
evaluating the content, structure, and coherence of the written work. The AI can
offer feedback on grammar, spelling, punctuation, and syntax while also
assessing the quality of the argument or analysis presented.

10. Research assistance - ChatGPT can be an asset in supporting and


streamlining the research process for academic projects, assignments, or
personal interests (Figure 11). It can assist in many steps involved in the
research process, such as:
• Topic selection
• Identifying relevant resources
• Organizing research
• Citation assistance

Made by – Utkarsh M.
Role of AI in Image Generation

AI image generation refers to the process of using artificial intelligence (AI)


algorithms and models to create realistic and visually appealing images. This
cutting-edge technology has gained prominence for its ability to produce lifelike
visuals, often indistinguishable from those created by human artists.

AI image generation involves the utilization of deep learning models, particularly


generative models, to produce images based on given input or prompts. These
models are trained on vast datasets containing diverse images, allowing them to
learn patterns, styles, and features present in various visual content.

Popular AI tools for Image Generation:

[Refer Page 6 (last para) -11 in ‘The Ultimate Guide…Medium.pdf’ *notes*]

Midjourney for Image Generation:

[Refer page no. 2 in ‘Midjourney_A Beginner….Generation.pdf’*notes*]

Working of Midjourney:

[Refer page no. 2 – 3 in ‘Midjourney_A Beginner ….Generation.pdf’*notes*]

How to use Midjourney:

[Refer page no. 3 – 5 in ‘Midjourney_A Beginner ….Generation.pdf’*notes*]

Made by – Utkarsh M.
Advantages and Disadvantages of Midjourney:

Made by – Utkarsh M.
Usecases of Midjourney:

1. Redefining Traditional Art Styles - With Midjourney AI Art, traditional art


styles can be reimagined and transformed. Artists can experiment with merging
classic techniques with futuristic elements, breathing new life into time-honored
styles.

2. Creating Dreamlike Surreal Landscapes - Midjourney AI Art has the ability to


transport us to fantastical realms through dreamlike landscapes.

3. Creating Photorealistic Images - Midjourney AI can create photorealistic


images that are indistinguishable from photographs taken by a professional
photographer.

4. Photo Re-Touching - Midjourney not only produces photorealistic images, but


it also allows you to create your own portraits with the help of Insight Face Bot.

5. Enriching User Interfaces and User Experience - UIUX plays a crucial role in
today’s digital landscape. Midjourney AI Art can enhance UI/UX design by
providing visually engaging elements that captivate users and create a delightful
interactive experience.

6. Icon Design - In the digital realm, where apps are essential, a captivating icon
is crucial for user engagement. An icon’s shape influences recognition and
memorability. While some icons stick to traditional shapes like squares or
circles, others embrace unique and abstract forms.

7. Game Assets - Game assets form the foundation of a game, including


characters, environments, props, textures, and more. Top-notch and optimized
assets enhance the visual appeal and immersive nature of gaming.

Made by – Utkarsh M.
8. Characters Design - The realm of character design is elevated to new heights
with Midjourney AI Art. From humanoid robots to extraterrestrial beings, artists
can create unique and compelling characters that push the boundaries of
imagination.

Image Sourcing vs. Image generation:

-------------------- THE END --------------------

Made by – Utkarsh M.
This marks the end of this PDF this one is one of two or three PDFs…

I personally believe we as humans have failed in life due to our own


procrastination or laziness, because rather to improve one’s work
efficiency, understanding and memorizing we need to rely on a huge
piece of code which barely has any true sentience to do work for us.

We then called it a new discovery at the end of the day and made
ourselves even more incompetent, it wouldn’t be unfair to say with use
of AI our future generation are only going to be more incompetent than
us, and still ignoring all this crucial aspects we just go on in our lives
making it a career…

There are just much more problems with Overuse of AI than the net
amount of good things that come out of it.

Anyways I hope this PDF helped as Always… Peace.


Regards
Utkarsh M.

Made by – Utkarsh M.

You might also like