Presentation is loading. Please wait.

Presentation is loading. Please wait.

An Introduction to Markov Logic Networks in Knowledge Bases

Similar presentations


Presentation on theme: "An Introduction to Markov Logic Networks in Knowledge Bases"— Presentation transcript:

1 An Introduction to Markov Logic Networks in Knowledge Bases
9/30/2014 Sean Goldberg

2 From Big Data to Big Wisdom
Data is the constant deluge of sensory information: websites, status updates, s, etc. Knowledge is a set of desciptions of and relations between data, understanding how things are connected. Wisdom is being able to identify patterns in knowledge and use to infer new knowledge and understand causality in the world.

3 From Big Data to Big Wisdom
Data is the constant deluge of sensory information: websites, status updates, s, etc. Knowledge is a set of desciptions of and relations between data, understanding how things are connected. Wisdom is being able to identify patterns in knowledge and use to infer new knowledge and understand causality in the world. Data Facts Rules

4 What is a Knowledge Base?
So with that said? What is a knowledge base? In light of the previous definition, it’s…

5 What is a Knowledge Base?
People….

6 What is a Knowledge Base?
Places…

7 What is a Knowledge Base?
Organizations…

8 What is a Knowledge Base?
Things….

9 What is a Knowledge Base?
And the relations between them all. For clarity and brevity, I’ve left out the names of entities and relations, hoping you can follow along by context. The relation arrows can be of specific types such as “has Ally”, ‘is member of”, or ‘has father’.

10 Graph Representation Viewing knowledge this way is known as the graph representation of a knowledge base. How it’s stored more practicality…

11 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) ….. Is with the triple representation. The relation is a binary function that takes two entities and evaluates to true if the relation is shared by those entities in the knowledge base. Referring to the data one can identify by a relationa and its arguments, or use the subject-predicate-object formalism, where the first argument is the subject, the relation is the predicate, and the second argument is the object.

12 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 A knowledge base is any collection of such facts, but what we’re really concerned with is the domain of large-scale KBs. These are created either through automated scraping of data or large crowdsourcing efforts.

13 Explicit vs. Implicit Information
All of the previous databases are really good at identifying explicit information. But what about common sense implicit information? Consider the following small KB with three entities and two facts.

14 Does Obama live in the US?
If we ran the following query, the KB would check for the relation liveIn(Obama, US) and not find it. So it would return a null result or no.

15 Knowledge Expansion But we know this isn’t entirely right. Obama living in the white house is subsumed by Obama living in the US and one can infer using transitivity that Obama must live in the US. Adding additional knowledge to the KB through the use of inference rules is known as “Knowledge Expansion” and puts us on the road to Wisdom.

16 Inferring New Facts Markov Network First Order Logic
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

17 Markov Networks Smoking Cancer Asthma Cough Smoking Cancer Ф(S,C)
False 4.5 True 2.7

18 Markov Networks Smoking Cancer Asthma Cough Weight of Feature i

19 First Order Logic Fact A Fact B Fact A ^ Fact B Fact C

20 First Order Logic isA(Luke, Jedi) memberOf(Luke, Rebel Alliance)

21 First Order Logic isAlliedWith(Han, Luke) ^
memberOf(Luke, Rebel Alliance) memberOf(Han, Rebel Alliance)

22 First Order Logic isAlliedWith(X, Y) ^ memberOf(Y, Z) memberOf(X, Z)

23 Soft Rules vs. Hard Rules
bornIn(X, Y) ^ locatedIn(Y, Z) bornIn(X, Z)

24 Soft Rules vs. Hard Rules
bornIn(X, Y) ^ locatedIn(Y, Z) bornIn(X, Z) HARD

25 Soft Rules vs. Hard Rules
bornIn(X, Y) ^ locatedIn(Y, Z) bornIn(X, Z) HARD friendOf(X, Y) ^ friendOf(Y, Z) friendOf(X, Z)

26 Soft Rules vs. Hard Rules
bornIn(X, Y) ^ locatedIn(Y, Z) bornIn(X, Z) HARD friendOf(X, Y) ^ friendOf(Y, Z) friendOf(X, Z) SOFT

27 Soft Rules vs. Hard Rules
bornIn(X, Y) ^ locatedIn(Y, Z) bornIn(X, Z) HARD friendOf(X, Y) ^ friendOf(Y, Z) friendOf(X, Z) SOFT MLN Basic Idea: Give every formula a weight (higher weight  stronger constraint)

28 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) hasLightsaber(X) -> memberOf(X, Rebels)

29 Building a Markov Network
Nodes = all possible instantiations of a predicate Edge between two nodes iff they appear together in some formula

30 Han (H) Luke (L) Rebels (R) Empire (E) memberOf(X, Z) ^ memberOf(Y, Z) -> alliedWith(X, Y) 8.5

31 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)

32 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)

33 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)

34 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)

35 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)

36 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)

37 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)

38 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) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R)

39 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) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R)

40 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) hasLightsaber(X) -> memberOf(X, Rebels) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R)

41 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) hasLightsaber(X) -> memberOf(X, Rebels) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R) hasLightSaber(L) hasLightSaber(H)

42 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) hasLightsaber(X) -> memberOf(X, Rebels) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R) hasLightSaber(L) hasLightSaber(H)

43 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) hasLightsaber(X) -> memberOf(X, Rebels) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R) hasLightSaber(L) hasLightSaber(H)

