+ All Categories
Home > Documents > A Natural Language Database Interface using Fuzzy...

A Natural Language Database Interface using Fuzzy...

Date post: 19-Nov-2019
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
51
A Natural Language Database Interface using Fuzzy Semantics http://richard.bergmair.eu/ ...wild speculation about the nature of truth, and other equally unscientific endeavours.
Transcript
Page 1: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

A Natural Language Database Interface using Fuzzy Semantics

http://richard.bergmair.eu/

...wild speculation aboutthe nature of truth, and other

equally unscientific endeavours.

Page 2: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Acknowledgmentsthanks for supervising the project!

Ann Copestake (Cambridge)

thanks for reading related manuscripts!Ted Briscoe (Cambridge)Daniel Osherson (Princeton)

thanks for helping with the fuzzy logic!Ulrich Bodenhofer (JKU Linz)

thanks for participating in the experiment!

MPhil students 05/06, NLIP Group, RMRS-list, personal friends

Page 3: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)
Page 4: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

MotivationPlace “a city” name, “San Francisco” pop, “big city”, “small city” wet, “dry city”, “rainy city” temp, “hot city”, “cold city”

distance “near”, “far from” citya, cityb, km

Page 5: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Motivation

a small city near San Francisco

What does small'(x) mean in terms of population? What does near'(x,y) mean in terms of distance?

How do we deal with the vagueness involved in small and near ?

(Zadeh)

Page 6: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)
Page 7: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Outline

putting fuzzy semantics to use in closed domain question answering

vagueness and fuzzy semantics

fuzzy logic as a generalization of bivalent logic

Page 8: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Bivalent Logic

In classical logic: A is a set on domain X iff ∃ characteristic function χ

A:X→{0,1}

such that χA(x)=1 iff xϵA

b

Page 9: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Logic

In fuzzy logic: A is a set on domain X iff ∃ characteristic function μ

A:X→[0,1] such

that μA(x) is a degree of membership.

l u

(Zadeh)

Page 10: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Characteristic Functions

κ(x)

1

old(x)

x.year

1965 1995

Page 11: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Database Interface

SELECT  x.*,  hot(x.temp)∧dry(x.rainfall) AS muFROM  place xWHERE  mu > 0ORDER BY mu DESC

hot dry city

Page 12: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Database InterfaceSELECT   x.*, z.*, y.*,   small(x)∧near(z) AS muFROM  place x,  refnear z,  place yWHERE  x.placeid = z.placeid AND  z.fkplaceid = y.placeid AND  y.name = 'San Francisco' AND  mu > 0ORDER BY mu DESC

small city near San Francisco

Page 13: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Database Interface

SELECT   x.*, z.*, y.*,   dry(x)∧near(z)∧rainy(y) AS muFROM  place x,  refnear z,  place yWHERE  x.placeid = z.placeid AND  z.fkplaceid = y.placeid AND  mu > 0ORDER BY mu DESC

dry city near a rainy city

Page 14: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

ArchitectureLDM

is used byldmtool

DB

ERG Lexicongenerates

CLM

LKB

is a part of

is run by

uses

ERG

generates

NLIDexp

is used by

is used by

usesis used by

is used by

is used by

Page 15: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

MotivationPlace “a city” name, “San Francisco” pop, “big city”, “small city” wet, “dry city”, “rainy city” temp, “hot city”, “cold city”

distance “near”, “far from” citya, cityb, km

Page 16: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Linguistic Data ModellingLEXENT adv {  STEM "rather";  TYPE "adv_degree_spec_le";};

ENTITY place {

  LEXENT noun {    STEM "city";    TYPE "n_intr_le";    ONSET "con";  };

  PK placeid;

  GEN nb "#noun";

  INTAT lat;  INTAT long;

INTAT temp {    LEXENT adj {      STEM "hot";      TYPE "adj_intrans_le";      ONSET "con";    };    LEXENT adj {      STEM "cold";      TYPE "adj_intrans_le";      ONSET "con";    };    GEN ap "#adv #adj";    GEN nb "#ap #noun";    DSCR "If a city had ayear­round      average <B>temperature of      #temp</B> degrees celsius, it      would be natural to call it a      <B>#ap</B> city.";       };};

