Inteligenta Artificiala

Slides:



Advertisements
Similar presentations
Language and Grammar Unit
Advertisements

THE PARTS OF SPEECH: PREPOSITIONS, INTERJECTIONS
Grammar Spinner Touch any part of the screen to begin. (Or click your mouse) Touch the screen again each time you want to spin.
Identifying Parts of Speech & their Functions Nouns, Pronouns, Verbs, Prepositions, Adjectives, & Adverbs; Subjects & Objects.
1 Inteligenta Artificiala Universitatea Politehnica Bucuresti Anul universitar Adina Magda Florea
Identifying Prepositional Phrases
PARTS OF SPEECH A SENTENCE REQUIRES ONLY TWO THINGS:
Analysing Syntax 1 Lesson 8B.
Used in place of a noun pronoun.
Noun. Noun - verb noun Noun - verb article- adj. - adj. - Noun - verb.
PRONOUNS LESSON 1. WHAT IS A PRONOUN? Pronouns take the place of nouns to name persons, places, things, or ideas.
Sentences Pasco-Hernando Community College Tutorial Series.
Morphology and Syntax Practice 1 Lesson 9A The top of the tree So the tree for any sentence (S) should start like this: This means that every sentence.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 2.
Present Perfect Continuous prezentare. schema Afirmativ: S + have/has + been + V-ing… Negativ: S + have/has + not + been + V-ing… Interogativ: have/has.
Parts of Speech English Language Arts.
Grammar Rules. Pronouns 1.Use as a S, DO, PN, or IO 2.Personal pronouns may be adjectives 3.Relative pronouns may introduce adjective clauses.
Infinitive Phrases Advanced Composition. Infinitives A verbal that functions as a noun, an adjective, or an adverb. An infinitive usually begins with.
Daily Grammar Practice
Communication and Language Chap. 22. Outline Communication Grammar Syntactic analysis Problems.
Rules for Longhorn Jeopardy Points to be taken away for wrong answers Make sure you state your answer in a question. Pay attention to all of the questions.
Inteligenta Artificiala
Parts of Speech Nouns Adverbs Pronouns Conjunctions Verbs Prepositions
1 Inteligenta Artificiala Universitatea Politehnica Bucuresti Anul universitar Adina Magda Florea
Overview Project Goals –Represent a sentence in a parse tree –Use parses in tree to search another tree containing ontology of project management deliverables.
IVAN CAPP The 8 Parts of Speech.
Pronouns.   Common Noun  Person, place, or thing  Proper noun  The specific name of a person or place  Article  Identifies a noun as a noun  Definite:
Grammar Review Name___________ Title____________ Author _________ Parts of Speech COPY A SENTENCE FROM YOUR BOOK. Label the parts of speech of each word.
Geschke--English IV Grammar Unit--Prepositional Phrases Prepositional Phrases.
NLP. Introduction to NLP Is language more than just a “bag of words”? Grammatical rules apply to categories and groups of words, not individual words.
Natural Language Sections What the Speaker Speaks §Intention l S wants H to believe P §Generation l S chooses the words, W to convey the.
By: Hannah Gettings.  Definition of pronoun: a word used in place of a noun.  Example: She gave him the book. *say for example the names of the people.
_____________________ Definition Part of Speech (circle one) Picture Antonym (Opposite) Vocab Word Noun Pronoun Adjective Adverb Conjunction Verb Interjection.
6 TH GRADE LANGUAGE EXAM REVIEW PARTS OF SPEECH.
Agents That Communicate Chris Bourne Chris Christen Bryan Hryciw.
The Parts of Speech The 8 Parts of Speech… Nouns Adjectives Pronouns Verbs Adverbs Conjunctions Prepositions Interjections.
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.
Deep structure (semantic) Structure of language Surface structure (grammatical, lexical, phonological) Semantic units have all meaning components such.
Parts of Speech Review. A Noun is a person, place, thing, or idea.
GoBack definitions Level 1 Parts of Speech GoBack is a memorization game; the teacher asks students definitions, and when someone misses one, you go back.
The Building Blocks of Sentences. The 8 Parts of Speech 1.Noun -is the name of a person, place, thing, or idea. Example: John is Tall The name John is.
◦ Process of describing the structure of phrases and sentences Chapter 8 - Phrases and sentences: grammar1.
PARTS OF SPEECH ANSWER: QUESTION: HOW MANY PARTS OF SPEECH ARE IN THE ENGLISH LANGUAGE? A.4 B.6 C.8.
Definitions Adjectives or Adverbs Conjunctions or Interjections Nouns or Prepositions Pronouns or Verbs
The Parts of Speech nouns verbs adjectives adverbs prepositions interjections conjunctions pronouns.
LANGUAGE ARTS PARTS OF SPEECH. NOUNS NOUN A noun is a word used to describe a  Person  Place  Animal  Thing.
Sentence Structure By: Amanda Garrett Bailey. What is the function of: Nouns Pronouns Verbs Adjectives Adverbs.
Parts of Speech By: Miaya Nischelle Sample. NOUN A noun is a person place or thing.
Grammar The “4 – Level” Analysis. The 4 - Levels Jack ate a delicious sandwich. Level 1 – parts of speech Level 2 – parts of a sentence Level 3 – phrases.
Parts of Speech, Subjects, Verbs, and Complements Review for Exam.
LINGUA INGLESE 1 modulo B Introduction to English Linguistics prof. Hugo Bowles Lesson 7 Syntax.
Parts of Speech Review.
Parts of Speech How Words Function.
The Parts of Speech Manzoor Ahmad Khattak.
English 12 Mrs. Fountain Week 2 Warm-Ups.
Past Continuous prezentare.
IF Clause prezentare.
NOUNS person, place, thing, or idea
Grammar Review.
Inteligenta Artificiala
Past Perfect Simple prezentare.
Past Perfect Continuous
Introduction to Word Classes
Parts of Speech How Words Function.
Parts of Speech Review.
Daily Grammar Practice
PREPOSITIONAL PHRASES
Week 3 Warm-Ups English 12 Mrs. Fountain.
Week 9 Warm-Ups English 12 Mrs. Fountain.
Parts of Speech II.
Presentation transcript:

Inteligenta Artificiala Universitatea Politehnica Bucuresti Anul universitar 2008-2009 Adina Florea http://turing.cs.pub.ro/ia_08 si curs.cs.pub.ro

Curs nr. 13 Prelucrarea limbajului natural 2

Comunicare Definitie: schimbul intentional de informatie generat de producerea si perceperea semnelor dintr-un sistem partajat de semne conventionale Componentele comunicarii Intentie: decide Emitator Generare: formeaza Sinteza: produce Perceptie: percepe (P1 ..Pn) Receptor Analiza: lexic, sintactic, semantic, pragmatic eliminare ambiguitate: alege Pi Incorporare: convingere Pi Limbaj de reprezentare intern Limbaj de comunicare

Acte de comunicare Un act de comunicare: Categorii ilocutionale J. Austin - How to do things with words, 1962, J. Searle - Speech acts, 1969 Un act de comunicare: locutie = fraza spusa de locutor illocutie = intelesul dorit spre a fi comunicat de locutor (performativa) prelocutie = actiunea care rezulta din locutie Maria i-a spus lui Gigel: "Te rog inchide usa" locutie illocutie prelocutie: usa inchisa Categorii ilocutionale Asertive Directive Comisive (angajamente) Permisive (permit) Prohibitive (interzic) Declarative Expresive

Definire limbaj Lexicon Analiza lexicala Gramatici Analiza (pars oratoris) Terminale, neterminale, reguli de rescriere Simbol de inceput LHS  RHS Analza semantica Analiza pragmatica

Lexicon Noun  breeze | wumpus | ball Verb  is | see | smell | hit Adjective  right | left | smelly … Adverb  here | there | ahead … Pronoun  me | you | I | it RelPronoun  that | who Name  John | Mary Article  the | a | an Preposition  to | in | on Conjunction  and | or | but

Gramatica Neterminale – diferite categorii din propozitie sentence S noun phrase NP verb phrase VP prepositional phrase PP relative clause RelClause

Exemplu S  NP VP | S Conjunction S NP  Pronoun | Noun | Article Noun | NP PP | NP RelClause VP  Verb | VP NP | VP Adjective | VP PP | VP Adverb PP  Preposition NP RelClause  RelPronoun VP

Analiza sintactica top-down parsing bottom-up parsing

Top-Down Parsing "John hit the ball" 1. S 2. S  NP, VP 3 Top-Down Parsing "John hit the ball" 1. S 2. S  NP, VP 3. S  Noun, VP 4. S  John, Verb, NP 5. S  John, hit, NP 6. S  John, hit, Article, Noun 7. S  John, hit, the, Noun 8. S  John, hit, the, ball

Bottom-Up Parsing. 1. John, hit, the, ball 2. Noun, hit, the, ball 3 Bottom-Up Parsing 1. John, hit, the, ball 2. Noun, hit, the, ball 3. Noun, Verb, the, ball 4. Noun, Verb, Article, ball 5. Noun, Verb, Article, Noun 6. NP, Verb, Article, Noun 7. NP, Verb, NP 8. NP, VP 9. S

Definite Clause Grammar (DCG) Gramatici BNF - probleme Utilizare LP – clauze Horn definite Gramatici cu clauze definite (DCG) Fiecare regula din gramatica poate fi vazuta ca o regula din DCG Fiecare categorie sintactica se reprezinta printr-un predicat cu un argument sir

Definite Clause Grammar (DCG) NP(s) este adevarat daca s este NP S  NP VP devine NP(s1)  VP(s2)  S(append(s1,s2)) Analiza (parsing) = inferenta logica Bottom-up parsing – foreward chaining Top-down parsing – backward chaining Aceeasi gramatica utilizata atat pentru analiza cat si pentru generare

Reguli de corespondenta In BNF S  NP VP In LP / DGC NP(s1)  VP(s2)  S(append(s1, s2)) In BNF NP  Pronoun | Noun In LP / DGC Pronoun(s)  Noun(s)  NP(s) BNF Noun  ball | book In LP / DGC (s = “ball”  s = “book”)  Noun(s) Reguli de corespondenta

BNF, DCG, Prolog BNF FOPL/DCG PROLOG S  NP VP NP  Noun Noun  stench Noun  wumpus VP  Verb Verb  smells Verb  kills NP(s1)  VP(s2)  S(append(s1,s2)) Noun(s)  NP(s) (s = “stench”  s = “wumpus”)  Noun(s) Verb(s)  VP(s) (v = “smells”  v = “kills”)  Verb(v) sentence([S1, S2]) :- np(S1), vp(S2). np(S):- noun(S). noun(stench). noun(wumpus). vp(S):- verb(S). verb(smells). verb(kills). ?- sentence([wumpus, smells]). ?-sentence([S1, S2]).

Imbogatire DCG Imbogatesc neterminale cu argumente suplimentare Rol argumente: Ataseseaza semantica Verifica corectitudinea gramaticala Adauga expresii / functii care se testeaza

Argument pt semantica BNF FOPL/DCG semantica compozitionala PROLOG S(sem)  NP(sem1) VP(sem2) {compose(sem1, sem2, sem)} NP(s1, sem1)  VP(s2, sem2)  S(append(s1, s2)), compose(sem1, sem2, sem) slide urmator semantica compozitionala

The dog has legs. (caine parti picioare) The ball is yellow. (minge proprietate galbena) The ball is red. (mine proprietate rosie) The dog bites. (caine actiune musca) sentence(S, Sem) :- np(S1, Sem1), vp(S2, Sem2), append(S1, S2, S), Sem = [Sem1 | Sem2]. np([S1, S2], Sem) :- article(S1), noun(S2, Sem). vp([S], Sem) :- verb(S, Sem1), Sem = [actiune, Sem1]. vp([S1, S2], Sem) :- verb(S1,_), adjective(S2, Sem1), Sem = [proprietate, Sem1]. vp([S1, S2], Sem) :- verb(S1,_), noun(S2, Sem1), Sem = [parti, Sem1]. noun(dog,caine). noun(ball,minge). noun(legs,picioare). verb(bytes,musca). verb(is,este). verb(has,are). adjective(yellow,galbena). adjective(red,rosie). ?- sentence([the,ball,is,yellow],Sem). Sem = [minge, proprietate, galbena] Yes ?- sentence([the,dog,bytes],Sem). Sem = [caine, actiune, musca] ?- sentence([is,dog,bytes],Sem). No ?- sentence([the,dog,has,legs],Sem). Sem = [caine, parti, picioare]

Verificare corectitudine gramaticala cazuri subcategorii verbe: complementul pe care il poate accepta un verb acord subiect predicat etc. Parametrizarea neterminalelor

Cazuri S  NP(Nominativ) VP Nominativ (subjective) I take the bus Eu iau autobuzul You take the bus Tu iei autobuzul He takes the bus El ia autobuzul   Acuzativ (objective) He gives me the book Imi da cartea S  NP(Nominativ) VP NP(case)  Pronoun (case) | Noun | Article Noun // I VP  VP NP(Acuzativ) // believe him VP  VP PP // turn to the right VP  VP Adjective VP  Verb PP  Preposition NP(Acuzativ) Pronoun(Nominativ)  I | you | he | she Pronoun(Acuzativ)  me | you | him | her

sentence(S) :- np(S1,nominativ), vp(S2), append(S1, S2, S) sentence(S) :- np(S1,nominativ), vp(S2), append(S1, S2, S). np([S], Case) :- pronoun(S, Case). np([S], _ ) :- noun(S). np([S1, S2], _ ) :- article(S1), noun(S2). pronoun(i, nominativ). pronoun(you, _ ). pronoun(he, nominativ). pronoun(she, nominativ). pronoun(me, acuzativ). pronoun(him, acuzativ). pronoun(her, acuzativ). noun(ball). noun(stick). article(a). article(the).

Subcategorii verbe S  NP(Nominativ) VP(subcat) Lista de subcategorii: ce complemente accepta verbul depinde de verb S  NP(Nominativ) VP(subcat) VP(subcat)  VP(subcat) PP | VP(subcat) Adverb I smell the wumpus now

VP(subcat)  {subcat = np} VP(np) NP(Acuzativ) VP(subcat)  {subcat = np} VP(np) NP(Acuzativ) | {subcat = adj} VP(adj) Adjective | {subcat = pp} VP (pp) PP | Verb smell [NP] smell a wumpus [Adjective] smell awfull [PP] smell like a wumpus is [Adjective] is smelly [PP] is in box [NP] is a pit give [NP, PP] give the gold in box to me [NP, NP] give me the gold died [] died

Cazuri si subcategorii S  NP(Nominativ) VP(subcat) NP(case)  Pronoun (case) | Noun | Article Noun Pronoun(Nominativ)  I | you | he | she Pronoun(Acuzativ)  me | you | him | her VP(subcat)  {subcat = np} VP(np) NP(Acuzativ) | {subcat = adj} VP(adj) Adjective | {subcat = pp} VP (pp) PP | Verb | VP(subcat) PP | VP(subcat) Adverb

VP(subcat)  {subcat = np} VP(np) NP(Acuzativ) VP(subcat)  {subcat = np} VP(np) NP(Acuzativ) | {subcat = adj} VP(adj) Adjective | {subcat = pp} VP (pp) PP | Verb | VP(subcat) PP | VP(subcat) Adverb sentence(S) :- np(S1,nominativ), vp(S2, Subcat), append(S1, S2, S). VP(Subcat)  VP(Subcat) … !!! vp(S, Subcat) :- Subcat = np, vp1(S1, np),np(S2, acuzativ), append(S1, S2, S). vp(S, Subcat) :- vp1(S1, Subcat), pp(S2), append(S1, S2, S). vp1([S],np):-verb(S). verb(give). verb(make).

Analiza pragmatica Analiza semantica Eliminare ambiguitate Interpretare pragmatica Mod de utilizare si efect asupra receptorului; Completeaza interpretarea semantica prin considerarea informatiilor despre situatia curenta Indexical – refera situatia curenta Anafora – refera obiecte deja mentionate

Ambiguitate Lexicala – acelasi cuvant diverse intelesuri Sintactica – arbori diferiti de analiza Referentiala – referire la obiecte anterioare Pragmatica – referire la loc, timp