Top Banner
Computer languages for representing grammatical information an introduction to X MG Benoit Crabbé Lattice — Université Paris 7 Computer languages for representing grammatical information 1
22

Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Jul 28, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Computer languages for representing grammaticalinformation

an introduction to XMG

Benoit Crabbé

Lattice — Université Paris 7

Computer languages for representing grammatical informat ion 1

Page 2: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Outline of the talk

We wish to identify the goals and the requirements of a “high level”language for representing grammatical information.

To do this :

We will introduce the main ideas of the XMG language (used for TAG andIG)Quick comparison with the XLE language of KDK04 and some others.Motivation : distinguish core problems of these languages from thosethat are TAG specific.

Framework : metagrammar = computer-only language dedicated toease the expression of computational grammars (without any theoreticalmotivation).

Computer languages for representing grammatical informat ion 2

Page 3: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

XMG where from ?

Initially designed to implement a large scale TAG grammar for French.(Mostly “Historical”) motivations :

No real large scale French grammar was available/usable.Designed to ease the implementation a large TAG capable of handlingsemantics.

Primary extensions / developments :Augmented to handle an additional TAG+ formalism :

Interaction grammars (Perrier 02)Augmented with semantics (Gardent and Parmentier)Used to implement multilingual grammars (German Korean Yiddish ?)

Computer languages for representing grammatical informat ion 3

Page 4: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Plan

Historical perspective :High level languages vs Low level language (ex. ANLT)Alternances and structure sharing in the “old languages” (PATR II)Tree Based formalisms : TAG (Becker’s metarules)

Major change since then (removing lexical rules)Current languages (goals, similarities, comparison)

Overview of the XMG languageOverview of the XLE language (KDK 04)How to be declarative ?

New Problems encountered :Naming !Interaction between modules

Computer languages for representing grammatical informat ion 4

Page 5: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

High Level vs Low Level languages ( ANLT)

from John Caroll’s Phd (1993), a reference GPSG implementation:A low level language :

Well defined (syntax and semantics) : interface with parsing algorithmse.g. CFG + atomic feature structures. . . coded on integers

A high level language (dubbed metagrammar as in GKPS) :Principles : Head Feature propagation, valency, slash (unbounded dependencies)+ metarules (allowing to express alternations such as active / passive)

Why two languages ?The low level language is interfaced with a parser and does not change. It lacks ofexpressivity for the linguist however.The high level language is more “sloppy”. It provides more expressive power to thelinguist.The high level language is more flexible : it may change according to the linguistneeds.

Computer languages for representing grammatical informat ion 5

Page 6: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Structure sharing and alternations (PATR II)

PATR II (Shieber 85 )How does high level languages look like ? The simplest high level languageComputer language without any theoretical goal.Data structure = feature structuresAllows to express :

Structure sharing (parametrized macros) : allow to implement inheritancehierarchiesVERB : < at> = vVERB-3RD-SING :�VERB<agr num> = singular<agr person> = 3Alternations (lexical rule: yields a new out passive entry from the in active entry )Passive :<out at> = <in at><out form > = past-prt<out subj> = <in obj><out obj> = <in subj>

Computer languages for representing grammatical informat ion 6

Page 7: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Tree Based formalisms at the low level ( TAG)

(a)

SN↓ Vmange

N↓

Jean mange des biscuitsJohn eats the cookies

(b)

SN↓ Vmangent

N↓

Les enfants mangent des biscuitsThe children eat the cookies

(c)

SN↓ V’

V↓ Vmangés

PPP

parN↓

Les biscuits sont mangés par les enfantsThe cookies are eaten by the children

(d)

SN↓ V’

Cl↓ Vmangés

Les enfants les ont mangésThe children have eaten them

(e)

SPP

Ppar

N↓

SN↓ V’

V↓ Vmangés

Par quels enfants les biscuits sont-ils mangés ?By which children do the cookies have been eaten ?

(a) is a canonical context(b) is a plural context(c) is a passivised context(d) is a clitic argument context(e) is a passivised context with whextraction

Computer languages for representing grammatical informat ion 7

Page 8: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Example TAG : high level apparatus (Becker 93)

Structure sharing : canonical trees are organised in an inheritance hierarchy (like PATR

macros)Metarules allow to express alternations ≈ transformations compiled offline prior toparsing restricted to a local domain) yielding additional elementary trees. (proceduraland shown to be undecidable)

S

N↓0 V N↓1

−→

S

N↓1 V PP

V V⋄mode=ppart P N↓0

être parLR-PASSIVE

S

V N↓

−→

S

V

Cl↓ VLR-CLITIC(OBJ)

Computer languages for representing grammatical informat ion 8

