building conversational agents in oz

19
The CURRENT Platform: Building Conversational Agents in Oz * Torbjörn Lager Fredrik Kronlid Department of Linguistics University of Göteborg

Upload: nirmala-last

Post on 28-Aug-2014

363 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Building Conversational Agents In Oz

The CURRENT Platform:Building Conversational Agents

in Oz*

Torbjörn LagerFredrik Kronlid

Department of LinguisticsUniversity of Göteborg

Page 2: Building Conversational Agents In Oz

2

Conversational Software Agents

Software we can ‘talk’ with, in natural language

Examples Eliza (Weizenbaum 1966) Question-answering systems (e.g. on the web) Spoken dialog systems (for reserving train tickets,

etc.) Intelligent homes / cars / appliances HAL (in the movie 2001)

Page 3: Building Conversational Agents In Oz

3

We want to build agents that are…

able to ‘perceive’, ‘think’ and ‘act’ at the same time

capable of incremental processing of natural language

sensitive to the presence of other conversational software agents

making use of sophisticated, state-of-the-art methods for NLP

Question: Can Oz be of any help here?

Page 4: Building Conversational Agents In Oz

4

The CURRENT Platform An abstract characterization of what it means to

be a conversational agent. A ‘visual’ IDE supporting the building of

conversational agents by constructing a graphical representation of a network of NLP components on a canvas.

A number of ready-made NLP components such as lexica, taggers and parsers for a variety of languages, and dialogue managers for a variety of tasks.

A number of libraries supporting the implementation of other such NLP components.

Page 5: Building Conversational Agents In Oz

5

An Abstract Characterization of Conversational Agents

Simplifying considerably, a conversational agent is an interactive and incremental transducer of an input stream of words into an output stream of words, accompanied by an evolving internal state.

Clarifications Interactive means that the transducer is able to accept

external input, as well as output (intermediate) responses, during the course of a transduction

One agent – one transduction

Inspiration Peter Wegner’s work on Turing machines vs. Interaction

machines

Page 6: Building Conversational Agents In Oz

6

Very abstract indeed… …but can be directly implemented in Oz, since

Streams are provided as basic building blocks, transducers working on streams are no harder to

implement than transducers working on lists or strings, and if transducers are run in their own thread(s),

incrementality, and thus interactivity, comes for free!

Declarative concurrency – “… gives the same results as a sequential program but can give them incrementally… ” (van Roy and Haridi, Chapter 4)

Page 7: Building Conversational Agents In Oz

7

CURRENT Agent = Network of Components

An agent is a network of components – sources, sinks, transducers, splitters and mergers – connected by streams.

Each component runs in its own thread(s) Since each component is incremental, so

is the whole network.

Page 8: Building Conversational Agents In Oz

8

Component Technologies Form-based dialogue management Transformation-based tagging Pattern-matching over streams of records Deep parsing + compositional logical

semantics The information-state approach to

dialogue management (Larsson, 2002) …

Page 9: Building Conversational Agents In Oz

9

Form-Based Dialogue Management

Script specifies forms consisting of form items such as input fields and blocks of executable content

Input fields may be associated with grammars that specify what the user can say

Prompts specify the system’s response. Prompts may be tapered.

When a script is interpreted (by the FIA) the user is prompted for values of fields in order. But mixed initiative dialogue, as well as task switching, is also supported.

FIA raises events e.g. in case of no input, or input that does not match the grammar associated with the field.

Events may be handled, e.g. by jumping to another form that initiates (say) a clarification dialogue. (‘Jumping’ in the ‘state machine’ sense.)

The assignment of values to fields may trigger actions, e.g. a database lookup.

Page 10: Building Conversational Agents In Oz

