CCSB354 ARTIFICIAL INTELLIGENCE (AI)

Slides:



Advertisements
Similar presentations
Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.
Advertisements

Natural Language Understanding Difficulties: Large amount of human knowledge assumed – Context is key. Language is pattern-based. Patterns can restrict.
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
Grammars, constituency and order A grammar describes the legal strings of a language in terms of constituency and order. For example, a grammar for a fragment.
Grammars, Languages and Parse Trees. Language Let V be an alphabet or vocabulary V* is set of all strings over V A language L is a subset of V*, i.e.,
COGN1001: Introduction to Cognitive Science Topics in Computer Science Formal Languages and Models of Computation Qiang HUO Department of Computer.
Grammars.
Chapter Chapter Summary Languages and Grammars Finite-State Machines with Output Finite-State Machines with No Output Language Recognition Turing.
For Monday Read Chapter 23, sections 3-4 Homework –Chapter 23, exercises 1, 6, 14, 19 –Do them in order. Do NOT read ahead.
Understanding Natural Language
NLP and Speech Course Review. Morphological Analyzer Lexicon Part-of-Speech (POS) Tagging Grammar Rules Parser thethe – determiner Det NP → Det.
1 Chapter 20 Understanding Language. 2 Chapter 20 Contents (1) l Natural Language Processing l Morphologic Analysis l BNF l Rewrite Rules l Regular Languages.
Natural Language Processing AI - Weeks 19 & 20 Natural Language Processing Lee McCluskey, room 2/07
1 Understanding Natural Language The Natural Language Understanding Problem 14.1Deconstructing Language: A Symbolic Analysis 14.2Syntax 14.3Syntax.
1 CONTEXT-FREE GRAMMARS. NLE 2 Syntactic analysis (Parsing) S NPVP ATNNSVBD NP AT NNthechildrenate thecake.
Artificial Intelligence 2004 Natural Language Processing - Syntax and Parsing - Language Syntax Parsing.
Chapter 3: Formal Translation Models
Context-Free Grammar CSCI-GA.2590 – Lecture 3 Ralph Grishman NYU.
Models of Generative Grammar Smriti Singh. Generative Grammar  A Generative Grammar is a set of formal rules that can generate an infinite set of sentences.
The syntax of language How do we form sentences? Processing syntax. Language and the brain.
March 1, 2009 Dr. Muhammed Al-Mulhem 1 ICS 482 Natural Language Processing INTRODUCTION Muhammed Al-Mulhem March 1, 2009.
11 CS 388: Natural Language Processing: Syntactic Parsing Raymond J. Mooney University of Texas at Austin.
Lecture 1, 7/21/2005Natural Language Processing1 CS60057 Speech &Natural Language Processing Autumn 2005 Lecture 1 21 July 2005.
Context Free Grammars Reading: Chap 12-13, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Paul Tarau, based on Rada.
9/8/20151 Natural Language Processing Lecture Notes 1.
Grammars.
ICS611 Introduction to Compilers Set 1. What is a Compiler? A compiler is software (a program) that translates a high-level programming language to machine.
Lecture 12: 22/6/1435 Natural language processing Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
1 CS 385 Fall 2006 Chapter 14 Understanding Natural Language (omit 14.4)
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
Chapter 10: Compilers and Language Translation Invitation to Computer Science, Java Version, Third Edition.
Chapter 15 Natural Language Processing (cont)
Understanding Natural Language
10. Parsing with Context-free Grammars -Speech and Language Processing- 발표자 : 정영임 발표일 :
May 2006CLINT-LN Parsing1 Computational Linguistics Introduction Parsing with Context Free Grammars.
1 Syntax In Text: Chapter 3. 2 Chapter 3: Syntax and Semantics Outline Syntax: Recognizer vs. generator BNF EBNF.
Context Free Grammars Reading: Chap 9, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Rada Mihalcea.
11 Chapter 14 Part 1 Statistical Parsing Based on slides by Ray Mooney.
Parsing Introduction Syntactic Analysis I. Parsing Introduction 2 The Role of the Parser The Syntactic Analyzer, or Parser, is the heart of the front.
For Wednesday Read chapter 23 Homework: –Chapter 22, exercises 1,4, 7, and 14.
October 2005CSA3180 NLP1 CSA3180 Natural Language Processing Introduction and Course Overview.
Artificial Intelligence: Natural Language
The man bites the dog man bites the dog bites the dog the dog dog Parse Tree NP A N the man bites the dog V N NP S VP A 1. Sentence  noun-phrase verb-phrase.
CSA2050 Introduction to Computational Linguistics Parsing I.
1 Context Free Grammars October Syntactic Grammaticality Doesn’t depend on Having heard the sentence before The sentence being true –I saw a unicorn.
The Functions and Purposes of Translators Syntax (& Semantic) Analysis.
CSE573 Autumn /23/98 Natural Language Processing Administrative –PS3 due today –PS4 out Wednesday, due Friday 3/13 (last day of class) special.
Natural Language Processing Chapter 1 : Introduction.
Natural Language Processing Chapter 2 : Morphology.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 2.
Parsing and Code Generation Set 24. Parser Construction Most of the work involved in constructing a parser is carried out automatically by a program,
CSC312 Automata Theory Lecture # 26 Chapter # 12 by Cohen Context Free Grammars.
GRAMMARS & PARSING. Parser Construction Most of the work involved in constructing a parser is carried out automatically by a program, referred to as a.
Natural Language Processing (NLP)
NATURAL LANGUAGE PROCESSING
Composing Music with Grammars. grammar the whole system and structure of a language or of languages in general, usually taken as consisting of syntax.
Formal grammars A formal grammar is a system for defining the syntax of a language by specifying sequences of symbols or sentences that are considered.
By Kyle McCardle.  Issues with Natural Language  Basic Components  Syntax  The Earley Parser  Transition Network Parsers  Augmented Transition Networks.
10/31/00 1 Introduction to Cognitive Science Linguistics Component Topic: Formal Grammars: Generating and Parsing Lecturer: Dr Bodomo.
Context Free Grammars. Slide 1 Syntax Syntax = rules describing how words can connect to each other * that and after year last I saw you yesterday colorless.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesAlgebraic.
Natural Language Processing Vasile Rus
Programming Languages Translator
Basic Parsing with Context Free Grammars Chapter 13
CS : Speech, NLP and the Web/Topics in AI
Natural Language - General
Natural Language Processing
Artificial Intelligence 2004 Speech & Natural Language Processing
Presentation transcript:

CCSB354 ARTIFICIAL INTELLIGENCE (AI) CHAPTER 12 NATURAL LANGUAGE PROCESSING (NLP) Textbook (Chapter 13, & especially pages 558 & 588) Instructor: Alicia Tang Y. C.

Language is a complicated phenomenon, involving processes as varied as the recognition of sounds or printed letters, syntactic parsing, high-level semantic inferences,etc.

What is Natural Language Processing (NLP)? Natural language gives computer users the ability to communication with the computer in their native language. This technology allows for conversational type of interface. A general NLP system is not yet possible, especially in recognising and interpreting written sentences.

Types Natural Language Understanding: Investigate methods of allowing the computer to comprehend instructions given in ordinary English. Natural Language Generation: Strives to have computers produce ordinary English language so that people can understand computers easily.

NLP Software Tools  INTELLECT  SPOCK  BBN Parlane  NaturalLink

 Parser  Lexicon  Understander  Knowledge base  Generator Component of NLP  Parser  Lexicon  Understander  Knowledge base  Generator

Stages in Producing an Internal Representation of a Sentence

love kiss ?? lips jungle object agent object Contextual Knowledge Interpretation Expanded representation: possess pet:cheetah experiencer object love Person: tarzan Person:jane agent kiss object instrument lips location jungle location ??

