Date post: | 28-Aug-2014 |
Category: |
Technology |
Upload: | nirmala-last |
View: | 361 times |
Download: | 1 times |
The CURRENT Platform:Building Conversational Agents
in Oz*
Torbjörn LagerFredrik Kronlid
Department of LinguisticsUniversity of Göteborg
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)
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?
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.
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
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)
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.
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) …
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.
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>
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
12
Demo
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
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.
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.
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’
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
18
Demo
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