NATURAL LANGUAGE PROCESSING

Slides:



Advertisements
Similar presentations
CS Morphological Parsing CS Parsing Taking a surface input and analyzing its components and underlying structure Morphological parsing:
Advertisements

C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
Translator Architecture Code Generator ParserTokenizer string of characters (source code) string of tokens abstract program string of integers (object.
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.
May 2006CLINT-LN Parsing1 Computational Linguistics Introduction Approaches to Parsing.
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.,
Statistical NLP: Lecture 3
Fall 2008Programming Development Techniques 1 Topic 9 Symbol Manipulation Generating English Sentences Section This is an additional example to symbolic.
Grammars.
Chapter Chapter Summary Languages and Grammars Finite-State Machines with Output Finite-State Machines with No Output Language Recognition Turing.
GRAMMAR & PARSING (Syntactic Analysis) NLP- WEEK 4.
For Monday Read Chapter 23, sections 3-4 Homework –Chapter 23, exercises 1, 6, 14, 19 –Do them in order. Do NOT read ahead.
Chapter 20: Natural Language Generation Presented by: Anastasia Gorbunova LING538: Computational Linguistics, Fall 2006 Speech and Language Processing.
1 Words and the Lexicon September 10th 2009 Lecture #3.
NLP and Speech Course Review. Morphological Analyzer Lexicon Part-of-Speech (POS) Tagging Grammar Rules Parser thethe – determiner Det NP → Det.
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
COP4020 Programming Languages
Context-Free Grammar CSCI-GA.2590 – Lecture 3 Ralph Grishman NYU.
1 Basic Parsing with Context Free Grammars Chapter 13 September/October 2012 Lecture 6.
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.
Grammars.
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.
Lecture 12: 22/6/1435 Natural language processing Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
Languages A Language L over a finite alphabet  is a set of strings of characters from the alphabet. Examples are : 1.L = { s | s is a grammatical English.
Natural Language Processing Lecture 6 : Revision.
Intro to Lexing & Parsing CS 153. Two pieces conceptually: – Recognizing syntactically valid phrases. – Extracting semantic content from the syntax. E.g.,
SYNTAX Lecture -1 SMRITI SINGH.
Languages A Language L over a finite alphabet  is a set of strings of characters from the alphabet. Examples are : 1.L = { s | s is a grammatical English.
Chapter 15 Natural Language Processing (cont)
Introduction to CL & NLP CMSC April 1, 2003.
May 2006CLINT-LN Parsing1 Computational Linguistics Introduction Parsing with Context Free Grammars.
October 2005csa3180: Parsing Algorithms 11 CSA350: NLP Algorithms Sentence Parsing I The Parsing Problem Parsing as Search Top Down/Bottom Up Parsing Strategies.
Copyright © Curt Hill Languages and Grammars This is not English Class. But there is a resemblance.
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.
Linguistic Essentials
CPE 480 Natural Language Processing Lecture 4: Syntax Adapted from Owen Rambow’s slides for CSc Fall 2006.
Daisy Arias Math 382/Lab November 16, 2010 Fall 2010.
Artificial Intelligence: Natural Language
Chart Parsing and Augmenting Grammars CSE-391: Artificial Intelligence University of Pennsylvania Matt Huenerfauth March 2005.
Natural Language - General
1 Context Free Grammars October Syntactic Grammaticality Doesn’t depend on Having heard the sentence before The sentence being true –I saw a unicorn.
CSE573 Autumn /23/98 Natural Language Processing Administrative –PS3 due today –PS4 out Wednesday, due Friday 3/13 (last day of class) special.
csa3050: Parsing Algorithms 11 CSA350: NLP Algorithms Parsing Algorithms 1 Top Down Bottom-Up Left Corner.
For Friday Finish chapter 23 Homework –Chapter 23, exercise 15.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
CPSC 422, Lecture 27Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 27 Nov, 16, 2015.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 2.
Syntax Analyzer (Parser)
Parsing and Code Generation Set 24. Parser Construction Most of the work involved in constructing a parser is carried out automatically by a program,
GRAMMARS & PARSING. Parser Construction Most of the work involved in constructing a parser is carried out automatically by a program, referred to as a.
1 Topic #4: Syntactic Analysis (Parsing) CSC 338 – Compiler Design and implementation Dr. Mohamed Ben Othman ( )
Syntax Analysis By Noor Dhia Syntax analysis:- Syntax analysis or parsing is the most important phase of a compiler. The syntax analyzer considers.
10/31/00 1 Introduction to Cognitive Science Linguistics Component Topic: Formal Grammars: Generating and Parsing Lecturer: Dr Bodomo.
System Software Unit-1 (Language Processors) A TOY Compiler
Statistical NLP: Lecture 3
Basic Parsing with Context Free Grammars Chapter 13
Syntax Analysis Chapter 4.
Natural Language Processing (NLP)
Natural Language - General
Natural Language Processing
Linguistic Essentials
Artificial Intelligence 2004 Speech & Natural Language Processing
Faculty of Computer Science and Information System
Presentation transcript:

NATURAL LANGUAGE PROCESSING Text Book: Artificial Intelligence by Luger, 4th edition, Pearson Education Reference Material: Artificial Intelligence by Elaine Rich and Kevin Knight, 2nd edition, TATA McGraw Hill Education. SOHAIL SHAHZAD ROLL NO: 15134 GCU FAISALABAD

What is Natural Language Refers to the language spoken and understand by people, e.g. English, Urdu, as opposed to artificial languages, like C++, Java etc.

What is Natural Language Processing Natural Language Processing NLP refers to AI method of communicating with an intelligent systems using everyday natural language such as English. NLP is related to human computer interaction. NLP encompasses anything a computer needs to understand natural language and also generate natural language. NLP is a subfield of artificial intelligence. The input and output of an NLP system can be- (i) Speech (II) Written Text

Components Of NLP There are two components of NLP Natural Language Understanding NLU Natural Language Generation NLG

Natural Language Understanding NLU There are two task. Mapping the given input in natural language into useful representation. Analyzing different aspects of the language

Natural Language Generation NLG It is the process of producing meaningful phrases and sentences in the form of natural language form some internal representation. It involves. Text Planning: It includes retrieving the relevant content from knowledge base. Sentence Planning: It includes choosing required words, forming meaningful phrases, setting tome of the sentence. Text Realization: It is mapping sentence plan into sentence structure.

Difficulties in NLU It is very ambiguous. There can be different levels of ambiguity. Lexical Ambiguity: It is at very primitive level such as word level. For example, treating the word “board” as noun or verb. Syntax Level Ambiguity: A sentence can be parsed in different ways. For example, “He lifted the beetle with red cap” or “Did he use cap to lift the beetle”.

Difficulties in NLU 3) Referential Ambiguity: Referring to something using pronouns. For example, Ali went to Hussain. He said, “I am tired.” Exactly who is tired.

Step’s in NLU There are general five steps Lexical Analysis: It involves identifying and analyzing the structure of words. Lexicon of a language means the collection of words and phrases in a language. Lexical analysis is dividing the whole chunk of txt into paragraphs, sentences and words.

Difficulties in NLU Syntactic Analysis: It involves analysis of words in the sentence for grammar and arranging words in a manner that shows the relationship among the words. The sentence such as The school goes to boy” is rejected by English syntactic analyzer. Semantic Analysis: It draws the exact meaning or the dictionary meaning from the text. The semantic analyzer disregards sentence such as “ hot ice-cream”.

Difficulties in NLU 4) Discourse Integration: The meaning of any sentence depends upon the meaning of the sentence just before it. In addition, it also brings about the meaning of immediately succeeding sentence. 5) Pragmatic Analysis: During this, what was said is re-interpreted on what it actually meant. It involves deriving those aspects of language which require real world knowledge.

Implementation Aspects Of Syntactic Analysis There are a number of algorithms researchers have developed for syntactic analysis, bit we consider only the following simple methods. Context Free Grammar Top Down Parser

Implementation Aspects Of Syntactic Analysis Context Free Grammar It is the grammar that consists rules with a single symbol on the left hand side of the rewrite rules. Let us create grammar to parse a sentence “The bird pecks the grains”. Articles DET − a | an | the Nouns − bird | birds | grain | grains Noun Phrase NP − Article + Noun | Article + Adjective + Noun= DET N | DET ADJ N Verbs − pecks | pecking | pecked Verb Phrase VP − NP V | V NP Adjectives ADJ − beautiful | small | chirping

Implementation Aspects Of Syntactic Analysis The parse tree breaks down the sentence into structured parts so that the computer can easily understand and process it. In order for the parsing algorithm to construct this parse tree, a set of rewrite rules, which describe what tree structures are legal, need to be constructed. These rules say that a certain symbol may be expanded in the tree by a sequence of other symbols. According to first order logic rule, ff there are two strings Noun Phrase NP and Verb Phrase VP, then the string combined by NP followed by VP is a sentence. The rewrite rules for the sentence are as follows

Implementation Aspects Of Syntactic Analysis S → NP VP NP → DET N | DET ADJ N VP → V NP Lexocon − DET → a | the ADJ → beautiful | perching N → bird | birds | grain | grains V → peck | pecks | pecking The parse tree can be created as shown

Implementation Aspects Of Syntactic Analysis

Implementation Aspects Of Syntactic Analysis Now consider the above rewrite rules. Since V can be replaced by both, "peck" or "pecks", sentences such as "The bird peck the grains" with wrong subject-verb agreement are also permitted.

Top Down Parser Here, the parser starts with the S symbol and attempts to rewrite it into a sequence of terminal symbols that matches the classes of the words in the input sentence until it consists entirely of terminal symbols. These are then checked with the input sentence to see if it matched. If not, the process is started over again with a different set of rules. This is repeated until a specific rule is found which describes the structure of the sentence.