XMG for TAGs and IGs An Example-Based Presentation Joseph Le Roux - - PowerPoint PPT Presentation

xmg for tags and igs
SMART_READER_LITE
LIVE PREVIEW

XMG for TAGs and IGs An Example-Based Presentation Joseph Le Roux - - PowerPoint PPT Presentation

XMG for TAGs and IGs An Example-Based Presentation Joseph Le Roux and Yannick Parmentier June 20, 2007 Introduction Users always want new features! Introduction Users always want new features! How to add a new type of information to


slide-1
SLIDE 1

XMG for TAGs and IGs

An Example-Based Presentation Joseph Le Roux and Yannick Parmentier June 20, 2007

slide-2
SLIDE 2

Introduction

◮ Users always want new features!

slide-3
SLIDE 3

Introduction

◮ Users always want new features! ◮ How to add a new type of information to XMG?

slide-4
SLIDE 4

Introduction

◮ Users always want new features! ◮ How to add a new type of information to XMG? ◮ It depends on what is to be added:

slide-5
SLIDE 5

Introduction

◮ Users always want new features! ◮ How to add a new type of information to XMG? ◮ It depends on what is to be added:

◮ Extending a Data Structure ◮ e.g. polarised features

slide-6
SLIDE 6

Introduction

◮ Users always want new features! ◮ How to add a new type of information to XMG? ◮ It depends on what is to be added:

◮ Extending a Data Structure ◮ e.g. polarised features ◮ Extending the Solver ◮ e.g. colours and other principles

slide-7
SLIDE 7

Introduction

◮ Users always want new features! ◮ How to add a new type of information to XMG? ◮ It depends on what is to be added:

◮ Extending a Data Structure ◮ e.g. polarised features ◮ Extending the Solver ◮ e.g. colours and other principles ◮ Adding a New Dimension ◮ e.g. semantics, interface

slide-8
SLIDE 8

Outline

XMG Architecture Overview Core Language Example Extending a Data Structure Definition Changes in the Compiler Changes in the VM Extending the Solver Dynamic solver Example Principles Adding a Dimension Motivation Implemented Dimensions How to Add a New Dimension

slide-9
SLIDE 9

Outline

XMG Architecture Overview Core Language Example Extending a Data Structure Definition Changes in the Compiler Changes in the VM Extending the Solver Dynamic solver Example Principles Adding a Dimension Motivation Implemented Dimensions How to Add a New Dimension

slide-10
SLIDE 10

XMG Architecture

XMG software:

slide-11
SLIDE 11

XMG Architecture

XMG software:

Compiler

in: a metagrammar (classes, DCG)

  • ut: S-Code
slide-12
SLIDE 12

XMG Architecture

XMG software:

Compiler

in: a metagrammar (classes, DCG)

  • ut: S-Code

Virtual Machine

in: S-Code

  • ut: List of multi-dimensional descriptions
slide-13
SLIDE 13

XMG Architecture

XMG software:

Compiler

in: a metagrammar (classes, DCG)

  • ut: S-Code

Virtual Machine

in: S-Code

  • ut: List of multi-dimensional descriptions

Constraint Solver

in: α Description (1-dimension)

  • ut: α List
slide-14
SLIDE 14

The core language

◮ A language to combine tree fragments:

Class ::= Name → Content Content ::= Description | Name | Content ∨ Content | Content ∧ Content

slide-15
SLIDE 15

The core language

◮ A language to combine tree fragments:

Class ::= Name → Content Content ::= Description | Name | Content ∨ Content | Content ∧ Content

◮ A language to describe tree fragments:

Description ::= x → y | x →+ y | x →∗ y | x ≺ y | x ≺+ y | x ≺∗ y | x[f:E] | x(p:E) | x = y

slide-16
SLIDE 16

Example

SubjectCan → X [cat:s] Z ↓ [cat:n] Y [cat:v] Active → X [cat:s] Y ⋄ [cat:v] Intransitive → SubjectCan ∧ Active (∗)

slide-17
SLIDE 17

Example

SubjectCan → X [cat:s] Z ↓ [cat:n] Y [cat:v] Active → X [cat:s] Y ⋄ [cat:v] Intransitive → SubjectCan ∧ Active (∗) Intransitive → X [cat:s] Z ↓ [cat:n] ⋄Y [cat:v]

