670 likes | 768 Views
An Introduction to Markov Logic Networks in Knowledge Bases. 9/30/2014 Sean Goldberg sean@cise.ufl.edu. From Big Data to Big Wisdom. From Big Data to Big Wisdom. Rules. Data. Facts. What is a Knowledge Base?. What is a Knowledge Base?. What is a Knowledge Base?.
E N D
An Introduction to Markov Logic Networksin Knowledge Bases 9/30/2014 Sean Goldberg sean@cise.ufl.edu
From Big Data to Big Wisdom Rules Data Facts
Triple Representation • FatherOf(Darth Vader, Luke Skywalker) • memberOf(Luke Skywalker, Rebel Alliance) • hasWeapon(Luke Skywalker, lightsaber) • isAlliedWith(Luke Skywalker, Han Solo) • IsAlliedWith(Luke Skywalker, Chewbacca) • livesOn(Luke Skywalker, Tatooine) • hasAdviser(Luke Skywalker, Yoda) • …..
Large Scale KBs • KnowitAll (Univ. of Washington) • 500M facts extracted from 100M webpages (ClueWeb) • DBPedia (Univ. of Leipzig) • 3.5M entities, 700M facts extracted from Wikipedia • YAGO (Max-Planck Institute) • 2M entities, 20M facts extracted from Wikipedia and WordNet • Freebase (Google) • 20M entities, 300M facts from integrated data sources and humans • NELL (Carnegie Mellon) • 850M facts extracted from 500M webpages
Inferring New Facts • Markov Network • Undirected graphical model • Markov Property: Probabilities for each node depend only on its neighbors • Most probable assignment of random variables defined by cliques • HARD to figure out all the clique potentials • First Order Logic • Data described by predicates with arguments • Logical formulas denote inference rules over predicates • Deterministic, ie. no probability • EASY to specify logical formulas • Markov Logic: Markov Networks + First Order Logic • Statistical power of MLNs + specification power of FOL
Markov Networks Smoking Cancer Asthma Cough
Markov Networks Smoking Cancer Asthma Cough Weight of Feature i Feature i
First Order Logic FactA FactB FactC FactA FactB ^
First Order Logic isA(Luke, Jedi) memberOf(Luke, Rebel Alliance)
First Order Logic isAlliedWith(Han, Luke) ^ memberOf(Luke, Rebel Alliance) memberOf(Han, Rebel Alliance)
First Order Logic isAlliedWith(X, Y) ^ memberOf(Y, Z) memberOf(X, Z)
Soft Rules vs. Hard Rules locatedIn(Y, Z) bornIn(X, Z) bornIn(X, Y) ^
Soft Rules vs. Hard Rules locatedIn(Y, Z) bornIn(X, Z) bornIn(X, Y) ^ HARD
Soft Rules vs. Hard Rules locatedIn(Y, Z) bornIn(X, Z) bornIn(X, Y) ^ HARD friendOf(Y, Z) friendOf(X, Z) friendOf(X, Y) ^
Soft Rules vs. Hard Rules locatedIn(Y, Z) bornIn(X, Z) bornIn(X, Y) ^ HARD friendOf(Y, Z) friendOf(X, Z) friendOf(X, Y) ^ SOFT
Soft Rules vs. Hard Rules locatedIn(Y, Z) bornIn(X, Z) bornIn(X, Y) ^ HARD friendOf(Y, Z) friendOf(X, Z) friendOf(X, Y) ^ SOFT MLN Basic Idea: Give every formula a weight (higher weight stronger constraint)
Markov Logic Networks: Logic + Probability A Markov Logic Network is a collection of pairs (F, W) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 alliedWith(X, Y) -> alliedWith(Y, X) 100 hasLightsaber(X) -> memberOf(X, Rebels) 0.5
Building a Markov Network • Nodes = all possible instantiations of a predicate • Edge between two nodes iff they appear together in some formula
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) memberOf(L, E) alliedWith(H, L)
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) memberOf(L, E) alliedWith(H, L)
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) memberOf(L, E) alliedWith(H, L) alliedWith(L, H)
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) memberOf(L, E) alliedWith(H, L) alliedWith(L, H)
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R)
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R)
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R)
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) alliedWith(X, Y) -> alliedWith(Y, X) 100 memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R)
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) alliedWith(X, Y) -> alliedWith(Y, X) 100 memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R)
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) alliedWith(X, Y) -> alliedWith(Y, X) 100 hasLightsaber(X) -> memberOf(X, Rebels) 0.5 memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R)
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) alliedWith(X, Y) -> alliedWith(Y, X) 100 hasLightsaber(X) -> memberOf(X, Rebels) 0.5 memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R) hasLightSaber(L) hasLightSaber(H)
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) alliedWith(X, Y) -> alliedWith(Y, X) 100 hasLightsaber(X) -> memberOf(X, Rebels) 0.5 memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R) hasLightSaber(L) hasLightSaber(H)
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) alliedWith(X, Y) -> alliedWith(Y, X) 100 hasLightsaber(X) -> memberOf(X, Rebels) 0.5 memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R) hasLightSaber(L) hasLightSaber(H)
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) alliedWith(X, Y) -> alliedWith(Y, X) 100 hasLightsaber(X) -> memberOf(X, Rebels) 0.5 memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R) hasLightSaber(L) hasLightSaber(H)
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) alliedWith(X, Y) -> alliedWith(Y, X) 100 hasLightsaber(X) -> memberOf(X, Rebels) 0.5 memberOf(L, E) alliedWith(H, L) alliedWith(L, H) Knowledge Base: memberOf(Luke, Rebels) memberOf(Han, Rebels) hasLightSaber(Luke) ~memberOf(Luke, Empire) memberOf(L, R) memberOf(H, R) hasLightSaber(L) hasLightSaber(H)
Probability of Possible World Weight of formula i No. of true groundings of formula i in x
Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5 memberOf(H, E) alliedWith(X, Y) -> alliedWith(Y, X) 100 hasLightsaber(X) -> memberOf(X, Rebels) 0.5 memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R) hasLightSaber(L) hasLightSaber(H)
Inference in MLNs • MAP Inference: Find the most likely possible world given some evidence