lecture 3
DESCRIPTION
Aim lectures from Asia Pacific UniversityTRANSCRIPT
CT002-3-2 AI Methods
Natural Language Processing
CE00371-1: Introduction to Software Development Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
3 types of NLP
Stemming example :
Am, are, is – be
Cars, car’s 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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
Pragmatic
It could be problem to develop the robots e.g : speech recognition, translation system etc.
The study of speaker’s meaning, what speaker’s 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
3 types of NLP
CE00371-1: Introduction to Software Development Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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 syntactically correct, semantically correct
• Grass eats cows syntactically correct, semantically incorrect
Verb : buy – purchaseAdjective : big – largeAdverb : quickly - speedily
CE00371-1: Introduction to Software Development Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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
N V N
Wrong syntax:
Eat cows grass
CE00371-1: Introduction to Software Development Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
4 stages of NLPStage 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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
Parse trees
• To ensure that the structure is correct.
Sentence
Noun_phrase verb_phrase
Proper_noun Verb Noun_phrase
"Cows" " eat" "grass"
CE00371-1: Introduction to Software Development Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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.
Quick Review Question
CE00371-1: Introduction to Software Development Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
Exercises
• Which one of the following statement is CORRECT for syntactic, semantic and pragmatic :
1. They fight and injured. Stephen doesn’t know it was his fault.
2. One bowl is in red color and another is in blue. You take the bowl.
3. You know his car?
4. Just run is not the solution.
5. Goat has four legs. Clearly goat is an animal and carnivore.
6. 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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
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 Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
Q & A
CE00371-1: Introduction to Software Development Problem Solving using programmed solutionsCT002-3.5-2 AI-Methods
Next Topic
Introduction to Robotics• Robots classification• Types of robots• Human perception vs robot perception• Robot’s hardware• Anatomy of robot’s arm• Implications : Technical