44 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) hasLightsaber(X) -> memberOf(X, Rebels) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R) hasLightSaber(L) hasLightSaber(H)

45 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) hasLightsaber(X) -> memberOf(X, Rebels) 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)

46 Probability of Possible World

47 Probability of Possible World

48 Probability of Possible World
Weight of formula i No. of true groundings of formula i in x

49 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) hasLightsaber(X) -> memberOf(X, Rebels) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) memberOf(L, R) memberOf(H, R) hasLightSaber(L) hasLightSaber(H)

50 Inference in MLNs MAP Inference: Find the most likely possible world given some evidence

51 Inference in MLNs MAP Inference: Find the most likely possible world given some evidence

52 Solved with MaxWalkSAT
Inference in MLNs MAP Inference: Find the most likely possible world given some evidence Solved with MaxWalkSAT

53 Solved with MaxWalkSAT
Inference in MLNs MAP Inference: Find the most likely possible world given some evidence Solved with MaxWalkSAT Marginal Inference: Find the marginal distribution of a predicate (node) given all the others

54 MaxWalkSAT for i ← 1 to max-tries do
solution = random truth assignment for j ← 1 to max-flips do if ∑ weights(sat. clauses) > threshold then return solution c ← random unsatisfied clause with probability p flip a random variable in c else flip variable in c that maximizes ∑ weights(sat. clauses) return failure, best solution found

55 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) hasLightsaber(X) -> memberOf(X, Rebels) 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)

56 Fill in Observed Data 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) hasLightsaber(X) -> memberOf(X, Rebels) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) Knowledge Base: memberOf(Luke, Rebels) memberOf(Han, Rebels) hasLightSaber(Luke) ~memberOf(Luke, Empire) 1 memberOf(L, R) memberOf(H, R) 1 hasLightSaber(L) hasLightSaber(H) 1 Fill in Observed Data

57 Find Missing Data 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) hasLightsaber(X) -> memberOf(X, Rebels) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) Knowledge Base: memberOf(Luke, Rebels) memberOf(Han, Rebels) hasLightSaber(Luke) ~memberOf(Luke, Empire) ? ? 1 memberOf(L, R) memberOf(H, R) 1 hasLightSaber(L) hasLightSaber(H) 1 ? Find Missing Data

58 Initialization Assignment
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) hasLightsaber(X) -> memberOf(X, Rebels) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) Knowledge Base: memberOf(Luke, Rebels) memberOf(Han, Rebels) hasLightSaber(Luke) ~memberOf(Luke, Empire) 1 memberOf(L, R) memberOf(H, R) 1 hasLightSaber(L) hasLightSaber(H) 1 Initialization Assignment

59 Flip One At Random 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) hasLightsaber(X) -> memberOf(X, Rebels) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) Knowledge Base: memberOf(Luke, Rebels) memberOf(Han, Rebels) hasLightSaber(Luke) ~memberOf(Luke, Empire) 1 memberOf(L, R) memberOf(H, R) 1 hasLightSaber(L) hasLightSaber(H) 1 Flip One At Random

60 Flip One At Random 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) hasLightsaber(X) -> memberOf(X, Rebels) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) Knowledge Base: memberOf(Luke, Rebels) memberOf(Han, Rebels) hasLightSaber(Luke) ~memberOf(Luke, Empire) 1 1 memberOf(L, R) memberOf(H, R) 1 hasLightSaber(L) hasLightSaber(H) 1 Flip One At Random

61 Flip One At Random 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) hasLightsaber(X) -> memberOf(X, Rebels) memberOf(L, E) alliedWith(H, L) alliedWith(L, H) Knowledge Base: memberOf(Luke, Rebels) memberOf(Han, Rebels) hasLightSaber(Luke) ~memberOf(Luke, Empire) 1 1 1 memberOf(L, R) memberOf(H, R) 1 hasLightSaber(L) hasLightSaber(H) 1 1 Flip One At Random

62 Learning in MLNs Data is a relational database or knowledge base
memberOf(Luke, Rebels) hasLightSaber(Luke) memberOf(Han, Rebels) ~memberOf(Luke, Empire)

63 Learning in MLNs Data is a relational database or knowledge base
Learning parameters (weights) Similar to learning weights for Markov networks Knowledge Base: memberOf(Luke, Rebels) hasLightSaber(Luke) memberOf(Han, Rebels) ~memberOf(Luke, Empire)

64 Learning in MLNs Data is a relational database or knowledge base
Learning parameters (weights) Similar to learning weights for Markov networks Learning structure (formulas) Inductive logic programming Knowledge Base: memberOf(Luke, Rebels) hasLightSaber(Luke) memberOf(Han, Rebels) ~memberOf(Luke, Empire)

65 Learning Weights via Max-Likelihood
No. of times clause i is true in data Expected no. times clause i is true according to MLN

66 Alchemy (Open Source Software)
Full first-order logic syntax Inference (MAP and marginal probabilities) Lifted Inference Weight Learning (generative and discriminative) Structure Learning Large set of tutorials for learning Information extraction, social network modeling, entity resolution alchemy.cs.washington.edu

67 Current Problem: Scale to Large 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 A knowledge base is any collection of such facts, but what we’re really concerned with is the domain of large-scale KBs. These are created either through automated scraping of data or large crowdsourcing efforts.


Download ppt "An Introduction to Markov Logic Networks in Knowledge Bases"

Similar presentations


Ads by Google