universitatea politehnica bucuresti 2007-2008 adina magda florea artificial intelligence
Embed Size (px)
TRANSCRIPT

Universitatea Politehnica Bucuresti2007-2008
Adina Magda Floreahttp://turing.cs.pub.ro/ai_07
Artificial IntelligenceArtificial Intelligence

2
Structured knowledge representationStructured knowledge representation
Semantic NetworksSemantic Networks UnitsUnits Specific inferencesSpecific inferences Problems with inheritanceProblems with inheritance Semantic WebSemantic Web
Lecture No. 8

3
Semantic networks
first model for structured knowledge representation
describe semantics of natural language used extensively as a model for
representing knowledge in KBS

Knowledge base Radu sent a letter to Maria. Radu is a student. Ioana is a schoolgirl. Radu's address is Luterana, 15.
occupation (radu, student) occupation (ioana, schoolgirl) send (radu, ioana, letter) address (radu, luterana - 15)

Group knowledge into entities Radu
– occupation (radu, student)– send (radu, ioana, letter)– address (radu, luterana - 15)
Ioana– occupation (ioana, schoolgirl)– send (radu, ioana, letter)
Radu occupation: student
address: luterana-15
Ioanaoccupation: schoolgirl
Associate propertiesor attributes
Model 2 args predicates
What about 3 args predicates?

radu),Sender(t
event)-sending,ISA(t
1
1
letter),Object(t
ioana),Receiver(t
1
1
radu)(x,Sevent)-sendingx)(ISA(x,( ender
letter))Object(x,ioana),Receiver(x
- use ISA predicate- use Skolemizationto eliminateexistential quantifier

7
RaduISA: PersonOccupation: studentAddress: luterana-15
IoanaISA: Person Occupation : schoolgirl
T1 ISA: Sending-event Sender: Radu
Receiver: Ioana Object: letterslots

8
ISA introduces a class-instance relationshipAKO predicate introduces a subclass-class relationship
(x)) (x)event -(Sending x)( Event
(x)) (Person(x) x)( gLivingThin

9
Sending-eventAKO: EventSender: PersonReceiver: PersonObject: ObjectClass
PersonAKO: living ThingOccupation: (student, engineer,
…)Address: string

10
Canar galben
aripi
Pasare
culoare
ISA
are
zbura
poate
(a)
Eveniment
Eveniment-trimitere
AKO
T1
ISA
scrisoare
Obiect
Radu
Expeditor
Ioana
Destinatar
Persoana
ISA
ISA
Adresaluterana-15
student
Ocupatie
elev
(b)
Ocupatie
Examples of SNExamples of SN

11
Units MemberOf - ISA SubClass, SuperClass - AKO
UnitsUnits

12
Facets– Features associated to slots– Possible facets
Value facet Value type facet Default facet If-needed procedure or function Demon facet Comment facet
FacetsFacets

Specific inferences in semantic networks: properties/attributes inheritance
1) Inheritance of attributes along the ISA relation 2) Inheritance of attributes along the AKO
relation
Attribute's value inheritance

Piramida Caramida
Bloc
AKO AKO
triunghi dreptunghiForma Forma
Consistentamare
Piramida18 Caramida12
ISA ISA
M o s t e n i r e a v a l o r i l o r i n r e t e l e s e m a n t i c eAttribute's value inheritance

Algorithm: Inheritance of attribute's value in a class hierarchyThe algorithm gets the value V of an attribute A of the object O
FindVal (O, A, V)1. Create a list L with node O and all the nodes linked to O by an ISA relationship2. while L != [ ] do
2.1. Remove first node N from L 2.2. if attribute A of node N has value, be it V
then 2.2.1. Place V as the value of attribute A of object O2.2.3. return SUCCESS
2.3. Add all nodes linked by AKO to N at the end of L3. return FAILend.

16
Caramida rosieCuloare
Caramida12
ISAFateta valoare implicita
Caramida0 albaCuloare
ISA
Mostenirea valorilor implicite in retele semanticeAttribute's default value inheritance

Algorithm: Inheritance of attribute's default value in a class hierarchy
The algorithm gets the default value V of an attribute A of the object OFindDefault (O, A, V)1. Create a list L with node O and all the nodes linked to O by an ISA relationship2. while L != [ ] do
2.1. Remove first node N from L 2.2. if attribute A of node N has a default value, be it V
then 2.2.1. Place V as the value of attribute A of object O2.2.3. return SUCCESS
2.3. Add all nodes linked by AKO to N at the end of L3. return FAILend.
FindIfNeeded(O,A,V)