Page 17: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Linguistic Data ModellingENTITY place {  ...  INTAT temp { ... };  STRAT(10) type;  ID(100) placename {    TYPE "n_proper_city_le";    ONSET "con";  };  REFERENCE refnear TO MANY place {    INTAT distance {          LEXENT near {        STEM "near";          TYPE "p_reg_le";          ONSET "con";          REL "_NEAR_P_REL";        };      DSCR "If a city was a distance ..."    };  };}

Page 18: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

ArchitectureLDM

is used byldmtool

DB

ERG Lexicongenerates

CLM

LKB

is a part of

is run by

uses

ERG

generates

NLIDexp

is used by

is used by

usesis used by

is used by

is used by

Page 19: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Language & Logicdry city near a rainy city

dry(x1)∧city(x

1)∧

rainy(x2)∧city(x

2)∧

near(x1,x

2)SELECT

   x1.*, x1x2.*, x2.*,   dry(x1)∧near(x1x2)∧rainy(x2) AS muFROM  place x1,  refnear x1x2,  place x2WHERE  ...

Page 20: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Language & Logicdry city near a rainy city

dry(x1)∧city(x

1)∧

rainy(x2)∧city(x

2)∧

near(x1,x

2)SELECT

   x1.*, x1x2.*, x2.*,   dry(x1)∧near(x1x2)∧rainy(x2) AS muFROM  place x1,  refnear x1x2,  place x2WHERE  ...

Page 21: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

ArchitectureLDM

is used byldmtool

DB

ERG Lexicongenerates

CLM

LKB

is a part of

is run by

uses

ERG

generates

NLIDexp

is used by

is used by

usesis used by

is used by

is used by

Page 22: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Outline

putting fuzzy semantics to use in closed domain question answering

vagueness and fuzzy semantics

fuzzy logic as a generalization of bivalent logic

Page 23: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Semantics Experiment

If a city had a year-round average temperature of 12 degrees celsius, it would be natural to call it a cold city: (yes/no)

If a skyscraper had 78 floors it would be natural to call it a rather tall skyscraper: (yes/no)

...

Page 24: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Semantics Experiment

70000

bald(x)

x.hair

Page 25: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

cities domain

N=26 N=26

N=25 N=26

N=23

Page 26: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

cities domain (cont'd)

N=18 N=18

N=13 N=13

Page 27: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

skyscrapers domain

N=14 N=14

N=13 N=13

Page 28: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Linguistic Data ModellingLEXENT adv {  STEM "rather";  TYPE "adv_degree_spec_le";};

ENTITY place {

  LEXENT noun {    STEM "city";    TYPE "n_intr_le";    ONSET "con";  };

  PK placeid;

  GEN nb "#noun";

  INTAT lat;  INTAT long;

INTAT temp {    LEXENT adj {      STEM "hot";      TYPE "adj_intrans_le";      ONSET "con";    };    LEXENT adj {      STEM "cold";      TYPE "adj_intrans_le";      ONSET "con";    };    GEN ap "#adv #adj";    GEN nb "#ap #noun";    DSCR "If a city had ayear­round      average <B>temperature of      #temp</B> degrees celsius, it      would be natural to call it a      <B>#ap</B> city.";       };};

Page 29: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

ArchitectureLDM

is used byldmtool

DB

ERG Lexicongenerates

CLM

LKB

is a part of

is run by

uses

ERG

generates

NLIDexp

is used by

is used by

usesis used by

is used by

is used by

Page 30: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Semantics ExperimentWhat does this tell us aboutFuzzy Semantics?

1. Membership can clearly be judged as nonincreasing or nondecreasing.

...consistent with the observations about most predicates – but not all due to mistakes in the experimental setup.

Page 31: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Semantics Experiment

What does this tell us aboutFuzzy Semantics?

2. A “region of fuzzy membership” can always be clearly identified and distinguished from a region of crisp membership.

...turned out to be tricky to test.

Page 32: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Semantics Experiment

κ(x)

κ(x)

Page 33: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Semantics Experiment

κ(x)

κ(x)

Page 34: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Semantics Experiment

2. A “region of fuzzy membership” can always be clearly identified and distinguished from a region of crisp membership.

...consistent with the observations about most predicates – but not all due to mistakes in the experimental setup.

Page 35: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Semantics ExperimentWhat does this tell us aboutFuzzy Semantics?

3. Decision boundaries as well as fuzzy sets may be contradictory across speakers, but are always consistent for each speaker in isolation.

Clearly consistent with observations!

Page 36: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Ordering-based Semantics

0 150000

bald(x)

x.hair

0 150000

bald(x)

x.hair

Page 37: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)
Page 38: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