Page 9: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Nowadays : observations

Observations from the following bibliography :TAG : XMG stuffLFG : M. Dalrymple, R. Kaplan, and T.H. King, 2004, Linguistic Generalizations overDescriptions, Proceedings of the LFG’04 Conference. CSLI Publications. pp. 199-208.

Observation #1 : Similar devices if we abstract data structures (trees and features)Keep Shieber like macrosReject lexical rules (provide an alternative declarative device)

Observation #2 : Specific devices for tree based formalismsNaming ! (Tag, Hpsg)Interactions (Tag)

Problem faced Lexical rules = procedural device (allows to add, remove and updateinformation). Raise practical problems of rule ordering when developping non toygrammars

Solution : Suppress lexical rules and provide an alternative declarative device forexpressing the same information.

Computer languages for representing grammatical informat ion 9

Page 10: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

What for ? Goals of these languages

These are just computer languages driven towards implementation purposes.No theory behind : that’s up to the user to use the language and build its owntheory/grammar.

Goals/Requirements for such a language :To ease grammatical development The task of grammar development is not easy :the grammar writer has to use a langage as simple (and expressive) as possible. . .Factoring out information : Computational grammars are naturally expressed ina redundant fashion (low level language). One wants to capture generalisations inmodules.Content of a module : a module contains partial grammatical informationComposition : The language must supply an commutative associative operation forcombining the modules in order to ignore ordering issues.

Computer languages for representing grammatical informat ion 10

Page 11: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Modularisation

TAG = trees ; LFG = feature structures; HPSG = partially typed FS

Example (TAG) : Identifying a potential module :

S

N↓ V⋄ N↓

Jean mange des biscuitsJohn eats cookies

N

N* S

N↓ S

N↓ V⋄

Les biscuits que Jean mangeThe cookies that John eats

We wish to define a module that encapsulates an information otherwise copied overseveral units. To do this, each module receives a name :

CANONICAL SUBJECT →

S

N↓ V

Computer languages for representing grammatical informat ion 11

Page 12: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Combining modules

Using a “or” and an “and” (XLE, XMG)Example (XMG) :

(choice) of descriptions(1) Subject → CanonicalSubject ∨ RelativisedSubject

The subject is either canonical or relativised.The disjunction is a choice (nondeterministic interpretation)This implementation using a choice simulates an alternation expressed in the literatureby a lexical rule that would move a canonical subject to its relative counterpart in aderived structure. (See also HPSG : Controll)Conjunction of descriptions(2) IntransitiveVerb → Subject ∧ ActiveForm

A conjunction of descriptions is interpreted as the syntactic conjunction of two treedescription (logical formulae) where node names are renamed (TAG), or by unifyingfeature structures (LFG).

Computer languages for representing grammatical informat ion 12

Page 13: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Valuation of the grammar

Last step : Valuation of the grammar.This sums up to generate all the solutions of a (non recursive) logic programProvide a module as the axiom of a non recursive grammar and generate all the solutions. (tree descriptionscan be seen as the words of the language generated by that grammar)Sample axiom INTRANSITIVEVERB

IntransitiveVerb → Subject ∧ ActiveFormSubject → CanonicalSubject ∨ RelativisedSubject

S

N↓ VLe garçon. . .The boy. . .

∧S

V⋄dort

sleeps

S

N↓ V⋄Le garçon dortThe boy sleeps

N

N* S

N↓ V(Le garçon) qui. . .(The boy) who. . .

S

V⋄

dortsleeps

N

N* S

N↓ V⋄Le garçon qui dort

The boy who sleeps

Computer languages for representing grammatical informat ion 13

Page 14: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

So you said you were declarative. . .

Disjunction allows to manipulate tree sets.View lexical rules as operators that yield tree sets out of canonical treesThus :

S

N↓ V’ N↓

V⋄

Jean voit Marie

S

V’ N↓

V

−→

S

V’

Cl↓ VLR-CLITIC(OBJ)

S

N↓ V’

Cl↓ V⋄

Jean la voit

Is expressed in XMG as :

OBJ-CAN →

S

V’ N↓ OBJ-CL →

V’

Cl↓ V

Object → Obj-Can ∨ Obj-ClTreeSet → <The remaining of the tree> ∧ Object

Without having a canonical tree distinguished

Computer languages for representing grammatical informat ion 14

Page 15: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

A glance at the XLE language

Augmentation of PATR II for LFGStructure sharingFINITE-VB = ($ VFORM) = FINITEPRESENT-TENSE = ($ TENSE) = PRESPRESENT = �FINITE-VB�PRESENT-TENSE