18
Control strategyControl strategy the control strategy of inheritance indicates
the order of considering the different facets
2 basic strategies– N strategy– Z strategy

Algorithm: The algorithm gets the value V of an attribute A of the object O using the N strategy
FindValN (O, A, V)1. if FindVal (O,A,V) = SUCCESS
then return SUCCESS2. if FindDefault (O,A,V) = SUCCESS
then return SUCCESS3. if FindIfNeeded (O,A,V) = SUCCESS
then return SUCCESS4. return FAILend
Strategy NStrategy N

Algoritm: Strategia Z de determinare a valorii unui atribut.Algoritmul determina valoarea unui atribut A al unei instante O utilizind strategia Z.
DetValZ (O, A, V)1. Formeaza o lista L cu nodul O si toate nodurile
legate de O prin relatia ISA2. cat timp L != [ ] executa
2.1. Elimina primul nod, N, din lista L2.2. daca fateta valoare a atributului A a
nodului N este V
then 2.2.1. Depune V in nodul punctat de
atributul A al obiectului O2.2.2. intoarce SUCCES
Strategy ZStrategy Z

2.3. daca fateta valoare implicita a atributului A a nodului N este Vatunci 2.3.1. Depune V in nodul punctat de atributul A al
obiectului O2.3.2. intoarce SUCCES
2.4. daca fateta procedura necesara a atributului A a nodului N este proc (A1,..., An,V)atunci2.4.1. Determina valorile atributelor A1,..., An ale
instantei O2.4.2. daca s-au gasit valori pentru A1,..., An
atuncii. executa proc (A1,..., An,V)ii. Depune V in nodul punctat de
atributul A al obiectului Oiii. intoarce SUCCES
3. intoarce INSUCCESsfarsit.

22
Problems with inheritance
DAG networks
Multiple inheritance

Unit PasareSlot: Zboara
Value: da
Unit FifiSlot: Zboara
Value: necunoscut
Unit StrutSlot: Zboara
Value: nu
Unit PasareZoo
ISA (MemberOf) ISA (MemberOf)
AKO (SuperClasses)
Zboara Fifi?
AKO (SuperClasses)
DAG Semantic network

24
Multiple inheritanceMultiple inheritance
Distance between units If we look for the value of an attribute A of a
unit U1 and find 2 paths : U1U2 and U1U3 to U2 and U3 containing values for A
then compute the length of the alternate paths from the instance/unit U1 to units U2 and U3 and choose the value from the closest unit (shortest path)
May cause semantic problems

25
Unit PasareSlot: Zboara
Value: da
Unit FifiSlot: Zboara
Value: necunoscut
Unit StrutSlot: Zboara
Value: nu
Unit PasareZoo
ISA
ISA
AKO
Zboara Fifi? nu
Unit StrutPenat
Unit StrutPenatAlb
AKO
AKO
AKO
Cea mai micadistanta
Cea mai micadistanta inferentiala
D istanta si d istanta in ferentia la in tre un ita tiDistance and inferential distance
Shortestdistance
Shortestinferentialdistance

26
Multiple inheritanceMultiple inheritance
Inferential distance
Unit1 is closer to Unit2 than to Unit3 if and only if Unit1 has an inferential path to Unit3 which contains Unit2.
Unit1 is closer to Unit2 than to Unit3 if and only if Unit2 is on an inferential path of ISA and AKO relationships between Unit1 and Unit3

Algorithm: Inheritance of attribute's value in a class hierarchy based on inferential distanceFind the value V of slot S of unit U
1. Make a list L with unit U and all units to which unit U is linked by an ISA/MemberOf
2. Initialize a list CAND = [ ] 3. while L != [ ] do
3.1. remove first unit X from L3.2. if slot S of X has value
then CAND = CAND {X}3.3. else add to L all units to which X is linked by a
AKO/SuperClass4. for each unit C CAND do
4.1. Verify if there is another C’ CAND having an inferential distance to U shorter than to C
4.2. if such a C' existsthen remove C from CAND

5. if card (CAND) = 0then return FAIL /* no value for S */
6. if card (CAND) = 1then 6.1. Be C the one element of CAND6.2. Make the value V of slot S of C the value of slot
S of U6.3. return SUCCESS
7. if card (CAND) > 1 then return CONTRADICTION
end.

Combined representations
Knowledge base contains:- declarative knowledge: units
- procedural knowledge: rules daca Camion.Inaltime > 2 si Camion.Culoare = rosuatunci Camion.Pret = 1000
Inferences: both specific to units and specific to rules

30
Semantic Web and Ontologies

