0% found this document useful (0 votes)
18 views40 pages

AIYA Session 3 Presentation

Uploaded by

skyfrost347
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)
18 views40 pages

AIYA Session 3 Presentation

Uploaded by

skyfrost347
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/ 40

AIYA (AWS)

Natural Language Processing – Session 3


Natural Language Processing (NLP)
Natural Language Processing

● The branch of artificial intelligence or AI—concerned with


giving computers the ability to understand text and
spoken words in much the same way human beings can.
● A.K.A Text Analytics
○ Needs to understand the text written by the users
Applications of NLP
● Speech recognition and synthesis
● Text analysis and entity recognition (NER - Named Entity Recognition)
● Banking and loan processing
● Social Media Analytics
● Sentiment Analysis
● Insurance processing
● Customer relationship processing
● Security and counter terrorism
● Ecommerce
● Psychology and cognitive science
● Machine translation
● Semantic language modeling
Applications of NLP

● Speech recognition and synthesis

Speech synthesis is artificial simulation of human

speech with by a computer or other device. The


counterpart of the voice recognition, speech synthesis is mostly
used for translating text information into audio information and
in applications such as voice-enabled services and mobile
applications.
Applications of NLP

● Text analysis and entity recognition

Also known as text mining, is the process of automatically


classifying and extracting meaningful information from
unstructured text. Entity recognition helps you easily identify
the key elements in a text, like names of people, places,
brands, monetary values, and more. Extracting the main entities
in a text helps sort unstructured data and detect important
information, which is crucial if you have to deal with large
datasets.
Applications of NLP

● Sentiment Analysis

Also referred to as opinion mining, is an approach to


natural language processing (NLP) that identifies the
emotional tone behind a body of text.
Applications of NLP

● Machine translation

Machine Translation (MT) is the task of automatically


converting one natural language into another,
preserving the meaning of the input text, and producing
fluent text in the output language.
Basics of NLP – Text Processing
NLP Algo
Lexical Analysis
Lexical Analysis
Original Text:

The quick brown foxes were


jumping over the lazy dogs
in the park
Lexical Analysis
After Stop Word Removal

quick brown foxes jumping


lazy dogs park
Lexical Analysis
After Tokenization

Text: ["quick", "brown",


"foxes", "jumping", "lazy",
"dogs", "park"]
Lexical Analysis
After Lemmatization

Text: ["quick", "brown", "foxes",


"jumping", "lazy", "dogs", "park"]

'foxes' becomes 'fox' and 'dogs'


becomes 'dog', 'jumping' becomes
'jump'.
Syntactic Processing

Basically as the name suggest, we look for syntax errors in either the document or code
Syntactic Processing
Original Text

Here use the sentence:


"The little boy went to the park"
Parsing may be defined as the process of analyzing the strings of symbols
in natural language conforming to the rules of formal grammar.

Home-work: Study what’s Data Structures in Programming. Study what’s


Parsing in Data Structures
Syntactic Processing
Tokenization

We break the sentence down into individual


words, or "tokens".

Text: ["The", "little", "boy", "went",


"to", "the", "park"]
Syntactic Processing
https://www.ibm.com/docs/en/wc
a/3.5.0?topic=analytics-part-
Part of Speech Tagging speech-tag-sets

We identify the part of speech for each word. This could be done using a Part-Of-
Speech Tagger, which uses machine learning algorithms trained on large corpora that
have been manually annotated with the correct part of speech.

Text: [("The", "DT"), ("little", "JJ"),


("boy", "NN"), ("went", "VBD"), ("to",
"TO"), ("the", "DT"), ("park", "NN")]
Syntactic Processing
Parsing – Syntactic Processing

Parsing may be defined as the process of analyzing the strings of symbols


in natural language conforming to the rules of formal grammar.

Home-work: Study what’s Data Structures in Programming. Study what’s


Parsing in Data Structures

Generally done to make the


existing, often unstructured,
unreadable data more
comprehensible.
Syntactic Processing
Parsing

We analyze the grammatical structure of the sentence, and illustrate this structure with a
parse tree.

For the sentence