AlternativesTRANSITIVE = ($ PRED) = P(SUBJ,OBJ)INTRANSITIVE = ($ PRED) = P(SUBJ)INTRANSITIVE-OR-TRANSITIVE = �TRANSITIVEor �INTRANSITIVEThey also use a negationDefaults

Computer languages for representing grammatical informat ion 15

Page 16: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Alternatives with type underspecification

Used in HPSG (e.g. LKB) and by Candito (TAG) (together with crossings)

framework : type organised in a partial order (semi-lattice)

To express alternations :Associate an underspecified type to a grammatical objectMaximise the types in an undeterministic fashion such that each object receiveseventually a maximal typeToy example :

object

Obj-Can Obj-Cl

Problem (Advantage ?): Mix between the expression of structure sharing and alternations

Computer languages for representing grammatical informat ion 16

Page 17: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Additional problems

Here are some new formal problems that have been raised only for some formalisms(those non based on feature structures)

Naming ( TAG, HPSG) several solutions :managing namespaces (Clergerie, XMG)coloring (XMG),partially specified types (Cohen-Sygal,Wintner)

Interaction between modules Some modules do interact with each other in somecircumstances.Extensibility ( XMG) See next talk.

Computer languages for representing grammatical informat ion 17

Page 18: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Naming problems

Naming problems appear to be similar for TAG (while combining partial trees) and HPSG

(partially specified types)A metagrammatical class défines its own namespaceFirst solution When two modules are combined, rename everythingExample : Combining two descriptions whose names are anonymous

X

W Z ∧

X

Z Y

This yields (enforcing root unicity of the tree, unification of category labels)

(a)

X

W Z Y (b)

X

W Z Z Y

Unsatisfactory : (a) and (b) are legal solutions, however we would like to keep only(a)

Computer languages for representing grammatical informat ion 18

Page 19: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Keep the names ?

Never rename anything

Only nodes with identical names can be merged (names written in subscript)

Solution used by (Candito) and (Xia)

Xa

Wb Zc

Xa

Zc Yd

X

W Z Y

Problems :Global naming (we lose almost the advantages of modularisation)Naming collisions that may entail tricky problems when combining a same module withitself during the process of generating a grammatical unit.

The binary operator ≈ has also been used to force identification between two nodes withdifferent names

We have solved the problem by adding additional constraints on the structures used todescribe the grammars : colors

Computer languages for representing grammatical informat ion 19

Page 20: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Intermediate solution (colors). . .

Colors : nodes are to be identified using a coloration schemeExample (Colors):

X•B

W•R Z•B

X◦W

Z◦W Y•R

X•B

W•R Z•B Y•R

Other possible solutions that may be considered ?Use a type system a la Cohen-Sygal Wintner insteadSome global names + an anonymous name (counterpart of the red color that wouldmean incompatibility). . .Use more sophisticated namespace management devices such as namespace importand export (XMG,MGCOMP). Makes the writing of the grammar more complicated ?

The naming problem is pretty hard. In case of TAG

(Expressive goal) TAG defines an extended domain of locality. One would like to beable to refer conveniently to any node in an elementary tree.(Practical goal) On the other hand we would like to localise names in the modules(basic principle of encapsulation)

Computer languages for representing grammatical informat ion 20

Page 21: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Second problem : module interactions

Example : French clitics (Similar problem to that of Perlmutter 1971 in GG)XMG solves this class of problems thanks to global constraints of tree well formedness.

1) Attach unary properties to the nodes (e.g. clitics’ rank)2) Express a well formation constraint (e.g. sibling nodes are to be ordered accordingto their rank)

S

N↓ V’≺+ ∧V’

Cl↓3 V≺+ ∧V’

Cl↓4 V≺+ ∧

S

V’

V⋄

|=

S

N↓ V’

Cl↓3 Cl↓4 V⋄

S

N↓ V’

Cl↓4 Cl↓3 V⋄

Computer languages for representing grammatical informat ion 21

Page 22: Computer languages for representing grammatical ...€¦ · Plan Historical perspective : High level languages vs Low level language (ex. ANLT) Alternances and structure sharing in

Conclusion and summary

High level grammatical representation languages share some common propertiesCore properties :

Allow to define named modules that are reusable n timesOperations for combining the modules :

allow to express composition and alternationsAssociative and commutative operations

The declarative description requires to describe tree sets as a whole withoutdistinguishing a specific canonical or base tree from which the other members of thetree set would be derived.They provide a valuation method that allows to compile the high level representationto the low level representation

Additional parameters :Naming problems : this suggest a parametric device that should be cutomisable for agiven formalismInteraction problems (Like clitics)

Computer languages for representing grammatical informat ion 22