Natural Language Processing AI - Weeks 19 Natural Language Processing PART 2 Lee McCluskey, room 2/07

Slides:



Advertisements
Similar presentations
Prolog programming....Dr.Yasser Nada. Chapter 8 Parsing in Prolog Taif University Fall 2010 Dr. Yasser Ahmed nada prolog programming....Dr.Yasser Nada.
Advertisements

Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.
Intro to NLP - J. Eisner1 Modeling Grammaticality [mostly a blackboard lecture]
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Prolog COMP 112 #
1 Grammars and Parsing Allen ’ s Chapters 3, Jurafski & Martin ’ s Chapters 8-9.
Statistical NLP: Lecture 3
DEFINITE CLAUSE GRAMMARS Ivan Bratko University of Ljubljana Faculty of Computer and Information Sc.
01/11/04 AIPP Lecture 11: Parsing and Semantics in DCGs1 Parsing and Semantics in DCGs Artificial Intelligence Programming in Prolog Lecturer: Tim Smith.
1 CS 385 Fall 2006 Chapter 14 Understanding Natural Language Problems.
Fall 2008Programming Development Techniques 1 Topic 9 Symbol Manipulation Generating English Sentences Section This is an additional example to symbolic.
LING NLP 1 Introduction to Computational Linguistics Martha Palmer April 19, 2006.
Natural Language Processing - Feature Structures - Feature Structures and Unification.
Understanding Natural Language
Parsing Using Logic Programing (well Prolog) Lee McCluskey, room 2/07
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.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
1 Understanding Natural Language The Natural Language Understanding Problem 14.1Deconstructing Language: A Symbolic Analysis 14.2Syntax 14.3Syntax.
Formal Aspects of Computer Science – Week 12 RECAP Lee McCluskey, room 2/07
Natural Language Processing AI - Weeks 19 Natural Language Processing PART 2 Lee McCluskey, room 2/07
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Using Definite Knowledge: NLP and nl_interface.pl Notes for Ch.3 of Poole et.
Constituency Tests Phrase Structure Rules
March 1, 2009 Dr. Muhammed Al-Mulhem 1 ICS 482 Natural Language Processing INTRODUCTION Muhammed Al-Mulhem March 1, 2009.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
Lecture 19 Methods of simulation of understanding of NL
Natural Language Processing Verbatim Text Coding and Data Mining Report Generation Josef S.W. Leung Ching-Long Yeh
Computing Science, University of Aberdeen1 CS4025: Grammars l Grammars for English l Features l Definite Clause Grammars See J&M Chapter 9 in 1 st ed,
Prolog and grammars Prolog’s execution strategy is useful for writing parsers for natural language (eg. English) and programming languages (interpreters.
Computer Science 112 Fundamentals of Programming II Recursive Processing of Languages.
CCSB354 ARTIFICIAL INTELLIGENCE (AI)
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.
LING 388: Language and Computers Sandiway Fong Lecture 17.
ITEC 380 Organization of programming languages Lecture 2 – Grammar / Language capabilities.
What is a Sentence? By Jaye Lynn Trapp.
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)
Natural Language Processing Lecture 6 : Revision.
Natural Language Processing AI - Weeks 18 & 20 Natural Language Processing Lee McCluskey, room 2/07
LING 388: Language and Computers Sandiway Fong Lecture 18.
Understanding Natural Language
Natural Language Processing 1.‘append’ program - two lists to one or split one list into two 2.How to write a parser in Prolog, how it works (ref. Paul’s.
Chapter 6 Programming Languages (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Parsing. Language A set of strings from an alphabet which may be empty, finite or infinite. A language is defined by a grammar and we may also say that.
Syntax Why is the structure of language (syntax) important? How do we represent syntax? What does an example grammar for English look like? What strategies.
Artificial Intelligence: Natural Language
Grammars Grammars can get quite complex, but are essential. Syntax: the form of the text that is valid Semantics: the meaning of the form – Sometimes semantics.
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.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
Artificial Intelligence 2004
Computing Science, University of Aberdeen1 CS4025: Grammars l Grammars for English l Features l Definite Clause Grammars See J&M Chapter 9 in 1 st ed,
◦ Process of describing the structure of phrases and sentences Chapter 8 - Phrases and sentences: grammar1.
Parsing and Code Generation Set 24. Parser Construction Most of the work involved in constructing a parser is carried out automatically by a program,
C H A P T E R T W O Linking Syntax And Semantics Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
Natural Language Processing AI Revision Lee McCluskey, room 2/07
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
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
Natural Language Processing (NLP)
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.
Natural Language Processing
Statistical NLP: Lecture 3
CS : Speech, NLP and the Web/Topics in AI
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
CKY Parser 0Book 1 the 2 flight 3 through 4 Houston5 11/16/2018
Linguistic Essentials
Natural Language Processing (NLP)
Artificial Intelligence 2004 Speech & Natural Language Processing
Presentation transcript:

Natural Language Processing AI - Weeks 19 Natural Language Processing PART 2 Lee McCluskey, room 2/07

Natural Language Processing NLP: the process Natural Language Generation Translation Summary/ Classification Knowledge Base: representation of meaning UNDERSTANDING PROCESS (“Natural Language Understanding”) Text (sentence, , news story..) -- Parsing -- Referencing -- Meaning Extraction and Integration

Natural Language Processing NLP: the process Knowledge Base: representation of meaning UNDERSTANDING PROCESS (“Natural Language Understanding”) Text “The cat sits on the mat” sentence npvp The cat sits on the mat Fact(type: statement, agent: cat-002, action: sits_on, object: mat-001) Fact(type: statement, agent: Fido, action: is_a, object: cat) Fact(type: statement, agent: Freda, action: loves, object: Fido)

Natural Language Processing Parsing sentence --> noun_phrase, verb_phrase. noun_phrase--> determiner, adjective, noun. noun_phrase--> adjective, noun. noun_phrase--> determiner, noun. verb_phrase--> verb, noun_phrase. verb_phrase--> verb, preposition, noun_phrase. determiner --> a. adjective --> fruit. noun --> flies | fruit | time | arrow. noun --> banana. verb --> like | flies. preposition --> like

Natural Language Processing Parsing sentence --> noun_phrase, verb_phrase. noun_phrase--> determiner, adjective, noun. noun_phrase--> adjective, noun. noun_phrase--> determiner, noun. verb_phrase--> verb, noun_phrase. verb_phrase--> verb, preposition, noun_phrase. determiner --> a. adjective --> fruit. noun --> flies. noun --> fruit. noun --> time. noun --> arrow. noun --> banana. verb --> like. verb --> flies. preposition --> like.

Natural Language Processing Parsing with Prolog Grammar Rules sentence --> noun_phrase, verb_phrase. noun_phrase--> determiner, adjective, noun. noun_phrase--> adjective, noun. noun_phrase--> determiner, noun. verb_phrase--> verb, noun_phrase. verb_phrase--> verb, preposition, noun_phrase. determiner --> [a]. adjective --> [fruit]. noun --> [flies]. noun --> [banana]. noun --> [fruit]. noun --> [time]. noun --> [arrow]. verb --> [like]. verb --> [flies]. preposition --> [like]. This Grammar can now be loaded into Prolog and ACTS LIKE A PARSER.

Natural Language Processing Prolog Grammar Rules sentence(A, B) :- noun_phrase(A, C), verb_phrase(C, B). noun_phrase(A, B) :- determiner(A, C), adjective(C, D), noun(D, B). noun_phrase(A, B) :- adjective(A, C), noun(C, B). noun_phrase(A, B) :- determiner(A, C), noun(C, B). verb_phrase(A, B) :- verb(A, C), noun_phrase(C, B). verb_phrase(A, B) :- verb(A, C), preposition(C, D), noun_phrase(D, B). determiner(A,B) :- A = [a|B]. adjective(A,B) :- A = [fruit| B]. noun(A,B) :- A = [flies|B]. noun(A,B) :-A = [banana|B]. noun(A,B) :-A= [fruit|B]. noun(A,B) :-A = [time|B]. noun(A,B) :-A = [arrow|B]. verb(A,B) :-A = [like|B]. verb(A,B) :-A = [flies|B]. preposition(A,B) :- A = [like|B]. This is the Prolog Code that the Grammar Translates to. The variables implement a kind of “stream processing”

Natural Language Processing Getting More From the Parsing Stage Other functions we might need.. - Return parse tree - Check consistency of gender - Checking consistency of number sentence(sentence( NP, VP)) --> noun_phrase(NP, No, Gender), verb_phrase(VP, No, Gender). -- build up parse tree as “self describing” term -- when a part of the sentence commits to number or gender, then record it for consistency

Natural Language Processing Parsing + Returning a Parse Tree /* syntax bit + No (-singular or plural) + Gender (-Masc, Fem or Inamin.)*/ s entence(sentence( NP, VP)) --> noun_phrase(NP, No, Gender), verb_phrase(VP, No, Gender). noun_phrase(noun_phrase([D,N]), No,Gender) --> d(D, No,Gender), n(N, No,Gender). verb_phrase(verb_phrase([V,N]), No,Gender) --> v(V, No,Gender), noun_phrase(N, _,_). /* no ref to no or gen of object*/ verb_phrase(verb_phrase([V]), No,Gender) --> v(V, No,Gender). d(determiner(the), No,Gender) --> [the]. d(determiner(a), singular,Gender) --> [a]. d(determiner(some), plural,Gender) --> [some]. d(determiner(all), plural,Gender) --> [all]. n(noun(apple), singular, inanimate) --> [apple]. n(noun(apples), plural, inanimate) --> [apples]. n(noun(man), singular, animate) --> [man]. n(noun(men), plural, animate) --> [men]. v(verb(eat), singular, animate) --> [eats]. v(verb(eats), plural, animate) --> [eat]. v(verb(sing), singular, animate) --> [sings]. v(verb(sings), plural, animate) --> [sing]. sentence(X,[the,man,eats,the,apples],Y). X = sentence( noun_phrase([determiner(the),noun(man)]), verb_phrase([verb(eat), noun_phrase([determiner(the),noun(apples)])])), Y = [] ?