"The little boy went to the park.", we can break it down into a noun
phrase (NP: "The little boy") and a verb phrase (VP: "went to the
park")
Semantic Processing

Original Text - "John went to Central Park.“

Tokenization - ["John", "went", "to", "Central", "Park"]

Part-of-Speech Tagging - [("John", "NNP"), ("went", "VBD"), ("to", "TO"), ("Central", "NNP"),
("Park", "NNP")]

Named Entity Recognition - ?????


Word Sense Disambiguation - ?????
Semantic Role Labelling - ?????
Coreference Resolution - ?????
Semantic Processing

Named Entity Recognition


Here, we're looking for special names or "entities" in our sentence.

This could be the name of a person ("John"), a place ("Central Park"), or maybe an organization
like a school or a company. These are like VIPs in our sentence.

Text: [("John", "PERSON"), ("Central Park", "LOCATION")]


Semantic Processing

Word Sense Disambiguation

Sometimes, a word can have different meanings depending on how


it's used.

For example, the word "park" can mean a place to play or it can
mean to stop a car. Here, we have to figure out what "park" means
in our sentence. In our case, "Central Park" is a location, a famous
park in New York.
Semantic Processing

Semantic Role Labeling


In this step, we're like detectives, figuring out who did what in the sentence.

We're looking for the person or thing doing the action (we call this the "agent"),
the action itself (the "predicate"), and where or to whom the action was done
(the "goal").

For our sentence, "John" is the Agent (the one doing the action), "went" is the
Predicate (the action), and "Central Park" is the Goal (where the action was
directed).
**Predicate: the part of a sentence or clause containing a verb and stating something about the subject
Semantic Processing

Coreference Resolution
This step is like a game of matching.

We look at the sentence to see if there are words that refer to the same person or thing. In this
sentence, there aren't any.

But if we had a second sentence, "He loves it there," 'He' refers back to 'John' and 'it' refers
back to 'Central Park'.

These steps all help a computer to understand the meaning of a sentence just like we do. It's a lot
of detective work, but it's how machines can start to understand our language!
Semantic Processing
Data Types – Type Checking

A x B = 25

Y x Z = “36”

A=5
B=5
Y=6
Z=6

Tell me the Data Types of A, B, Y, Z


Libraries
NLTK (Natural Language Toolkit): A comprehensive library for natural language processing tasks in Python, offering tools for text
processing, tokenization, and parsing.

SpaCy: An efficient and user-friendly library for advanced natural language processing in Python, providing pre-trained models and tools for
tokenization, named entity recognition, and part-of-speech tagging.

Gensim: A library for topic modeling and document similarity analysis using unsupervised machine learning algorithms like Word2Vec and
LDA.

TensorFlow: An open-source machine learning library developed by Google, designed for high-performance numerical computation and large
-scale machine learning model deployment.

PyTorch: An open-source deep learning framework developed by Facebook, known for its dynamic computation graph and ease of use in
building and training neural networks.
Extraction vs Abstraction

?
Introduction to Chatbot
Introduction to Chatbot
- Chatbot is a computer program that simulates a natural human conversation.
- Chatbots rely on Natural Language understanding for inputs. They generally
take input through a text box.
- Chatbots have become popular in a large number of business domains.
Companies are building chatbots for booking hotels, flights, movies etc.,
customer support, enquiring bus and train schedules, tax saving advice,
accessing stock market information etc.
Why are they getting so much attention? The reason is simple: they help
reduce the time, effort and cost required to get a task done (and if designed well,
improve user experience also).
Types of Chat bot
● Generic chat bot a.k.a virtual assistants

● Domain specific , task oriented chatbot


What’s a chatbot?
A bot performs automated tasks such as ordering a pizza, booking a
hotel, ordering flowers, and so on. An Amazon Lex bot is powered by
Automatic Speech Recognition (ASR) and Natural Language
Understanding (NLU) capabilities. Each bot must have a unique
name within your account.
Automatic Speech Recognition (ASR)

"Play my workout playlist"


Natural Language Understanding
(NLU)

"Play my workout playlist"

Your workout
playlist is triggered
by the system
Amazon Lex

Amazon Lex bots can understand user input


provided with text or speech and converse in
natural language.

You can create Lambda functions and add them


as code hooks in your intent configuration to
perform user data validation and fulfillment tasks.
What is a FUNCTION?
Extras

Bonus Knowledge:
What is Frontend?
What is Backend?
JavaScript and it’s flavors.
React, Vue, Angular – F
Node – B
Make accounts

LinkedIn - https://www.linkedin.com/in/saifeemustafa/
Twitter - https://twitter.com/mustafasaifee_
Thank you

You might also like