You are on page 1of 24

CT002-3-2

AI Methods

Natural Language Processing

Overview of the Chapter


Introduction of NLP
Morphology analysis, pragmatic analysis, syntactic analysis
and semantic analysis
Unconscious Incompetence , Conscious Incompetence,
Conscious Competence and Unconscious Competence
Draw parse tree
The problems in NLP : Ambiguity in each types of NLP
analysis
Quick review and exercises

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

Learning Outcomes
To understand the concept of Natural Language
Processing
To describe 3 stages of NLP : Morphology analysis,
syntactic analysis and semantic analysis
To describe 4 stages of NLP
To construct a parse tree for a given sentence
Explain 4 problems in natural language processing

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

What is NLP ?

As tool to represent information.


Enable communication between people and computer.
In Artificial Intelligence, the goals to enable people to communicate with
computer without resorting complex commands and procedures.
It creates a machine learning that understand what a human define physical
and mental. In NLP the processable not understand linguistic.

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

The important of NLP


There at least 3 reasons for studying NLP :
You want a computer to communicate with users in their
terms; you rather not force users to learn a new language.
There a vast store of information recorded in natural
language that could be accessible via computer. Information
consistantly generated in the form of books, news, business
and gov. reports and scientific reports. Thus it require a
great deal of information must be to process natural
language.
Many problem in AI arise in very clear and explicit form in
NLP and thus it is good domain in which to experiment with
general theories.

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

Examples of NLP apps


The development of NLP provides : NLP interfaces to
knowledge bases ad NL translation. Many successful NLP
such as event extraction (NL interface), grammar checkers
(simple string match), conceptual search (keyword search)
and interlingual (glossary lookup).
Example : so called killer application Microsoft processing : a) Spelling checker and correction
b) Dictionary access
c) Localization resource files US based, Europe based, US
based

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

Examples of NLP apps


Machine translation: some 20 million USD spent for machine
translation products closely to related products. The practical
goals was simple : to go from machine readable foreign
technical texts to useful English form text written by American
scientist . You should know better, it is also appealing to
fantasize about intelligence computers that understand human
communication, that hyperbole is
practically unavoidable.
Speech recognition:
computer that can recognize
human conversation using
string controller.

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

Cont..
Retrieval: matching a query with photos - retrieve the
text with the illustration though in multimedia is more
important, so text without imaging, pattern offers figures
is hard especially to photographer and freelancer and
agency.

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

3 types of NLP
Morphology
It is subdicipline of linguistic that study words structure in term
of the lemma and stem
Lemma: is a process of grouping together the different inflected
words. Inflection is the modification of word to express
grammatical categories e.g: tense, mood, voice, aspect and case.
e.g search engine and identify mom, mummy -> mother
dad -> father
Walk -> walked,walks,walking
Stem : to crude heuristic process that chops off the ends of
words in hope achieve the goal of meaning correctly.

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

3 types of NLP
Stemming example :
Am, are, is be
Cars, cars car car
Operator, operation, operational - operate
Pragmatic
To study the meaning of sentence/ word. In human life, lots of
word spelling is same, sometimes similar but the meaning of
content is difference.
Is the study of the use of language in context. It examines how
people understand and produce communicative acts in a real
world situation .
CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

3 types of NLP
Pragmatic
It could be problem to develop the robots e.g : speech recognition,
translation system etc.
The study of speakers meaning, what speakers intentions and
beliefs are.
Example 1:
"Do you have the time?" means "what time is it?

To look at the main goal of the sentence

Example 2:
Santa Claus eats cookies..

To look at the pronouns and associate it with the correct noun

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

3 types of NLP
Semantic process
To study the structure covered the meaning of the sentence of
NL.
This is most complex tasks like finding synonyms, or words
sense disambiguation, construct FAQ, translate NL to another.
It seems to support syntax and morphology.
Example:
Cows eat grass
correct

syntactically correct,

Verb :semantically
buy purchase
Adjective : big large
Adverb : quickly - speedily