slide-18
SLIDE 18

Example

SubjectCan → X [cat:s] Z ↓ [cat:n] Y [cat:v] class SubjectCan declare ?X ?Y ?Z { <syn>{ node X [cat=s]; node Y [cat=v]; node Z [cat=n](mark=subst); X -> Y; X -> Z; Z >> Y } }

slide-19
SLIDE 19

Outline

XMG Architecture Overview Core Language Example Extending a Data Structure Definition Changes in the Compiler Changes in the VM Extending the Solver Dynamic solver Example Principles Adding a Dimension Motivation Implemented Dimensions How to Add a New Dimension

slide-20
SLIDE 20

Adding polarised features to XMG

◮ Goal: Generate Interaction Grammars ◮ Syntactic Structures: Polarised Tree Description ◮ We need polarised features:

slide-21
SLIDE 21

Adding polarised features to XMG

◮ Goal: Generate Interaction Grammars ◮ Syntactic Structures: Polarised Tree Description ◮ We need polarised features:

◮ x[f:E] ⇒ x[f,pol,E] ◮ pol ∈ {=, +, −, ≈}

slide-22
SLIDE 22

Changes in the Compiler

This modification consists in:

  • 1. adding new syntactic constructions to the parser for

features node N[cat =+ n, funct =- X, gen = Y, num=~ Z]

slide-23
SLIDE 23

Changes in the Compiler

This modification consists in:

  • 1. adding new syntactic constructions to the parser for

features node N[cat =+ n, funct =- X, gen = Y, num=~ Z]

  • 2. checking the AST (features vs. properties)
slide-24
SLIDE 24

Changes in the Compiler

This modification consists in:

  • 1. adding new syntactic constructions to the parser for

features node N[cat =+ n, funct =- X, gen = Y, num=~ Z]

  • 2. checking the AST (features vs. properties)

Now, a feature is (feat, (val, pol))

slide-25
SLIDE 25

Changes in the VM

Engine.unify: unify((val1,pol1),E1,(val2,pol2),E2) ⇒ unify(val1,E1,val2,E2) unify(pol1,E1,pol2,E2)

slide-26
SLIDE 26

Changes in the VM

Engine.unify: unify((val1,pol1),E1,(val2,pol2),E2) ⇒ unify(val1,E1,val2,E2) unify(pol1,E1,pol2,E2)

◮ Idea: A New Class Polarity with method unify ◮ Objects manage their own unification: no need for a new

method in the engine

slide-27
SLIDE 27

Changes in the VM

Engine.unify: unify((val1,pol1),E1,(val2,pol2),E2) ⇒ unify(val1,E1,val2,E2) unify(pol1,E1,pol2,E2)

◮ Idea: A New Class Polarity with method unify ◮ Objects manage their own unification: no need for a new

method in the engine

◮ New Data Structure = New Class + unify

slide-28
SLIDE 28

Outline

XMG Architecture Overview Core Language Example Extending a Data Structure Definition Changes in the Compiler Changes in the VM Extending the Solver Dynamic solver Example Principles Adding a Dimension Motivation Implemented Dimensions How to Add a New Dimension

slide-29
SLIDE 29

Architecture of the TAG Solver

◮ Goal: Constrain admissible structures

slide-30
SLIDE 30

Architecture of the TAG Solver

◮ Goal: Constrain admissible structures ◮ Tree Descriptions → Trees

slide-31
SLIDE 31

Architecture of the TAG Solver

◮ Goal: Constrain admissible structures ◮ Tree Descriptions → Trees ◮ Syntactic dimension:

◮ Tree Solver: t ◮ Additional Solvers, aka Principles: p1, . . . , pn

slide-32
SLIDE 32

Architecture of the TAG Solver

◮ Goal: Constrain admissible structures ◮ Tree Descriptions → Trees ◮ Syntactic dimension:

◮ Tree Solver: t ◮ Additional Solvers, aka Principles: p1, . . . , pn

We build a solver s from t and a selection of pi

slide-33
SLIDE 33

The Tree Solver

Each node in the input description is associated with an integer. initNodes for each node (x) we partition the other nodes: equal, above, below, or on its sides:

Eq Up Down Left Right Ni

x

::= node( Eq: {ints} Up: {ints} Down: {ints} Left: {ints} Right: {ints})

slide-34
SLIDE 34

Tree Solver

◮ posCstr The input description is converted into relation

constraints on node sets. For instance, the dominance relation x → y can be translated as:

Ni

x→ Nj y ≡ [Ni x.EqUp ⊆ Nj y.Up ∧ Ni x.Down ⊇ Nj y.EqDown

∧ Ni

x.Left ⊆ Nj y.Left ∧ Ni x.Right ⊆ Nj y.Right]

slide-35
SLIDE 35

Tree Solver

◮ posCstr The input description is converted into relation

constraints on node sets. For instance, the dominance relation x → y can be translated as:

Ni

x→ Nj y ≡ [Ni x.EqUp ⊆ Nj y.Up ∧ Ni x.Down ⊇ Nj y.EqDown

∧ Ni

x.Left ⊆ Nj y.Left ∧ Ni x.Right ⊆ Nj y.Right]

◮ Ni x.Down ⊇ Nj y.EqDown

slide-36
SLIDE 36

Principles

This framework can be extended to solve specific constraints. The idea:

  • 1. extension of the node representation (tuple fields),
  • 2. definition of additional constraints on these fields.
slide-37
SLIDE 37

Principles: Colour

Resource/Need mechanism: semi-automatic Node-merging

slide-38
SLIDE 38

Principles: Colour

Resource/Need mechanism: semi-automatic Node-merging

◮ Red nodes cannot unify. ◮ Black nodes may unify with white nodes. ◮ White nodes must unify with black nodes

slide-39
SLIDE 39

Principles: Colour

Resource/Need mechanism: semi-automatic Node-merging

◮ Red nodes cannot unify. ◮ Black nodes may unify with white nodes. ◮ White nodes must unify with black nodes

  • 1. extension of the node representation: we add a field RB
  • 2. definition of additional constraints on these fields:

x ∈ Black ⇒ RBx = x x ∈ White ⇒ RBx ∈ Black x ∈ Red ⇒ RBx = x ∧ Eqx = {x} x → y ⇒ RBx = RBy

slide-40
SLIDE 40

Principle API

◮ A principle is an object with methods:

◮ args: new solver attributes ◮ init: internal initialisation ◮ initNodes: additional initialisation of the nodes (new

fields)

◮ postCstr: additional constraints

slide-41
SLIDE 41

Principle API

◮ A principle is an object with methods:

◮ args: new solver attributes ◮ init: internal initialisation ◮ initNodes: additional initialisation of the nodes (new

fields)

◮ postCstr: additional constraints

◮ A solver is an object made from several principles, with the

same methods.

slide-42
SLIDE 42

Principle API

◮ A principle is an object with methods:

◮ args: new solver attributes ◮ init: internal initialisation ◮ initNodes: additional initialisation of the nodes (new

fields)

◮ postCstr: additional constraints

◮ A solver is an object made from several principles, with the

same methods.

◮ DescriptionSolver: function that applies a strategy to

a solver to get solutions. (TAG or IG)

slide-43
SLIDE 43

Principle API

◮ A principle is an object with methods:

◮ args: new solver attributes ◮ init: internal initialisation ◮ initNodes: additional initialisation of the nodes (new

fields)

◮ postCstr: additional constraints

◮ A solver is an object made from several principles, with the

same methods.

◮ DescriptionSolver: function that applies a strategy to

a solver to get solutions. (TAG or IG) This solution eases the developement of new principles.

slide-44
SLIDE 44

Outline

XMG Architecture Overview Core Language Example Extending a Data Structure Definition Changes in the Compiler Changes in the VM Extending the Solver Dynamic solver Example Principles Adding a Dimension Motivation Implemented Dimensions How to Add a New Dimension

slide-45
SLIDE 45

New dimension?

◮ New Information = New Type of Description

slide-46
SLIDE 46

New dimension?

◮ New Information = New Type of Description ◮ New Information = New Dimension

Class ::= Name → Content Content ::= Dimension += Description | Name | Content ∨ Content | Content ∧ Content

slide-47
SLIDE 47

New dimension?

◮ New Information = New Type of Description ◮ New Information = New Dimension

