Natural Language Generation Ling 571 Fei Xia Week

  • Slides: 37
Download presentation
Natural Language Generation Ling 571 Fei Xia Week 8: 11/17/05

Natural Language Generation Ling 571 Fei Xia Week 8: 11/17/05

Outline • NLG basics – – What is NLG? Example NLG systems Applications of

Outline • NLG basics – – What is NLG? Example NLG systems Applications of NLG Architecture for NLG • Three subtasks of NLG – Document planning – Microplanning – Surface realization

NLG basics

NLG basics

What is NLG? • Definition (Mc. Donald 1992): the process of deliberately constructing a

What is NLG? • Definition (Mc. Donald 1992): the process of deliberately constructing a NL text in order to meet specified communicative goals. • Input: non-linguistic representation of info • Output: text, hypertext, speech

NLU vs. NLG • NLU: ambiguity, ill-formed input • NLG: choice Meaning NLU Text

NLU vs. NLG • NLU: ambiguity, ill-formed input • NLG: choice Meaning NLU Text NLG Text

NLG system #1: Fo. G • Fo. G: Forecast Generator • Input: weather map

NLG system #1: Fo. G • Fo. G: Forecast Generator • Input: weather map • Output: textual weather report in English and French • Developer: Co. Gen Tex • Status: in operational use since 1992

NLG system #2: Sum. Time-Mousam • • • Fo. G: Forecast Generator Input: weather

NLG system #2: Sum. Time-Mousam • • • Fo. G: Forecast Generator Input: weather data Output: textual weather report in English Developer: University of Aberdeen Status: Used by one company to generate weather forecasts for offshore oil rigs. • Demo

NLG System #3: STOP • Input: Questionnaire about smoking attitudes, history, beliefs • Output:

NLG System #3: STOP • Input: Questionnaire about smoking attitudes, history, beliefs • Output: a personalized smoking-cessation leaflet • Developer: University of Aberdeen • Demo: non-tailored letter, questionnaire, a tailored letter. • Status: undergoing clinical evaluation

Applications of NLG • Automated document production: – Weather forecasts, letters, …. • •

Applications of NLG • Automated document production: – Weather forecasts, letters, …. • • • Dialogue systems: e. g. , ELIZA Text summarization Machine translation Question Answering ….

El. IZA system • H: My head hurts • E: Why do you say

El. IZA system • H: My head hurts • E: Why do you say your head hurts? • H: My mother hates me. • E: Who else in your family hates you? • H: *******. • E: Tell me more about it. • H: What should I do? • E: That’s a tough decision. • H: ****? • E: Does that question interest you?

ELIZA system (cont) • The famous 1966 computer system by Joseph Weizenbaum, which acted

ELIZA system (cont) • The famous 1966 computer system by Joseph Weizenbaum, which acted as a therapist • Named after “Eliza Doolittle” in in Shaw's Pygmalion (“My fair lady”). • Use pattern matching rules • Very successful: prompt him to write a book to explain the limits of computers

Challenges of NLG • Decide what to say and how to say it. •

Challenges of NLG • Decide what to say and how to say it. • The output has to be well-formed text. – Orthography, morphology, syntax – Reference, word choice, pragmatics • Example: weather report

Component tasks in NLG • Content determination: what content to express • Document structuring:

Component tasks in NLG • Content determination: what content to express • Document structuring: how to structure the info to make a coherent text. • Aggregation: combine units in a document plan tree. • Lexicalization: what words to use? • Referring expression generation: NP or pronoun? • Structure realization: add markups • Linguistic realization: tense, aspect, voice, …

Tasks and modules in NLG Document Planning Content determination Document structuring Microplanning Aggregation Lexicalization

Tasks and modules in NLG Document Planning Content determination Document structuring Microplanning Aggregation Lexicalization Referring expression generation Surface Linguistic realization realisation Structure Realization

A pipelined architecture Communicative goal Knowledge base Grammar …. Document Planning Document plan Microplanning

A pipelined architecture Communicative goal Knowledge base Grammar …. Document Planning Document plan Microplanning Text Specification Surface realization Text

Another architecture Knowledge base Communicative Goal Discourse Planner Discourse specification Surface Realizer NL output

Another architecture Knowledge base Communicative Goal Discourse Planner Discourse specification Surface Realizer NL output

Outline • NLG basics – – What is NLG? Example NLG systems Applications of

Outline • NLG basics – – What is NLG? Example NLG systems Applications of NLG Architecture for NLG • Three subtasks of NLG – Document planning – Microplanning – Surface realization

Document planning • Content determination: – What is important? – a domain-dependent expert-system-like task.

Document planning • Content determination: – What is important? – a domain-dependent expert-system-like task. – Ex: Weather summary: • This Nov was very dry. • The temperature was lower. • Document structuring: – Use RST or other discourse theory

