natural language generation martin hassel kth nada royal institute of technology 100 44 stockholm...

29
Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin @nada. kth .se

Upload: elfrieda-thompson

Post on 19-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

Natural Language Generation

Martin HasselKTH NADA

Royal Institute of Technology100 44 Stockholm+46-8-790 66 34

[email protected]

Page 2: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

2Martin Hassel

What Is Natural Language Generation?

A process of constructing a natural language output from non linguistic inputs that maps meaning to text.

Page 3: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

3Martin Hassel

Related Simple Text Generation

• Canned text• Ouputs predefined text

• Template filling• Outputs predefined text with predefined

variable words/phrases

Page 4: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

4Martin Hassel

Areas of UseNLG techniques can be used to:• generate textual weather forecasts from

representations of graphical weather maps• summarize statistical data extracted from a

database or spreadsheet • explain medical info in a patient-friendly way • describe a chain of reasoning carried out by an

expert system• paraphrase information in a diagram for

inexperienced users

Page 5: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

5Martin Hassel

Goals of a NLG System

To supply text that is:• correct and relevant information

• non redundant

• suiting the needs of the user• in an understandable form• in a correct form

Page 6: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

6Martin Hassel

Choices for NLG

• Content selection• Lexical selection• Sentence structure

• Aggregation• Referring expressions• Orthographic realisation

• Discourse structure

Page 7: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

7Martin Hassel

Example Architecture

Discourse SpecificationDiscourse Specification

Knowledge BaseKnowledge BaseCommunicative GoalCommunicative Goal

Natural Language OutputNatural Language Output

Discourse PlannerDiscourse Planner

Surface RealizerSurface Realizer

Page 8: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

8Martin Hassel

Discourse Planner

1. Text shemata• Use consistent patterns of discourse structure

2. Rhetorical Relations• Uses the Rhetorical Structure Theory• Used for varied generation tasks

Page 9: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

9Martin Hassel

Discourse Planner –Text Schemata

• Augmented Transition Network (ATN)• Uses a set of internal states and transitions• Produces texts with a rigid structure

• i.e. recipes, directions, technical instructions

Page 10: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

10Martin Hassel

Discourse Planner – Augmented Transition Network

Page 11: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

11Martin Hassel

Discourse Planner – Augmented Transition Network Example output:Save the document: First, choose the save option from the file menu. This causes the system to display the Save-As dialog box. Next, choose the destination folder and type the filename. Finally, press the save button. This causes the system to save the document.

Page 12: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

12Martin Hassel

Discourse Planner –Rhetorical Relations

Rhetorical Structure Theory(Mann & Thompson 1988)

• Nucleus• Multi-nuclear

• Satellite

Page 13: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

13Martin Hassel

Discourse Planner –Rhetorical Relations

23 rhetorical relations, among these:• Elaboration• Contrast• Condition• Purpose• Sequence• Result

Page 14: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

14Martin Hassel

Discourse Planner –Rhetorical Relations

Rethorical annotation:

Page 15: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

15Martin Hassel

Discourse Planner –Rhetorical Relations