Example VoiceXML Script<form id="get_from_and_to_cities"> <grammar src="http://www.directions.example.com/grammars/from_to.grxml" type="application/srgs+xml"/> <block> Welcome to the Driving Directions By Phone. </block> <initial name="bypass_init"> <prompt> Where do you want to drive from and to? </prompt> <nomatch count="1"> Please say something like "from Atlanta Georgia to Toledo Ohio". </nomatch> <nomatch count="2"> I'm sorry, I still don't understand. I'll ask you for information one piece at a time. <assign name="bypass_init" expr="true"/> <reprompt/> </nomatch> </initial> <field name="from_city"> <grammar src="http://www.directions.example.com/grammars/city.grxml" type="application/srgs+xml"/> <prompt>From which city are you leaving?</prompt> </field> <field name="to_city"> <grammar src="http://www.directions.example.com/grammars/city.grxml" type="application/srgs+xml"/> <prompt>Which city are you going to?</prompt> </field></form>

Page 11: Building Conversational Agents In Oz

Corresponding CURRENT FIA Script

class $ from DM.form feat id: getFromAndToCities test: match(con([opt(sym('from')) sym(nil label:fromCity) sym(to) sym(nil label:toCity)])) items: [class $ from DM.block feat todo: prompt('Welcome to the Driving Distance Service.') end class $ from DM.initial feat name: bypassInit todo: prompt('Where do you want to drive from and to?') meth nomatch() if {self nomatchCount($)}==1 then {self prompt('Please say something like "from Oslo to Kiel".')} else {self prompt('I\'m sorry, I still don\'t understand. '# 'I\'ll ask you for info one piece at a time.')} {self assign(name:bypassInit expr:true)} {self reprompt()} end end end class $ from DM.field feat name: fromCity todo: prompt('From which city are you leaving? ') test: match(sym(nil label:fromCity)) end class $ from DM.field feat name: toCity todo: prompt('Which city are you going to? ') test: match(sym(nil label:toCity)) end ]end

Page 12: Building Conversational Agents In Oz

12

Demo

Page 13: Building Conversational Agents In Oz

13

Transformation-Based Tagging

Rule-based disambiguation method invented by Eric Brill (1995)

Rules may be machine learned For part-of-speech tagging, unknown-word

guessing, phrase chunking, word sense disambiguation, dialogue act recognition, etc.

Useful also in a dialogue system setting? Yes, but only if it can be made to process input in an incremental fashion

Page 14: Building Conversational Agents In Oz

14

Incremental Part-of-Speech Tagging

The part-of-speech tagging problem The light went off, so I will light a candle. Pass me

the light bag, please. No, the light blue one. Incremental part-of-speech tagging

At t1: The/DET … At t2: The/DET light/? … At t3: The/DET light/ADJ bag/NOUN …

Word-by-word incremental POS tagging is not possible, but nearly word-by-word incremental POS tagging is, and that’s sufficient.

Page 15: Building Conversational Agents In Oz

15

Implementation Each rule is compiled into a stream

transducer, running in a separate thread Incremental but with accuracy as if run in

batch Several hundred rules several hundred

streams and several hundred threads... Performance still OK.

Page 16: Building Conversational Agents In Oz

16

Pattern Matching over Streams of Records

Condition–action rules Conditions: Labelled regular expression pattern

matching over the input stream of records Actions: Update out-stream with records

Method inspired by Appelt’s CPSL and by JAPE (part of the GATE NLP platform - Cunningham et al.). Rules are interpreted rather than compiled into

FSMs Works on streams and in an incremental fashion

For keyword spotting, phrase chunking, named entity recognition, ‘semantic parsing’

Page 17: Building Conversational Agents In Oz

17

Implementation Regular expression matcher implemented

LP-style, using the choice construct in combination with a search engine

Roughly 200 lines of code Slow, but sufficient for dialogue

processing

Page 18: Building Conversational Agents In Oz

18

Demo

Page 19: Building Conversational Agents In Oz

19

Summary: Important Oz Features

Concurrency, for building agents that are able to ‘perceive’, ‘think’ and ‘act’ at the same time

Concurrency + streams, for building agents that are capable of incremental processing of natural language

Concurrency + streams + ports, for allowing us to specify the `toplevel' transducer as a network of components, e.g. for building multi-modal conversational agents (modality fusion/fission)

All kinds of Oz features, for building agents using sophisticated, state-of-the-art methods for NLP

Network-transparent distribution, for building multi-party dialogue systems