Chapter 2 Semantic Nets and Description Matching …ce.kiu.ac.kr/~kykim/ai/Chapter-2-2011.pdf ·...

Post on 30-Apr-2018

223 views 4 download

Transcript of Chapter 2 Semantic Nets and Description Matching …ce.kiu.ac.kr/~kykim/ai/Chapter-2-2011.pdf ·...

Chapter 2Semantic Nets and Description Matching(의미망과 기술부합)

- 지식표현 -> 의미망

- 문제해결방법 -> 기술부합

인공지능 기법

• Tic-Tac-Toe

• Question-Answering

인공지능 기법

• Question Answering(질의 응답)

Mary went shopping for a new coat. She found a red one she really liked. When she got it home, she discovered that it went perfectly with her favorite dress.

– Q1: What did Mary go shopping for?

– Q2: What did Mary find that she liked?

– Q3: Did Mary buy anything?

1) ELIZA(템프레이트 사용)Person: Men are all alike.ELIZA: In what way?Person: They’re always bugging us about something or other.ELIZA: Can you think of a specific example?Person: Well, my boyfriend made me come here.ELIZA: Your boyfriend made you come here.Person: He says I’m depressed much of the time.ELIZA: I am sorry to hear you are depressed.

→ (X you Y)

→ (Why do remember X just now?)

→ (Who else in your family is Y?

→ (Tell me more about your family)

(X me Y)(I remember Y)(My {family-member} is Y)(X {family-member} Y)

2) Using Linguistic Knowledge(언어지식)• Convert the input text into a structured form representing the

meaning of sentences.• Convert Questions into that form, and find answers by

matching structured forms.• Q1: Can be answered - “a new coat.”• Q2: Can be answered - “ a red coat.”• Q3: Can not be answered.• Comments:

– Less brittle than the first program with respect to exact forms.

– Some additional information is necessary to find an answer to question 3.

3) Using Linguistic Knowledge and World Knowledge(언어지식+세계지식)

Convert input text into a structured form representing the meaning of sentences, and combine that form with other structured forms describing prior knowledge about the objects and situations. 다음자료참고

Shopping Script:roles:C(customer),

S(salesperson)props:M(merchandise),

D(dollars)location:L(a store)

1. C enters L

2. C begins looking around

3. C looks for a specific M 4. C looks for any interesting M

5. C asks S for help

6.

7. C finds M’ 8.C fails to find M

11.C leaves L 12.goto step 210. C buys M’9. C leaves L

13. C leaves L

14. C takes M’

3) Using Linguistic Knowledge and World Knowledge(언어지식+세계지식)

• Answer questions using this augmented knowledge structure.

• Q1: Can be answered - “a new coat.”• Q2: Can be answered - “a red coat.”• Q3: “Yes, She bought a red coat.”• Comments:

– more powerful than the first two programs because it exploits more knowledge.

– it is exploiting AI techniques.

– a general reasoning mechanism is missing from this program.

지식표현&문제해결

• Knowledge Representation(지식표현): represent the computer’s knowledge of the world by some kind of data structures in the machine’s memory.- Representation: “How to describe a class of things.”

“Representation of a thing is valid”= “We have knowledge about that thing.”Thus, Valid representation = Knowledge

• Search(검색): a problem-solving technique that systematically explores a space of problem states.

지식표현&문제해결

• Knowledge Representation schemes– Logical Representation Schemes

(e.g. Predicate Logic)– Network Representation Schemes

(e.g. Semantic Networks)– Structured Representation Schemes

(e.g. Frame)– Procedural Representation Schemes

(e.g. Production Rules)

지식표현(논리)

– If it doesn’t rain tomorrow, Tom will go to the mountains¬weather(rain, tomorrow) ⇒ go(tom, mountains)

– All basketball players are tall∀ X (basketball_player(X) ⇒ tall(X))

ca

bd

on(c,a).on(b,d).ontable(a).ontable(d).clear(b).clear(c).hand_empty.

지식표현(의미망)

지식표현(프레임)

지식표현(생성규칙)

• Production Rules– Rule1

IF X has a risk of heart attackAND X has had a previous heart attackTHEN give X the drug Digitalis

– Rule2IF X has left quadratic painAND X has high blood pressureTHEN X has a risk of a heart attack

– Rule3IF X has raised intraocular pressureTHEN X has high blood pressure

좋은 지식표현의 예(FWGC)A farmer with his wolf, goat, and cabbage come to the edge of a river they wish to cross.There is a boat at the river’s edge, but of course, only the farmer can row.The boat also can carry only two things (including the rower) at a time.If the wolf is ever left alone with the goat, the wolf will eat the goat;Similarly, if the goat is left alone with the cabbage, the goat will eat the cabbage.Devise a sequence of crossings of the river so that all four characters arrive safely on the other side of the river.

Example: farmer, fox, goose, and grain