The resulting RST tree corpus:(SATELLITE(SPAN|4||19|)(REL2PAR ELABORATION-ADDITIONAL)

(SATELLITE(SPAN|4||7|)(REL2PAR CIRCUMSTANCE)

(NUCLEUS(LEAF|4|)(REL2PAR CONTRAST)

(TEXT _!THE PACKAGE WAS TERMED EXCESSIVE BY THE BUSH |ADMINISTRATION,_!|))

(NUCLEUS(SPAN|5||7|)(REL2PAR CONTRAST)

(NUCLEUS(LEAF|5|)(REL2PAR SPAN)

(TEXT _!BUT IT ALSO PROVOKED A STRUGGLE WITH INFLUENTIAL CALIFORNIA LAWMAKERS_!))

Page 16: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

16Martin Hassel

Surface Realisation

1. Systemic Grammar• Represents sentences as collections of functions• Using functional categorization

2. Functional Unification Grammar• Builds generation grammar as a feature structure• Using functional categorization

Page 17: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

17Martin Hassel

Surface Realisation – Systemic Grammar

• Emphasises the functional organisation of language

• Surface forms are viewed as the consequences of selecting a set of abstract functional features

• Choices correspond to minimal grammatical alternatives

• The interpolation of an intermediate abstract representation allows the specification of the text to accumulate gradually

Page 18: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

18Martin Hassel

Surface Realisation – Systemic Grammar

• Uses multiple layers• Mood, Transivity, Theme

• Meta-functions• Interpersonal meta-function (mood)• Ideational meta-function (transivity)• Textual meta-function (theme)

• Grammar represented as a system network• Directed, acyclic and/or graph

Page 19: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

19Martin Hassel

Surface Realisation – Systemic Grammar

Present-ParticiplePast-Participle

Infinitive

Polar

Wh-Imperative

Indicative

Declarative

InterrogativeMajor

Minor

Mood

Bound Relative

Page 20: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

20Martin Hassel

Surface Realisation – Systemic Grammar

Clause Choices• Major indicative declarative:

The cat is on the mat.• Major indicative declarative relative:

[He didn’t see the cat] that chased the rat.• Major indicative declarative bound:

[It only hurts] when I laugh.• Major indicative interrogative polar:

Has anybody seen my seagull?• Major imperative:

Don’t be ridiculous.• Minor present-participle:

[You’ll enjoy] having more free time.

Page 21: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

21Martin Hassel

Surface Realisation –Functional Unification Grammar

Basic idea: • Input specification in the form of a

FUNCTIONAL DESCRIPTION, a recursive <attribute,value> matrix

• The grammar is a large functional description with alternations representing choice points

• Realisation is achieved by unifying the input FD with the grammar FD

Page 22: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

22Martin Hassel

Surface Realisation –Functional Unification Grammar((cat clause) (process ((type composite) (relation possessive) (lex ‘hand’))) (participants ((agent ((cat pers_pro) (gender feminine))) ((affected Œ((cat np) (lex ‘editor’))) ((possessor Œ)) ((possessed ((cat np) (lex ‘draft’)))))

She hands the draft to the editor.

Page 23: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

23Martin Hassel

Microplanners 1

• Lexical selection• Syntactic realization• Morphological realization• Orthographic realization

Page 24: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

24Martin Hassel

Microplanners 2Referring Expression Generation

• Referring expression generation is concerned with how we describe domain entities in such a way that the hearer will know what we are talking about

• Major issue is avoiding ambiguity• Fluency pulls in the opposite direction

Page 25: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

25Martin Hassel

Kinds of Referring Expressions

• Proper names• Aberdeen, Scotland• Aberdeen

• Definite Descriptions• the train that leaves at 10am• the next train

• Pronouns• she• it

Page 26: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

26Martin Hassel

Microplanners 3Aggregation

Some possibilities:• Simple conjunction• Ellipsis• Set introduction

Page 27: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

27Martin Hassel

Aggregation

Without aggregation:• The next train is the Caledonian Express.• It leaves at 10AM.

With Simple Conjunction :• The next train is the Caledonian Express, and it

leaves at 10AM.

Without aggregation:• It leaves at 10AM.• It arrives at 12.30PM.

With ellipsis:• It leaves at 10AM, and Ø arrives at 12.30PM.

Page 28: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

28Martin Hassel

Aggregation

Without aggregation:• It has a snack bar.• It has a restaurant car.

With set introduction :• It has {a snack bar, a restaurant car}.• It has a snack bar and a restaurant car.

Caution! Need to avoid changing the meaning:• John bought a TV and Bill bought a TV.• John and Bill bought a TV.

Page 29: Natural Language Generation Martin Hassel KTH NADA Royal Institute of Technology 100 44 Stockholm +46-8-790 66 34 xmartin@nada.kth.se

29Martin Hassel

Further Reading

• Siggen• http://www.dynamicmultimedia.com.au/siggen/

• Allen 1995: Natural Language Understanding • http://www.uni-giessen.de/~g91062/Seminare/gk-cl/

Allen95/al1995co.htm