Document plan tree Nucleus Msg 1 Nucleus (sequence) Satellite (Elaboration) Satellite (contrast) Msg 3

Document plan tree Nucleus Msg 1 Nucleus (sequence) Satellite (Elaboration) Satellite (contrast) Msg 3 Msg 2 …

Microplanning • Aggregation • Lexicalization • Referring expression generation

Microplanning • Aggregation • Lexicalization • Referring expression generation

Aggregation • Combinations can be on the basis of – Information content – Possible

Aggregation • Combinations can be on the basis of – Information content – Possible forms of realization • Some possibilities: – Conjunction – Ellipsis – Embedding –…

Aggregation via conjunction • Without aggregation: – Light rain fell on the 6 th.

Aggregation via conjunction • Without aggregation: – Light rain fell on the 6 th. – Light rain fell on the 8 th. • With Aggregation: – Light rain fell on the 6 th and light rain fell on the 8 th. (conjunction) – Light rain fell on the 6 th and the 8 th.

Aggregation via embedding • Without aggregation: – November had a rainfall of 20 mm.

Aggregation via embedding • Without aggregation: – November had a rainfall of 20 mm. – November normally is the wettest month. • With aggregation: – November, which normally is the wettest month, had a rainfall of 20 mm this year. – Although November is the wettest month, this November had a rainfall of only 20 mm.

Aggregation strategies • Conform to genre conventions and rules, and take account of pragmatic

Aggregation strategies • Conform to genre conventions and rules, and take account of pragmatic goals: – Ex: making sentences shorter for poor readers • Observe structural properties: – Ex: aggregate only messages that are siblings in the document plan tree.

An aggregation rule S Nucleus Msg 1 Satellite (contrast) Msg 2 S Conj although

An aggregation rule S Nucleus Msg 1 Satellite (contrast) Msg 2 S Conj although S S Msg 2 Msg 1

Lexicalization • The process of choosing words to communicate the info in messages •

Lexicalization • The process of choosing words to communicate the info in messages • When several lexicalizations are possible, consider: – User knowledge and preference – Consistency with previous usage: sometimes, it is better to vary lexemes – Pragmatics

Examples • Light rain • A small amount of rain • It is encouraging

Examples • Light rain • A small amount of rain • It is encouraging that you have many reasons to stop. • It’s good that you have a lot of reasons to stop.

Referring expression generation • How do we identify specific objects and entities? • Two

Referring expression generation • How do we identify specific objects and entities? • Two cases: – Initial introduction of an object – Subsequence references to an already mentioned object.

Initial reference A few options: • Use a full name: John Smith • Relate

Initial reference A few options: • Use a full name: John Smith • Relate to an entity that is already salient – One of Dr. Klein’s patients – The person who came to the clinic yesterday

Subsequence reference Some possibilities: • Pronouns: He is very determined. • Definite NPs: This

Subsequence reference Some possibilities: • Pronouns: He is very determined. • Definite NPs: This person is very determined. • Proper names: John is very talented.

Choosing referring expressions • Some suggestions from the literature: – Use a pronoun if

Choosing referring expressions • Some suggestions from the literature: – Use a pronoun if it refers to an entity mentioned in the previous clause, and there is no other entity in the previous clause that this pronoun could refer to. – Otherwise, use a name (a short one if possible) – Otherwise, use a definite NP.

Choosing referring expressions (cont) • Considering genre conventions and the context • Ex: –

Choosing referring expressions (cont) • Considering genre conventions and the context • Ex: – Nov 2005 – November – This month

Surface realization • Goal: to convert text specification into actual text. • Structural realization:

Surface realization • Goal: to convert text specification into actual text. • Structural realization: e. g. , add html markup • Linguistics realization: – – Insert function words Choose correct inflection Order words within a sentence Add punctuation

Linguistics realization • Systemic Grammar • Functional unification grammar • Ex: – Input: (:

Linguistics realization • Systemic Grammar • Functional unification grammar • Ex: – Input: (: action rain : tense past : time November : degree little) – Output: it rained little in November

Summary • NLG basics – – What is NLG? Example NLG systems Applications of

Summary • NLG basics – – What is NLG? Example NLG systems Applications of NLG Architecture for NLG • Three subtasks of NLG – Document planning – Microplanning – Surface realization

Beyond text generation • Flat text • Structured text: itemized lists, section, chapter, ….

Beyond text generation • Flat text • Structured text: itemized lists, section, chapter, …. • Text and graphics: e. g. , picture with caption • Speech • ….

Resources • SIGGEN (ACL special interest group for Generation): www. siggen. org • Book:

Resources • SIGGEN (ACL special interest group for Generation): www. siggen. org • Book: “Building NLG systems” by Reiter et. al. , Cambridge University Press, 2000. • List of NLG systems: • Companies: – Co. Gen. Tex: www. cogentex. com – ERLI: www. erli. com