Grass eats cows


incorrect

syntactically correct,

semantically

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

Syntax process
A grammar checker a description of how words is grouped and
connected to each other in a sentence.
Usually in programming syntax is transformation of linear
sequence of individual word and punctuation mark in NL into
hierarchical tree (parse tree) like tagging, chunking/ detect
syntactic categories (verb, nouns, phrase etc) and construct the
syntax.
Example:

Cows

eat

grass

Wrong syntax:
Eat cows grass
CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

4 stages of NLP
Stage 1: Unconscious Incompetence
This is the very initial stage by which the person knows nothing either consciously or subconsciously.
For instance, if I ask you: "can you speak Mars planet language?"
Sure your respond is totally confused, because you never heard that language before and even not sure whether there are
existence of such language.
Stage 2: Conscious Incompetence
If somebody demonstrates to you how to speak Mars language, now at least you can recognize there is existence of such
language, at the same time, you are very sure you don't have that capability yet to speak because you are yet to learn.

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

4 stages of NLP
Stage 3: Conscious Competence
The individual understands or knows how to do something by consciously in paying full attention in learning the skill
and foundation of that language.
Mean you know you are mastering that skill better and better. the best answer to a particular problem.
Stage 4: Unconscious Competence
Over the time you have putting lots of effort in repeating the learning, you will soon discover that this skill has
becomes the "second nature" and can be performed easily.
What surprise yourself is, may be you don't even know you can speak so well in that language.

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

Parse trees
To ensure that the structure is correct.
Sentence
verb_phrase

Noun_phrase

Proper_noun

"Cows"
CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Verb

" eat"
Problem Solving using programmed solutions

Noun_phrase

"grass"

Parse tree

A parser will be needed to parse the tree .

A parser will check the whole tree to check the


possibilities that may arise.

It works like a search algorithm.

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

Quick Review Question


Create a parse tree for the following sentences:
1. Mary eats the lion.
2. Mary eats the ferocious lion.

Use the parse tree you have created above to check the following
sentences:
1. Carrots eat the carrot.
2. Rabbits eat every carrot.

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

Exercises
Which one of the following statement is CORRECT for
syntactic, semantic and pragmatic :
1.
2.
3.
4.
5.
6.

They fight and injured. Stephen doesnt know it was his fault.
One bowl is in red color and another is in blue. You take the bowl.
You know his car?
Just run is not the solution.
Goat has four legs. Clearly goat is an animal and carnivore.
My sis one of the members in their organization. She always travel every
month to many countries.
7. I like Dell and I have two laptops currently.
8. Sofea and Chloe like playing piano. She wants to be a musician. You
musician?
CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

Problems in NLP analysis


Main problem is ambiguity in syntactic, semantic and
pragmatic.
syntactic ambiguity - a word having more than one possible
syntactic category
E.g: She bats her eyelashes

'Bats' can be a verb or a noun

Ambiguity in morphology - the sound of the words are the


same (homophones)
E.g: bear and bare
CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

Problems in NLP analysis


Semantic ambiguity - a word may have more than one
meaning (lexical ambiguity)
E.g: "bank" can either be a river bank or a
financial institution

Pragmatic ambiguity - No clarity as to which object a


pronoun refers to (referential ambiguity)
E.g: John walks with Jim and he is wearing a
blue shirt

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

Applications in NLP
It is very difficult domain in which to evaluate and develop
representation and reasoning theories.
The field of computational linguistics has wealth of
techniques and knowledge.

Have a quick search of NLP applications


available in current market. Define the
purpose of development. Submit your
answer at the end of lecture.

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

Q&A

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

Next Topic
Introduction to Robotics

Robots classification
Types of robots
Human perception vs robot perception
Robots hardware
Anatomy of robots arm
Implications : Technical

CE00371-1: Introduction to Software Development

CT002-3.5-2 AI-Methods

Problem Solving using programmed solutions

You might also like