Semantic Web Web was “invented” by Tim Berners-Lee (amongst others),
a physicist working at CERN TBL’s original vision of the Web was much more ambitious
than the reality of the existing (syntactic) Web:
TBL (and others) have since been working towards realising this vision, which has become known as the Semantic Web– E.g., article in May 2001 issue of Scientific American…
“... a goal of the Web was that, if the interaction between person and hypertext could be so intuitive that the machine-readable information space gave an accurate representation of the state of people's thoughts, interactions, and work patterns, then machine analysis could become a very powerful management tool, seeing patterns in our work and facilitating our working together through the typical problems which beset the management of large organizations.”

Where we are Today: the Syntactic Web
[Hendler & Miller 02]

The Syntactic Web is… A hypermedia, a digital library
– A library of documents called (web pages) interconnected by a hypermedia of links
A database, an application platform– A common portal to applications accessible through web pages,
and presenting their results as web pages A platform for multimedia
– BBC Radio 4 anywhere in the world! Terminator 3 trailers! A naming scheme
– Unique identity for those documents
A place where computers do the presentation (easy) and people do the linking and interpreting (hard).
Why not get computers to do more of the hard work?
[Goble 03]

Impossible (?) using the Syntactic Web… Complex queries involving background knowledge
– Find information about “animals that use sonar but are not either bats or dolphins”
Locating information in data repositories– Travel enquiries– Prices of goods and services– Results of human genome experiments
Delegating complex tasks to web “agents”– Book me a holiday next weekend somewhere warm, not too
far away, and where they speak French or English

What is the Problem? Consider a typical web page:
Markup consists of: – rendering
information (e.g., font size and colour)
– Hyper-links to related content
Semantic content is accessible to humans but not (easily) to computers…

What information can we see…WWW2002The eleventh international world wide web conferenceSheraton waikiki hotelHonolulu, hawaii, USA7-11 may 20021 location 5 days learn interactRegistered participants coming fromaustralia, canada, chile denmark, france, germany, ghana, hong kong, india,
ireland, italy, japan, malta, new zealand, the netherlands, norway, singapore, switzerland, the united kingdom, the united states, vietnam, zaire
Register nowOn the 7th May Honolulu will provide the backdrop of the eleventh
international world wide web conference. This prestigious event …Speakers confirmedTim berners-lee Tim is the well known inventor of the Web, …Ian FosterIan is the pioneer of the Grid, the next generation internet …

What information can a machine see…
…
…
…

Solution: XML markup with “meaningful” tags?<name> </
name><location> </location>
<date> </date><slogan> </slogan><participants>
</participants>
<introduction>
…
</introduction><speaker> </speaker><bio> </bio>…

But What About…<conf> </
conf><place> </place>
<date> </date><slogan> </slogan><participants>
</participants>
<introduction>
…
</introduction><speaker> </speaker><bio> …

Must add semantics External agreement on meaning of annotations
– E.g., Dublin Core• Agree on the meaning of a set of annotation tags
– Problems with this approach• Inflexible• Limited number of things can be expressed
Use Ontologies to specify meaning of annotations– Ontologies provide a vocabulary of terms– New terms can be formed by combining existing ones– Meaning (semantics) of such terms is formally specified– Can also specify relationships between terms in multiple
ontologies

Ontology in philosophy
a philosophical discipline—a branch of philosophy that deals with the nature and the organisation of reality
Science of Being (Aristotle, Metaphysics, IV, 1)
Tries to answer the questions:
What characterizes being?
Eventually, what is being?

Ontology in Computer Science
An ontology is an engineering artifact: – It is constituted by a specific vocabulary used to describe a
certain reality, plus – a set of explicit assumptions regarding the intended meaning
of the vocabulary.
Thus, an ontology describes a formal specification of a certain domain:– Shared understanding of a domain of interest– Formal and machine manipulable model of a domain of
interest
“An explicit specification of a conceptualisation” [Gruber93]

Structure of an ontology
Ontologies typically have two distinct components:
Names for important concepts in the domain– Elephant is a concept whose members are a kind of animal– Herbivore is a concept whose members are exactly those
animals who eat only plants or parts of plants – Adult_Elephant is a concept whose members are exactly
those elephants whose age is greater than 20 years
Background knowledge/constraints on the domain– Adult_Elephants weigh at least 2,000 kg– All Elephants are either African_Elephants or
Indian_Elephants– No individual can be both a Herbivore and a Carnivore

Example of ontology

Tools
Description Logics OWL = Web Ontological Language Protégé – framework for building
ontologies