- constraint1: farmer can take only one across on any trip.- constraint2: unattended fox will eat a goose.- constraint3: unattended goose will eat a grain.- initial state: all are in one side.- goal state: all are in the other side.- objectives: find path from the initial state to the goal state.

To do this,

==> consider node (or state) which represent all possible states.

24 = 16 (2: this or that side, 4: farmer, fox, goose, grain)

==> Now, 10 of 16 is safe state --> obey given constraints2 & 3.6 of 16 is unsafe state --> disobey given constarint2 & 3.

Example: farmer, fox, goose, and grain

FWGC 문제

FWGC 문제

지식표현의 예

• A water jug problem

– You are given two jugs, a 4-gallon one and a 3 gallon one. Neither has any measuring markers on it. There is a pump that can be used to fill the jugs with water. How can you get exactly 2 gallons of water onto the 4-gallon jug?

4 3

2

3

지식표현의 예(선교사&식인종)

• Missionaries and Cannibals Problem– Three missionaries and three cannibals find themselves on

one side of a river. They have agreed that they would all like to get to the other side. But the missionaries are not sure what else the cannibals have agreed to. So the missionaries want to manage the trip across the river in such a way that the number of missionaries on either side of the river is never less than the number of cannibals who are on the same side. The only boat available holds only two people at a time. How can everyone get across the river without the missionaries risking being eaten?

지식표현의 예

• Tower of Hanoi

1 2 3 1 2 3

AB

C

AB

C

Good Representation ?

- It makes the important objects and relations explicit.

- It exposes natural constraints.

- It brings objects and relations together.

- It suppress irrelevant details.

- It is transparent.

- It is complete.

- It is concise.

- It is fast.

- If it computable.

How to build Formal Representation- 4 parts of representation

- lexical part ==> determines which symbols are allowed in the

representation’s vocabulary.

- structural part ==> describes constraints on how the symbols can be arranged.

- procedural part ==> specifies access procedures that enable youto create descriptions, to modify them, andto answer questions using them.

- semantic part ==> establishes a way of associating meaningwith the descriptions.

Semantic NetIn which,

- Lexically, there are nodes (objects), links (relations), andlink labels.

- Structurally, each link connects from a head node to a tail node.- Semantically, nodes and links denote application-specificentities.

with constructors- Construct a node- Construct a link, given a link label and two nodes to be connected.

with readers that- Produce a list of all links departing from a given node.- Produce a list of all links arriving at a given node.- Produce a tail node, given a link.- Produce a head node, given a link.- Produce a link label, given a link.

Family of Semantic Net

Describe-and-Match method(기술과부합방법)- a problem-solving method using a semantic net

Step:- describe the object using a suitable representation.- match the object description against library descriptions untilthere is a satisfactory match or there are no more librarydescriptions.

- if find a satisfactory match, announce it, otherwise, announcefailure.

object description library

rejects

success/fail

match

Feature-based Object Identification- one of description-and-match method

- feature extractor ==> measures object’s characteristics.- feature evaluator ==> evaluates object by comparing

extracted characteristics with ideal objects.

• 예: fig. 2.5 특징점 공간(다음 slide)

Feature-based Object Identification

Geometric Analogy Problems- one of description-and-match method

Example ==> see Fig2.6 (기하유사성문제)

* Geometric analogy netGeometric analogy net is a semantic netin which- Node denotes dots, circles,triangles, squares, rectangles, andother geometric objects.

- Some links denote relations among figure objects,I.e., inside, above, and left-of.

- Other links describe how figure objects are transformed.I.e., addition, deletion, expansion, contraction, rotation,

reflection, and combination of these.

Geometric Analogy Problems

n

source destination

n

mm

n

above m

n

m

nexpanded

unchanged

deleted

above

inside left-of

(geometric analogy net)

transform

relation

n

m

I

I

m

n

Geometric Analogy Problems- Example (Fig. 2.10 P.29)

Geometric Analogy Problems- Example (Fig. 2.11 P.30)

Geometric Analogy Problems- Example

Ideas for Analogy Problems(유사성문제)

- How to decide whether inside or outside.

==> odd number of crossing times: inside

even number of crossing times: outside

Ideas for Analogy Problems(유사성문제)

- How to compute the spatial relationship between two objects.

I.e., above, left-of

==> compute center of area of each of two objects.

y

x above y

y left-of x

y above x

x left-of y

x

Matching for Analogy Net

- Now, we need matching procedure

==> see Fig 2.10, Fig 2.11

- Question : if perfect matching does not exist ?

==> need to select best one by scoring.

==> see Fig 2.13

similarity = # of common label * weights

- # of difference from source to destination * weights

- # of difference from destination to source * weights

Additional Note

- ambiguity complicates matching

=> smaller one is deleted ?

=> bigger one is deleted and

small one is expanded ?

- good representation supports good performance.

==> see Fig 2.15