Block Diagram of a Natural Language Understanding Program of the Syntactic-Semantic Analysis Type Input text String Parser Understander Generator Output Lexicon Knowledge base

Block Diagram of a Computer Language Translation System Generalised Intermediate Form (GIF) Rule-based Processor Input Program Parser Rule-based Processor Lexicon Output Program in Target Language

NLP Database Expert Systems: where do they stand?

EASE OF COMMUNICATION WITH DIFFERENT TYPES OF INTEGRATED SYSTEMS Oh no! Well..not bad! Oh yeah!! EASE OF COMMUNICATION WITH DIFFERENT TYPES OF INTEGRATED SYSTEMS

Levels of analysis for natural language Prosody it deals with the rhythm and intonation of language Phonology it examines the sounds that are combined to form language. Morphology it concerns with the components that make up words. E.g. the effect of prefixes (non-, un-) and suffixes (-ing, -ly)

Levels of analysis for natural language Syntax this involves the study of the rule for combining words to form legal sentences Semantics it considers the meaning of words, phrases and sentences Pragmatics this is the study of the ways in which language is used and its effects on the listener World Knowledge this includes knowledge of the ‘physical’ world, the world of our social interaction

Syntax Specification and parsing using Context-free Grammars 1. Sentence  noun-phrase verb-phrase 2. Noun-phrase  noun 3. Noun-phrase  article noun 4. Verb-phrase  verb 5. Verb-phrase  verb noun-phrase 6. Article  a 7. Article  the 8. Noun  man 9. Noun  dog 10. Verb  likes 11. Verb  bites Specification and parsing using Context-free Grammars the rules listed below define a GRAMMAR for simple transitive sentences

Syntax Rules 6. to 11. are terminals 1. Sentence  noun-phrase verb-phrase 2. Noun-phrase  noun 3. Noun-phrase  article noun 4. Verb-phrase  verb 5. Verb-phrase  verb noun-phrase 6. Article  a 7. Article  the 8. Noun  man 9. Noun  dog 10. Verb  likes 11. Verb  bites Rules 6. to 11. are terminals they define a lexicon for the language terms that describe high level linguistic are called nonterminals (sentence, verb, noun-phrase, etc)

Syntax A derivation of the sentence “the man bites the dog” (syntactically correct but semantically wrong, we shall see it later on) String Apply Rule No. sentence 1 noun-phrase verb-phrase 3 article noun verb-phrase 7 the noun verb-phrase 8 the man verb-phrase 5 the man verb noun-phrase 11 the man bites noun-phrase 3 the man bites article noun 7 the man bites the noun 9 the man bites the dog done Parsing algorithms fall into two classes: 1. Bottom-up 2. Top-down

Draw a parse tree for the sentence “the man bites the dog”

Top-down Parsing Parse Tree S Unrecognised I/P the man bites the dog VP A N the man V bites the dog

Bottom-Up Parsing Parse Tree the Unrecognised I/P the man bites the dog man bites the dog bites the dog the dog dog A man N NP bites V the A dog N NP VP S

Transition Network Parsers A transition network parser represents grammars as a set of finite-state machines (i.e. transition networks), like this: Noun-phrase Verb-phrase S S initial final Example: sentence (S)

Transition Network Parsers Example: Noun-phrase Noun Article S S initial final Noun Example: Article Read page 563, text a S S initial final the

The Chomsky Hierarchy and Context-Sensitive Grammars A context free grammar allows rule to have a single nonterminal on their left-hand side. Context-free grammar is not powerful enough to represent rules of natural language syntax the context-sensitive languages form a proper superset of the context-free counterpart

The Chomsky Hierarchy and Context-Sensitive Grammars Here, one or more symbols on the left-hand side of a rule are allowed that makes it possible to define a context in which that rule can be applied. This ensures satisfaction of a global constraints such as number agreement and other semantic checks. The semantic error in earlier example could be detected in context-sensitive grammar if a non- terminal, act_of_biting is added to the grammar, preventing the sentence “man bites dog” to be valid.