MotivationPlace “a city” name, “San Francisco” pop, “big city”, “small city” wet, “dry city”, “rainy city” temp, “hot city”, “cold city”

distance “near”, “far from” citya, cityb, km

Page 39: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

ArchitectureLDM

is used byldmtool

DB

ERG Lexicongenerates

CLM

LKB

is a part of

is run by

uses

ERG

generates

NLIDexp

is used by

is used by

usesis used by

is used by

is used by

Page 40: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Outline

putting fuzzy semantics to use in closed domain question answering

vagueness and fuzzy semantics

fuzzy logic as a generalization of bivalent logic

Page 41: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy LogicLet A,B,C be fuzzy sets on X. ThenC = A ∩ B with μ

C(x)=μ

A(x)∧μ

B(x) iff

∧:[0,1]x[0,1]→[0,1] with

(1) a∧b = b∧a(2) a∧(b∧c) = (a∧b)∧c(3) a≤b ⇒ (a∧c)≤(b∧c)(4) a∧1 = a

These functions are known astriangular norms.

(see Klement)

Page 42: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Logic

standard triangular norms:

∧M(x,y) = min(x,y)

∧P(x,y) = x*y

∧L(x,y) = max(x+y-1,0)

∧D(x,y) = x if y=1, y if x=1, 0 othw.

Page 43: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Logic

Gödel logic is the logic induced by the minimum t-norm:

x∧y = min(x,y) x∨y = max(x,y) ¬x = 1-x

Page 44: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Logic

Product logic is the logic induced by the product t-norm:

x∧y = x*y x∨y = x+y-x*y ¬x = 1-x

Page 45: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Logic

Łucasiewicz logic is the logic induced by the Łucasiewicz t-norm:

x∧y = max(x+y-1,0) x∨y = min(x+y,1) ¬x = 1-x

Page 46: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy N-grams, regular lg.

μL(⟨x

1,...,x

K⟩)= μ(x

i,x

i+1,x

i+N)∧

i=1

K-N

fuzzy n-grams

μL(⟨x

1,...,x

K⟩)= μ

δ(s(i),s(i+1))∧μs(i+1)(xi+1

)∨∧i=1

K-1

fuzzy regular languages

S

(Gaines & Kohout,Doostfatemeh et al, etc.)

Page 47: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy context-free lg.

μL(⟨x

1,...,x

J⟩)= μ(d

i,C(⟨d

1,...,d

i⟩))

fuzzy context-free languages

...and so on, up the Chomsky hierarchy.

∨ ∧i=1

K

⟨d1,...,d

K⟩

(Lee & Zadeh,Carter et al.)

Page 48: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Language Models

Well this is a nice generalization...

...but is there a linguisticreality to this? ...

Work on inducing FCFGs from the SUSANNE corpus by Carter et. al(disappointing results)

...for syntax I don't see one.

Page 49: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Semantics...for semantics, denotations are hard to define using probability densities.

0 150000

bald(x)

x.hair

x.hair = 76273bald(x) = ?

Page 50: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

Fuzzy Semantics

...and independence assumptionsare difficult to justify.

Syntax:l1:cold(x

1), l

2:rainy(x

2), l

3:town(x

3)

l1=l

2,l

2=l

3,x

1=x

2,x

2=x

3

Semantics:l1:cold(x

1), l

1:rainy(x

1), l

1:town(x

1)

independence holds!

independence does not hold!

Page 51: A Natural Language Database Interface using Fuzzy Semanticsrichard.bergmair.eu/pub/mphil-slides-berlin.pdf · Acknowledgments thanks for supervising the project! Ann Copestake (Cambridge)

A Natural Language Database Interface using Fuzzy Semantics

http://richard.bergmair.eu/

...wild speculation aboutthe nature of truth, and other

equally unscientific endeavours.


Recommended