Class ::= Name → Content Content ::= Dimension += Description | Name | Content ∨ Content | Content ∧ Content

◮ Formally: DCG → EDCG

◮ each dimension has its own accumulator ◮ dimensions share variables

slide-48
SLIDE 48

New dimension?

◮ New Information = New Type of Description ◮ New Information = New Dimension

Class ::= Name → Content Content ::= Dimension += Description | Name | Content ∨ Content | Content ∧ Content

◮ Formally: DCG → EDCG

◮ each dimension has its own accumulator ◮ dimensions share variables

◮ XMG: <syn>, <sem>, <dyn>

slide-49
SLIDE 49

Semantic Dimension

XMG includes a semantic representation language based on Flat Semantics: Description ::= ℓ:p(E1, ..., En) | ¬ℓ:p(E1, ..., En) | Ei ≪ Ej

◮ ℓ:p(E1, ..., En):

◮ predicate p ◮ parameters E1, .., En ◮ label ℓ (and negation ¬)

◮ Ei ≪ Ej: scope

slide-50
SLIDE 50

Interface

◮ 2 Goals:

◮ Lexicon interface (anchoring, hypertags) ◮ Syntax / Semantic Interface

slide-51
SLIDE 51

Interface

◮ 2 Goals:

◮ Lexicon interface (anchoring, hypertags) ◮ Syntax / Semantic Interface

◮ Only 1 Data Structure: AVM

slide-52
SLIDE 52

Interface

◮ 2 Goals:

◮ Lexicon interface (anchoring, hypertags) ◮ Syntax / Semantic Interface

◮ Only 1 Data Structure: AVM ◮ For historical reasons, interfaces are appended to the

syntax dimension

slide-53
SLIDE 53

Hypertags

Example: class ProperNoun declare ?Gen ?Num ?Fun { <syn> { node [cat =+ np, funct =- Fun, gen = Gen, num = Num, pers = @{2,3}] } } Result: cat -> np funct <- ? gen = <1>? num = <2>? pers = 2 | 3

slide-54
SLIDE 54

Hypertags

Example: class ProperNoun declare ?Gen ?Num ?Fun { <syn> { node [cat =+ np, funct =- Fun, gen = Gen, num = Num, pers = @{2,3}] }=*[head=[cat = np, gen = Gen, num = Num]] } Result: cat -> np funct <- ? gen = <1>? num = <2>? pers = 2 | 3 head = cat = np gen = <1>? num = <2>?

slide-55
SLIDE 55

Syntax / Semantic

◮ Example: Intransitive: Subject: Active: 1-ary relation: S NP↓[idx=X] VP l0:Rel(X) [arg0=X] [subjIdx=X]

S NP↓[idx=I] VP [subjIdx=I]

S VP ∧ l0:Rel(A) [arg0=A] ◮ Variables are shared across dimensions. ◮ More on this later (Claire)

slide-56
SLIDE 56

Adding a new Dimension

◮ XMG: It’s hard!

◮ Modify the parser:

<dim>{...}

◮ Modify the Engine (tweak the dreadful Engine.oz) ◮ Add a New Solver (or not)

slide-57
SLIDE 57

Adding a new Dimension

◮ XMG: It’s hard!

◮ Modify the parser:

<dim>{...}

◮ Modify the Engine (tweak the dreadful Engine.oz) ◮ Add a New Solver (or not)

◮ XMG2: It will be easy!

slide-58
SLIDE 58

Conclusion

◮ More and more linguistic information

slide-59
SLIDE 59

Conclusion

◮ More and more linguistic information ◮ XMG manage different types of information

slide-60
SLIDE 60

Conclusion

◮ More and more linguistic information ◮ XMG manage different types of information ◮ Extensibility partially achieved (new DS, principles)

slide-61
SLIDE 61

Conclusion

◮ More and more linguistic information ◮ XMG manage different types of information ◮ Extensibility partially achieved (new DS, principles) ◮ Problem: New Dimension

slide-62
SLIDE 62

Conclusion

◮ More and more linguistic information ◮ XMG manage different types of information ◮ Extensibility partially achieved (new DS, principles) ◮ Problem: New Dimension

Moral of the story: Extensibility is a key point for grammar developement system.