The Chomsky Hierarchy To correctly express grammatical structure of a language (e.g. English), rules are needed. We can classify grammars according to the kinds of rules that appear in it. Having done that, we can classify the language into families according to the kinds of rules that are needed to express its grammars. One such means of classifying grammars in this manner is called Chomsky Hierarchy

Grammar Hierarchy The Grammars for the language Type 0 Type 1 Type 2

Grammar Hierarchy Type 0 Name of Grammar: Transformation Grammar Form of Rules: anything  anything Computational Power: General Turing Machine String Characteristics: Any form

Grammar Hierarchy Type 1 Crossing dependencies E.g. Ali1 helps4 Ahmad2 Name of Grammar: Context-sensitive Form of Rules: A B C  A D C Computational Power: Linear Bound Automata String Characteristics: an bn cn Crossing dependencies E.g. Ali1 helps4 Ahmad2 to teach5 Aida3 programming6. a1 a2 a3 b3 b2 b3

E.g. Ali1 who studies in UNITEN2 that offers2 quality programmes Type 2 Name of Grammar: Context-free Form of Rules: A  B C D …. Computational Power: Push Down Stack Automata String Characteristics: an bn 2 2 2 1 1 1 1 1 1 Nested dependencies E.g. Ali1 who studies in UNITEN2 that offers2 quality programmes is1 graduating a1 a2 a3 b3 b2 b1

They have been used for grammars of Morphology Type 3 Name of Grammar: Right Linear Form of Rules: A  x B (x in terminal category) Computational Power: Finite State Automata String Characteristics: a* b* They have been used for grammars of Morphology

NATURAL LANGUAGE PROCESSING Problems with NLP : Ambiguity multiple word meanings the pitcher is angry the pitcher is empty Inaccuracy Incompleteness

How people overcome natural language problems? Imprecision I’ve been waiting for you for a long time. The king ruled the kingdom for a long time. Unclear antecedents Ben hits Bill because the sympathized with mary. How people overcome natural language problems? Context Familiarity Expectations

SPEECH RECOGNITION Advantages: Context Analysing Speech most natural method ease of access speed manual freedom remote access Context Isolated Word Recognition (IWR) Connected Word Recognition (CWR) Continuous Speech Recognition (CSR) Analysing Speech Syllable Phonemes Allophones

Speech Component: A Holistic Look I/O Processing Other data Speech recognition Match with other sound frequencies Freq. spectrum She likes ice-cream Word Sentence Syntactic Analysis Grammar of language (dictionary) Semantic Analysis Meaning of each word (thesaurus) She like ice-cream Sentence Structure x. Likes(x,ice-cream) Partial Meaning Pragmatics Context of utterance likes(siti, ice-cream). Full Sentence Meaning

Exercises:

Question: Consider the grammar defined by the following BNF: S  NP VP NP  <name> | <det> <noun> |PP VP  <verb> | <verb> NP NP | <verb> NP PP | VP NP PP  <prep> NP <name>  “Ben" | “Ann" <noun>  "morning" | “ice-cream" <verb>  "gave" | "saw" <det>  "the" <prep>  "to" | "in" S – SENTENCE NP – NOUN PHRASE VP – VERB PHRASE DET – DETERMINER PP - PREPOSITION

Answers: a) Ben gave Ann the ice-cream. Draw parse trees in this grammar for the following sentences. a) Ben gave Ann the ice-cream. b)   Ann gave the ice-cream to Ben. S  NP VP NP  <name> | <det> <noun> |PP VP  <verb> | <verb> NP NP | <verb> NP PP | VP NP PP  <prep> NP <name>  “Ben" | “Ann" <noun>  "morning" | “ice-cream" <verb>  "gave" | "saw" <det>  "the" <prep>  "to" | "in" Answers: