UNIT 13A AI: Natural Language Processing. Artificial Intelligence

Similar documents
The Turing Test and Its Discontents. CSCI 3202, Fall 2010

A a I i. Write. Name. Building with Dad. Handwriting Letters A,a and I,i: Words with a and i 401

THE 3 SENTENCE TYPES. Simple, Compound, & Complex Sentences

short long short long short long

Basic Sight Words - Preprimer

The Turing Test and Its Discontents

Sentences. A sentence is a group of words that tells a complete thought. A sentence always tells who or what

Favorite Things Nouns and Adjectives

Learning more about English

ATOMIC ENERGY CENTRAL SCHOOL No.4, RAWATBHATA WORKSHEET FOR ANNUAL EXAM Name: CLASS : III / Sec. SUB : English

Commonly Misspelled Words

Grammar study guide run Vs./ run Verb Noun

Name Date. 2-1 Unit 1-Wk.1 David's New Friend. Daily Language Arts / Math D.O.L

The Ant and the Grasshopper

MARIYA INTERNATIONAL SCHOOL. English Revision Worksheet Term 2( ) Class : Level 1

How does growing up change us?

The Harold Syntax Guide to Modifiers Pre-Test

1 st Final Term Revision SY Student s Name:

AVOIDING FRAGMENTS AND RUN-ONS

XSEED Summative Assessment Test 1. Duration: 90 Minutes. English, Test 1

THE TWENTY MOST COMMON LANGUAGE USAGE ERRORS

Name. and. but. yet. nor

Useful Definitions. a e i o u. Vowels. Verbs (doing words) run jump

NELTAS - ECAT GRADE 3

Word Fry Phrase. one by one. I had this. how is he for you

Beware of Dog: Verbs, cont.

XSEED Summative Assessment Test 1. Duration: 90 Minutes Maximum Marks: 60. English, Test 1. XSEED Education English Grade 3 1

How Can Some Beans Jump?

Quick Assessment Project EDUC 203

Independent and Subordinate Clauses

1 Family and friends. 1 Play the game with a partner. Throw a dice. Say. How to play

1. As you study the list, vary the order of the words.

Spelling Tip. out. round

Grammar, punctuation and spelling

A General Introduction to. Adam Meyers, Evan Korth, Sam Pluta, Marilyn Cole New York University June 2-19, 2008

"There is no education like adversity."

Second Grade ELA Test Second Nine- Week Study Guide

2. to grow B. someone or something else. 3. foolish C. to go away from a place

Families Have Rules. homework rule. family dishes. Write the words and then match them to the correct pictures.

There are three sorts of sentences - simple, compound and complex. Sentences need to have a subject and a predicate.

2. Can you feed my? O then O rush O fish. 1. A is in the sand. O shell O and O call. 9. He looks for two pen. He looks for two pens.

The Basketball Game We had our game on Friday. We won against the other team. I was happy to win because we are undefeated. The coach was proud of us.

Name. Read each sentence and circle the pronoun. Write S on the line if it is a subject pronoun. Write O if it is an object pronoun.

Anglia ESOL International Examinations. Preliminary Level (A1) Paper CC115 W1 [5] W3 [10] W2 [10]

Grammar 101: Adjectives, Adverbs, Articles, Prepositions, oh my! For Planners

Key Stage 2 example test paper

the stone, the more it was _1_. The smallest money stone - about the size of a dinner

Unit Grammar Item Page

CUADERNILLO DE REPASO CUARTO GRADO

Basic English. Robert Taggart

South Avenue Primary School. Name: New Document 1. Class: Date: 44 minutes. Time: 44 marks. Marks: Comments: Page 1

Conversation 1. Conversation 2. Conversation 3. Conversation 4. Conversation 5

[Worksheet 2] Month : April - I Unseen comprehension 1. Put a circle around the number next to each correct answer after reading the passage.

Instant Words Group 1

2. Tom walked to Ghost Cottage with Sams food tucked under his arm. 3. Tom was sent to Miss Colvins office where he was punished for telling lies.

I became friends with John, the youngest of the four sons. We were in the

Golden retrievers, the best choice of

Table of Contents. Introduction Capitalization

Today is Monday. Yesterday was. Tomorrow will be. Today is Friday. Yesterday was. Tomorrow will be. Today is Wednesday.

Dinosaurs. B. Answer the questions in Hebrew/Arabic. 1. How do scientists know that dinosaurs once lived? 2. Where does the name dinosaur come from?

next to Level 5 Unit 1 Language Assessment

Table of Contents TABLE OF CONTENTS

Haslingden High School English Faculty HOMEWORK BOOKLET Year 8 - Block A Shakespeare (2B)

Key stage 2 - English grammar, punctuation and spelling practice paper

225 Prepositions of place

English Comprehensive Final

Florida Assessments for Instruction in Reading

Literal & Nonliteral Language

KENDRIYA VIDYALAYA TPKM MADURAI WORK SHEET - ENGLISH CLASS: II TOPIC: ZOO MANNERS ROLL NO.:

COMMON GRAMMAR ERRORS. By: Dr. Elham Alzoubi

Language Arts Study Guide Week 1, 8, 15, 22, 29

TWO CAN COMPUTERS THINK?

Lesson -5 Fun with Language

A sentence is a group of words that tells a whole idea. Example: The cat sat on the mat.

Grammar Flash Cards 3rd Edition Update Cards UPDATE FILE CONTENTS PRINTING TIPS

Target Vocabulary (Underlining indicates a word or word form from the Academic Word

boring sad uncertain lonesome

Knowledge Representation

MATHEMATICS WORKSHEET- 3 CLASS I ( ) TOPICS: Tens and Ones (11-30) Name Roll No.

EMPOWERING TEACHERS. Instructional Example LA We are going identify synonyms for words. TEACHER EXPLAINS TASK TEACHER MODELS TASK

2 - I couldn't treat you any better if you were the Queen of England. a - himself b - yourselves c - herself d - ourselves e

Lesson 75: Technology (20-25 minutes)

THE LANGUAGE MAGICIAN classroom resources. Pupil's worksheets Activities

Is it a bad thing if children tell lies? Scientists don't think so. This short video explains why.

Lesson 17: Giving an Apology/Explanation (20-25 minutes)

Second Term Examination Syllabus for Class 4 Blue & Green

LESSON 35. Objectives

January 24, 2017 January 26, 2017, Class 2 January 31, 2017, class 3. February 2, 2017, Class 4

Power Words come. she. here. * these words account for up to 50% of all words in school texts

Writing. the. the. through. slithers. snake. grass. Wild about

TABLE OF CONTENTS. Free resource from Commercial redistribution prohibited. Language Smarts TM Level D.

XSEED Summative Assessment Test 2. Duration: 90 Minutes Maximum Marks: 60. English, Test 2. XSEED Education English Grade 1

Pronouns and possessive adjectives

DELHI PUBLIC SCHOOL FIROZABAD

Lesson 12: Infinitive or -ING Game Show (Part 1) Round 1: Verbs about feelings, desires, and plans

GERUNDS INFINITIVES GRADE X. Compiled by : Aquilina Yunita, S.Pd

Test Booklet. Subject: LA, Grade: 03 Week 3 Quiz. Student name:

Reported (Indirect) Speech: Discovering the rules from Practical English Usage

INTRODUCTION. English Is Stupid

Smarty Activity Reading Strategies

Transcription:

UNIT 13A AI: Natural Language Processing 1 Artificial Intelligence Branch of computer science that studies the use of computers to perform computational processes normally associated with human intellect. Some areas of AI: Expert systems Knowledge representation Machine learning Natural language processing 2 1

The Turing Test Turing publishes Computing Machinery and Intelligence in 1950. Describes a test (now called the Turing Test) to determine whether a computer can be called intelligent. A machine is considered intelligent if an interrogator cannot tell if a human or a computer is answering a set of questions using typewritten responses. 3 Beginnings of AI McCarthy John McCarthy (inventor of the programming language Lisp) coins the term "artificial intelligence" in 1956 at a Dartmouth conference. Allen Newell and Herbert Simon contributed to one of the first AI programs, the General Problem Solver (GPS) in 1957. For more info: http://tip.psychology.org/simon.html Faculty members at Carnegie Mellon University. Awarded the Turing Award in 1975 for "basic contributions to artificial intelligence, the psychology of human cognition, and list processing." Newell Simon 4 2

Types of AI Weak AI The computer is an intelligent, problem-solving device. Strong AI Not only can a computer solve problems in an intelligent manner, but the computer is self-aware (or has a sense of consciousness). Arguments against Strong AI: Chinese Room Argument - John Searle 1981 Blockhead - Ned Block 1980 5 Natural Language Processing Natural language processing involves the interactions between a computer and a human via spoken (or written) language. ELIZA One of the first programs to build a conversation between a human and a computer, created by Joseph Weizenbaum in 1966. Computer responses were created based on scripts. Most famous example was DOCTOR which simulated a Rogerian psychotherapist. 6 3

ELIZA H: My father wouldn t buy me a puppy. C: Tell me more about your family. H: I am sad I never got a puppy. C: Can you explain what made you sad you never got a puppy? H: I am sad we never had a chance to play fetch. C: I am sorry to hear you are sad we never had a chance to play fetch. 7 Searching a String >> s = My dog ate the caterpillar. => My dog ate the caterpillar. >> s.include?( dog ) => true >> s.include?( Caterpillar ) => false >> s.include?( cat ) => true >> s.index( the ) => 11 >> s.slice!(11,3) => the >> s => "My dog ate caterpillar." 8 4

Regular Expressions A regular expression is a rule that describes the format required for a specific string. >> s = how now brown cow ow => how now brown cow ow >> r = /.ow/ => /.ow/ >> s.scan(r) r is a regular expression that says match an string consisting of 3 characters, where the first character is anything and the next 2 characters are o and w exactly => [ how, now, row, cow, ow ] 9 RubyLabs: Pattern A (sentence) Patternis a mapping from a regular expression to a set of 1 or more responses. Example: creates a regular expression based on the first argument >> p1 = Pattern.new( dog, [ Tell me more about your pet, Go on ] => dog: [ Tell me more about your pet, Go on ] 10 5

More about Patterns The applymethod tries to match an input sentence to a regular expression. If it can, it returns one of supplied response strings. >> p1.apply( I love my dog. ) => Tell me more about your pet. >> p1.apply( My dog is really smart. ) => Go on. >> p1.apply( Much smarter than my cat. ) => nil 11 Groups We can specify a groupso that any member will cause a match during a scan. >> p2 = Pattern.new( cat dog bird, [ Tell me more about your pet, Go on ] >> p2.apply( My dog is smelly. ) => Go on. >> p2.apply( My cat ate my bird. ) => Tell me more about your pet. >> p2.apply( I miss Polly a lot. ) => nil 12 6

Placeholders We can use placeholders to store the part of a pattern that matches so we can use it in the response. >> p = Pattern.new( cat dog bird ) >> p.add_response( Tell me more about the $1 ) >> p.add_response( A $1? Interesting. ) >> p.apply( A dog ate my homework. ) => Tell me more about the dog. >> p.apply( My cat ate my bird. ) => A cat? Interesting. 13 Placeholders (cont d) >> p = Pattern.new( I (like love hate) my (cat dog bird) >> p.add_response( Why do you $1 your $2? ) >> p.add_response( Tell me more about your $2 ) >> p.apply( I like my dog. ) => Why do you like your dog? >> p.apply( I hate my cat. ) => Tell me more about your cat. 14 7

Wildcards We can use a wildcard symbol (.*) to match any number of characters. >> p = Pattern.new( I am afraid of.* ) >> p.add_response( Why are you afraid of $1? ) >> p.apply( I am afraid of ghosts ) => Why are you afraid of ghosts? >> p.apply( I am afraid of Tom ) => Why are you afraid of Tom? 15 Postprocessing To make things more realistic, we can replace personal pronouns with their opposites. >> p = Pattern.new( I am.*, [ Are you really $1? ]) >> p.apply( I am near my car ) => Are you really near my car? >> p.apply( I am annoyed at you ) => Are you really annoyed at you? 16 8

Postprocessing (cont d) An associative array like we used in Huffman trees. >> Eliza.post[ my ] = your >> Eliza.post[ you ] = me >> Eliza.post => { my => your, you => me } >> p.apply( I am near my car. ) => Are you really near your car? >> p.apply( I am annoyed at you. ) => Are you really annoyed at me? >> p.apply( I am sad, my my my. ) => "Are you really sad, your your your?" 17 Preprocessing Preprocessing is used to transform part of a sentence before pattern matching is performed. >> p = Pattern.new( I am afraid of.* ) >> p.add_response( Why are you afraid of $1? ) >> p.apply( I m afraid of ghosts ) => nil >> Eliza.pre[ I m ] = I am >> p.apply( I m afraid of ghosts ) => Why are you afraid of ghosts? 18 9

Algorithm for a Conversation 1. Perform any preprocessing on the sentence. 2. Break the sentence into words. 3. If there is a rule for a word, add the rule to a priority queue. 4. Try the rules in order of decreasing priority. 5. If a rule applies to the input sentence, apply postprocessing rules to placeholder variables and return the response. 19 Eliza and the Turing Test Human (natural) language is very complex. You said I wouldn t be afraid of horses if I visited a state fair, but when I was there I was chased by a pig, and now I m having nightmares about bacon. Natural language processors (NLPs) must use parsersto break a sentence down into its constituent parts (noun, verb, etc.) to determine an appropriate response. 20 10

Eliza and the Turing Test Human (natural) language is very complex. The lions were lying down in the grass. A: Go on. They were quiet A: Why were the lions quiet? Natural language processors (NLPs) must have memoryto associate words (e.g. they ) to words from previous sentences. 21 Eliza and the Turing Test Human (natural) language is very complex. The elephant was huge. A: How big was it? The cat fell into the well. A: Was it able to get out? NLPs must use semanticsto assign meaning to certain phrases in order to generate appropriate responses. 22 11

Eliza and the Turing Test Human (natural) language is very complex. The dog ran across the backyard while I waited on my patio. A: What happened when the dog reached the patio? NLPs must establish inferencesto add information to sentences that is not given but is assumed. 23 12