prompt_front: You are given a scientific article and a question. Answer the question as concisely as you can, using a single phrase or sentence if possible. If the question cannot be answered based on the information in the article, write "unanswerable". If the question is a yes/no question, answer "yes", "no", or "unanswerable". Do not provide any explanation.

Please answer the questions based on the text provided below. What datasets are used?
Context 1: Introduction
Back to 42 BC, the philosopher Cicero has raised the issue that although there were many Oratory classes, there were none for Conversational skills BIBREF0   He highlighted how important they were not only for politics, but also for educational purpose  Among other conversational norms, he claimed that people should be able to know when to talk in a conversation, what to talk depending on the subject of the conversation, and that they should not talk about themselves 
Norms such as these may become social conventions and are not learnt at home or at school  Social conventions are dynamic and may change according to context, culture and language  In online communication, new commonsense practices are evolved faster and accepted as a norm BIBREF1 , BIBREF2   There is not a discipline for that on elementary or high schools and there are few linguistics researchers doing research on this field 
On the other hand, within the Artificial Intelligence area, some Conversational Systems have been created in the past decades since the test proposed by Alan Turing in 1950  The test consists of a machine's ability to exhibit intelligent behavior equivalent to, or indistinguishable from that of a human BIBREF3   Turing proposed that a human evaluator would judge natural language conversations between a human and a machine that is designed to generate human-like responses  Since then, many systems have been created to pass the Turing's test  Some of them have won prizes, some not BIBREF4   Although in this paper we do not focus on creating a solution that is able to build conversational systems that pass the Turing's test, we focus on NDS  From BIBREF5 , "NDS are systems that try to improve usability and user satisfaction by imitating human behavior"  We refer to Conversational Systems as NDS, where the dialogues are expressed as natural language texts, either from artificial intelligent agents (a k a  bots) or from humans 
That said, the current popular name to systems that have the ability to make a conversation with humans using natural language is Chatbot  Chatbots are typically used in conversational systems for various practical purposes, including customer service or information acquisition  Chatbots are becoming more widely used by social media software vendors  For example, Facebook recently announced that it would make Facebook Messenger (its 900-million-user messaging app by 2016), into a full-fledged platform that allows businesses to communicate with users via chatbots  Google is also building a new mobile-messaging service that uses artificial intelligence know-how and chatbot technology  In addition, according to the Wall Street Journal, there are more than 2 billion users of mobile apps  Still, people can be reluctant to install apps  So it is believed that social messaging can be a platform and chatbots may provide a new conversational interface for interacting with online services, as chatbots are easier to build and deploy than apps BIBREF6  
China seems to be the place where chatbots adoption and use is most advanced today  For example, China's popular WeChat messaging platform can take payments, scan QR codes, and integrate chatbot systems  WeChat integrates e-mail, chat, videocalls and sharing of large multimedia files  Users can book flights or hotels using a mixed, multimedia interaction with active bots  WeChat was first released in 2011 by Tecent, a Chinese online-gaming and social-media firm, and today more than 700 million people use it, being one of the most popular messaging apps in the world (The Economist 2016)  WeChat has a mixture of real-live customer service agents and automated replies (Olson 2016) 
Still, current existing chatbot engines do not properly handle a group chat with many users and many chatbots  This makes the chatbots considerably less social, which is a problem since there is a strong demand of having social chatbots that are able to provide different kinds of services, from traveling packages to finance advisors  This happens because there is a lack of methods and tools to design and engineer the coordination and mediation among chatbots and humans, as we present in Sections 2 and 3  In this paper, we refer to conversational systems that are able to interact with one or more people or chatbots in a multi-party chat as MPCS  Altogether, this paper is not meant to advance the state of the art on the norms for MPCS  Instead, the main contributions of this paper are threefold:
We then present some discussion and future work in the last section 
Challenges on Chattering
There are plenty of challenges in conversation contexts, and even bigger ones when people and machines participate in those contexts  Conversation is a specialized form of interaction, which follows social conventions  Social interaction makes it possible to inform, context, create, ratify, refute, and ascribe, among other things, power, class, gender, ethnicity, and culture BIBREF2   Social structures are the norms that emerge from the contact people have with others BIBREF7 , for example, the communicative norms of a negotiation, taking turns in a group, the cultural identity of a person, or power relationships in a work context 
Conventions, norms and patterns from everyday real conversations are applied when designing those systems to result in adoption and match user's expectations  BIBREF8 describes implicit interactions in a framework of interactions between humans and machines  The framework is based on the theory of implicit interactions which posits that people rely on conventions of interaction to communicate queries, offers, responses, and feedback to one another  Conventions and patterns drive our expectations about interactive behaviors  This framework helps designers and developers create interactions that are more socially appropriate  According to the author, we have interfaces which are based on explicit interaction and implicit ones  The explicit are the interactions or interfaces where people rely on explicit input and output, whereas implicit interactions are the ones that occur without user awareness of the computer behavior 
Social practices and actions are essential for a conversation to take place during the turn-by-turn moments of communication  BIBREF9 highlights that a distinguishing feature of ordinary conversation is "the local, moment-by-moment management of the distribution of turns, of their size, and what gets done in them, those things being accomplished in the course of each current speaker's turn " Management of turns and subject change in each course is a situation that occurs in real life conversations based on circumstances (internal and external) to speakers in a dialogue  Nowadays, machines are not prepared to fully understand context and change the course of conversations as humans  Managing dialogues with machines is challenging, which increases even more when more than one conversational agent is part of the same conversation  Some of those challenges in the dialogue flow were addressed by BIBREF10   According to them, we have system-initiative, user-initiative, and mixed-initiative systems 
In the first case, system-initiative systems restrict user options, asking direct questions, such as (Table TABREF5 ): "What is the initial amount of investment?" Doing so, those types of systems are more successful and easier to answer to  On the other hand, user-initiative systems are the ones where users have freedom to ask what they wish  In this context, users may feel uncertain of the capabilities of the system and starting asking questions or requesting information or services which might be quite far from the system domain and understanding capacity, leading to user frustration  There is also a mixed-initiative approach, that is, a goal-oriented dialogue which users and computers participate interactively using a conversational paradigm  Challenges of this last classification are to understand interruptions, human utterances, and unclear sentences that were not always goal-oriented 
The dialog in Table TABREF5 has the system initiative in a question and answer mode, while the one in Table TABREF7 is a natural dialogue system where both the user and the system take the initiative  If we add another user in the chat, then we face other challenges 
In Table TABREF12 , line 4, the user U1 invites another person to the chat and the system does not reply to this utterance, nor to utterances on lines 6, 7 and 8 which are the ones when only the users (wife and husband) should reply to  On the other hand, when the couple agrees on the period and initial value of the investment (line 9), then the system S1 (at the time the only system in the chat) replies indicating that it will invite more systems (chatbots) that are experts on this kind of pair INLINEFORM0 period, initial value INLINEFORM1   They then join the chat and start interacting with each other  At the end, on line 17, the user U2 interacts with U1 and they agree with the certificate option  Then, the chatbot responsible for that, S3, is the only one that replies indicating how to invest 
Table TABREF12 is one example of interactions on which the chatbots require knowledge of when to reply given the context of the dialog  In general, we acknowledge that exist four dimensions of understanding and replying to an utterance in MPCS which a chatbot that interacts in a multi-party chat group should fulfill:
In the next section we present the state of the art and how they fullfil some of these dimensions 
Conversational Systems
In this section we discuss the state of the art on conversational systems in three perspectives: types of interactions, types of architecture, and types of context reasoning  Then we present a table that consolidates and compares all of them 
ELIZA BIBREF11 was one of the first softwares created to understand natural language processing  Joseph Weizenbaum created it at the MIT in 1966 and it is well known for acting like a psychotherapist and it had only to reflect back onto patient's statements  ELIZA was created to tackle five "fundamental technical problems": the identification of critical words, the discovery of a minimal context, the choice of appropriate transformations, the generation of appropriate responses to the transformation or in the absence of critical words, and the provision of an ending capacity for ELIZA scripts 
Right after ELIZA came PARRY, developed by Kenneth Colby, who is psychiatrist at Stanford University in the early 1970s  The program was written using the MLISP language (meta-lisp) on the WAITS operating system running on a DEC PDP-10 and the code is non-portable  Parts of it were written in PDP-10 assembly code and others in MLISP  There may be other parts that require other language translators  PARRY was the first system to pass the Turing test - the psychiatrists were able to make the correct identification only 48 percent of the time, which is the same as a random guessing 
A L I C E  (Artificial Linguistic Internet Computer Entity) BIBREF12 appeared in 1995 but current version utilizes AIML, an XML language designed for creating stimulus-response chat robots BIBREF13   A L I C E  bot has, at present, more than 40,000 categories of knowledge, whereas the original ELIZA had only about 200  The program is unable to pass the Turing test, as even the casual user will often expose its mechanistic aspects in short conversations 
Cleverbot (1997-2014) is a chatbot developed by the British AI scientist Rollo Carpenter  It passed the 2011 Turing Test at the Technique Techno-Management Festival held by the Indian Institute of Technology Guwahati  Volunteers participate in four-minute typed conversations with either Cleverbot or humans, with Cleverbot voted 59 3 per cent human, while the humans themselves were rated just 63 3 per cent human BIBREF14  
Types of Interactions
Although most part of the research literature focuses on the dialogue of two persons, the reality of everyday life interactions shows a substantial part of multi-user conversations, such as in meetings, classes, family dinners, chats in bars and restaurants, and in almost every collaborative or competitive environment such as hospitals, schools, offices, sports teams, etc  The ability of human beings to organize, manage, and (mostly) make productive such complex interactive structures which are multi-user conversations is nothing less than remarkable  The advent of social media platforms and messaging systems such as WhatsApp in the first 15 years of the 21st century expanded our ability as a society to have asynchronous conversations in text form, from family and friends chatgroups to whole nations conversing in a highly distributed form in social media BIBREF15  
In this context, many technological advances in the early 2010s in natural language processing (spearheaded by the IBM Watson's victory in Jeopardy BIBREF16 ) spurred the availability in the early 2010s of text-based chatbots in websites and apps (notably in China BIBREF17 ) and spoken speech interfaces such as Siri by Apple, Cortana by Microsoft, Alexa by Amazon, and Allo by Google  However, the absolute majority of those chatbot deployments were in contexts of dyadic dialog, that is, a conversation between a single chatbot with a single user  Most of the first toolkits for chatbot design and development of this initial period implicit assume that an utterance from the user is followed by an utterance of the chatbot, which greatly simplifies the management of the conversation as discussed in more details later  Therefore, from the interaction point of view, there are two types: 1) one in which the chatbot was designed to chat with one person or chatbot, and 2) other in which the chatbot can interact with more than two members in the chat 
Dyadic Chatbot
A Dyadic Chatbot is a chatbot that does know when to talk  If it receives an utterance, it will always handle and try to reply to the received utterance  For this chatbot to behave properly, either there are only two members in the chat, and the chatbot is one of them, or there are more, but the chatbot replies only when its name or nickname is mentioned  This means that a dyadic chatbot does not know how to coordinate with many members in a chat group  It lacks the social ability of knowing when it is more suitable to answer or not  Also, note that we are not considering here the ones that would use this social ability as an advantage in the conversation, because if the chatbot is doing with this intention, it means that the chatbot was designed to be aware of the social issues regarding a chat with multiple members, which is not the case of a dyadic chatbot  Most existing chatbots, from the first system, ELIZA BIBREF11 , until modern state-of-the-art ones fall into this category 
Multiparty Conversations
In multiparty conversations between people and computer systems, natural language becomes the communication protocol exchanged not only by the human users, but also among the bots themselves  When every actor, computer or user, understands human language and is able to engage effectively in a conversation, a new, universal computer protocol of communication is feasible, and one for which people are extremely good at 
There are many differences between dyadic and multiparty conversations, but chiefly among them is turn-taking, that is, how a participant determines when it is appropriate to make an utterance and how that is accomplished  There are many social settings, such as assemblies, debates, one-channel radio communications, and some formal meetings, where there are clear and explicit norms of who, when, and for long a participant can speak 
The state of the art for the creation of chatbots that can participate on multiparty conversations currently is a combination of the research on the creation of chatbots and research on the coordination or governance of multi-agents systems  A definition that mixes both concepts herein present is: A chatbot is an agent that interacts through natural language  Although these areas complement each other, there is a lack of solutions for creating multiparty-aware chatbots or governed chatbots, which can lead to higher degree of system trust 
Multi-Dyadic Chatbots
Turn-taking in generic, multiparty spoken conversation has been studied by, for example, Sacks et al  BIBREF18   In broad terms, it was found that participants in general do not overlap their utterances and that the structure of the language and the norms of conversation create specific moments, called transition-relevance places, where turns can occur  In many cases, the last utterances make clear to the participants who should be the next speaker (selected-next-speaker), and he or she can take that moment to start to talk  Otherwise, any other participant can start speaking, with preference for the first starter to get the turn; or the current speaker can continue BIBREF18  
A key part of the challenge is to determine whether the context of the conversation so far have or have not determined the next speaker  In its simplest form, a vocative such as the name of the next speaker is uttered  Also, there is a strong bias towards the speaker before the current being the most likely candidate to be the next speaker 
In general the detection of transition-relevance places and of the selected-next-speaker is still a challenge for speech-based machine conversational systems  However, in the case of text message chats, transition-relevance places are often determined by the acting of posting a message, so the main problem facing multiparty-enabled textual chatbots is in fact determining whether there is and who is the selected-next-speaker  In other words, chatbots have to know when to shut up  Bohus and Horowitz BIBREF19 have proposed a computational probabilistic model for speech-based systems, but we are not aware of any work dealing with modeling turn-taking in textual chats 
Coordination of Multi-Agent Systems
A multi-agent system (MAS) can be defined as a computational environment in which individual software agents interact with each other, in a cooperative manner, or in a competitive manner, and sometimes autonomously pursuing their individual goals  During this process, they access the environment's resources and services and occasionally produce results for the entities that initiated these software agents  As the agents interact in a concurrent, asynchronous and decentralized manner, this kind of system can be categorized as a complex system BIBREF20  
Research in the coordination of multi-agent systems area does not address coordination using natural dialogue, as usually all messages are structured and formalized so the agents can reason and coordinate themselves  On the other hand, chatbots coordination have some relations with general coordination mechanisms of multi-agent systems in that they specify and control interactions between agents  However, chatbots coordination mechanisms is meant to regulate interactions and actions from a social perspective, whereas general coordination languages and mechanisms focus on means for expressing synchronization and coordination of activities and exchange of information, at a lower computational level 
In open multi-agent systems the development takes place without a centralized control, thus it is necessary to ensure the reliability of these systems in a way that all the interactions between agents will occur according to the specification and that these agents will obey the specified scenario  For this, these applications must be built upon a law-governed architecture 
Minsky published the first ideas about laws in 1987 BIBREF21   Considering that a law is a set of norms that govern the interaction, afterwards, he published a seminal paper with the Law-Governed Interaction (LGI) conceptual model about the role of interaction laws on distributed systems BIBREF22   Since then, he conducted further work and experimentation based on those ideas BIBREF23   Although at the low level a multiparty conversation system is a distributed system and the LGI conceptual model can be used in a variety of application domains, it is composed of abstractions basically related to low level information about communication issues of distributed systems (like the primitives disconnected, reconnected, forward, and sending or receiving of messages), lacking the ability to express high level information of social systems 
Following the same approach, the Electronic Institution (EI) BIBREF24 solution also provides support for interaction norms  An EI has a set of high-level abstractions that allow for the specification of laws using concepts such as agent roles, norms and scenes 
Still at the agent level but more at the social level, the XMLaw description language and the M-Law framework BIBREF25 BIBREF26 were proposed and developed to support law-governed mechanism  They implement a law enforcement approach as an object-oriented framework and it allows normative behavior through the combination between norms and clocks  The M-Law framework BIBREF26 works by intercepting messages exchanged between agents, verifying the compliance of the messages with the laws and subsequently redirecting the message to the real addressee, if the laws allow it  If the message is not compliant, then the mediator blocks the message and applies the consequences specified in the law, if any  They are called laws in the sense that they enforce the norms, which represent what can be done (permissions), what cannot be done (prohibitions) and what must be done (obligations) 
Coordinated Aware Chatbots in a Multiparty Conversation
With regard to chatbot engines, there is a lack of research directed to building coordination laws integrated with natural language  To the best of our knowledge, the architecture proposed in this paper is the first one in the state of the art designed to support the design and development of coordinated aware chatbots in a multiparty conversation 
Types of Architectures
There are mainly three types of architectures when building conversational systems: totally rule-oriented, totally data-oriented, and a mix of rules and data-oriented 
Rule-oriented
A rule-oriented architecture provides a manually coded reply for each recognized utterance  Classical examples of rule-based chatbots include Eliza and Parry  Eliza could also extract some words from sentences and then create another sentence with these words based on their syntatic functions  It was a rule-based solution with no reasoning  Eliza could not "understand" what she was parsing  More sophisticated rule-oriented architectures contain grammars and mappings for converting sentences to appropriate sentences using some sort of knowledge  They can be implemented with propositional logic or first-order logic (FOL)  Propositional logic assumes the world contains facts (which refer to events, phenomena, symptoms or activities)  Usually, a set of facts (statements) is not sufficient to describe a domain in a complete manner  On the other hand, FOL assumes the world contains Objects (e g , people, houses, numbers, etc ), Relations (e g  red, prime, brother of, part of, comes between, etc ), and Functions (e g  father of, best friend, etc ), not only facts as in propositional logic  Moreover, FOL contains predicates, quantifiers and variables, which range over individuals (which are domain of discourse) 
Prolog (from French: Programmation en Logique) was one of the first logic programming languages (created in the 1970s), and it is one of the most important languages for expressing phrases, rules and facts  A Prolog program consists of logical formulas and running a program means proving a theorem  Knowledge bases, which include rules in addition to facts, are the basis for most rule-oriented chatbots created so far 
In general, a rule is presented as follows: DISPLAYFORM0
Prolog made it possible to perform the language of Horn clauses (implications with only one conclusion)  The concept of Prolog is based on predicate logic, and proving theorems involves a resolute system of denials  Prolog can be distinguished from classic programming languages due to its possibility of interpreting the code in both a procedural and declarative way  Although Prolog is a set of specifications in FOL, it adopts the closed-world assumption, i e  all knowledge of the world is present in the database  If a term is not in the database, Prolog assumes it is false 
In case of Prolog, the FOL-based set of specifications (formulas) together with the facts compose the knowledge base to be used by a rule-oriented chatbot  However an Ontology could be used  For instance, OntBot BIBREF27 uses mapping technique to transform ontologies and knowledge into relational database and then use that knowledge to drive its chats  One of the main issues currently facing such a huge amount of ontologies stored in a database is the lack of easy to use interfaces for data retrieval, due to the need to use special query languages or applications 
In rule-oriented chatbots, the degree of intelligent behavior depends on the knowledge base size and quality (which represents the information that the chatbot knows), poor ones lead to weak chatbot responses while good ones do the opposite  However, good knowledge bases may require years to be created, depending on the domain 
Data-oriented
As opposed to rule-oriented architectures, where rules have to be explicitly defined, data-oriented architectures are based on learning models from samples of dialogues, in order to reproduce the behavior of the interaction that are observed in the data  Such kind of learning can be done by means of machine learning approach, or by simply extracting rules from data instead of manually coding them 
Among the different technologies on which these system can be based, we can highlight classical information retrieval algorithms, neural networks BIBREF28 , Hidden Markov Models (HMM) BIBREF29 , and Partially Observable Markov Decision Process (POMDP) BIBREF30   Examples include Cleverbot and Tay BIBREF31   Tay was a chatbot developed by Microsoft that after one day live learning from interaction with teenagers on Twitter, started replying impolite utterances  Microsoft has developed others similar chatbots in China (Xiaoice) and in Japan (Rinna)  Microsoft has not associated its publications with these chatbots, but they have published a data-oriented approach BIBREF32 that proposes a unified multi-turn multi-task spoken language understanding (SLU) solution capable of handling multiple context sensitive classification (intent determination) and sequence labeling (slot filling) tasks simultaneously  The proposed architecture is based on recurrent convolutional neural networks (RCNN) with shared feature layers and globally normalized sequence modeling components 
A survey of public available corpora for can be found in BIBREF33   A corpus can be classified into different categories, according to: the type of data, whether it is spoken dialogues, transcripts of spoken dialogues, or directly written; the type of interaction, if it is human-human or human-machine; and the domain, whether it is restricted or unconstrained  Two well-known corpora are the Switchboard dataset, which consists of transcripts of spoken, unconstrained, dialogues, and the set of tasks for the Dialog State Tracking Challenge (DSTC), which contain more constrained tasks, for instance the restaurant and travel information sets 
Rule and Data-oriented
The model of learning in current A L I C E  BIBREF13 is incremental or/and interactive learning because a person monitors the robot's conversations and creates new AIML content to make the responses more appropriate, accurate, believable, "human", or whatever he/she intends  There are algorithms for automatic detection of patterns in the dialogue data and this process provides the person with new input patterns that do not have specific replies yet, permitting a process of almost continuous supervised refinement of the bot 
As already mentioned, A L I C E  consists of roughly 41,000 elements called categories which is the basic unit of knowledge in AIML  Each category consists of an input question, an output answer, and an optional context  The question, or stimulus, is called the pattern  The answer, or response, is called the template  The two types of optional context are called that and topic  The keyword that refers to the robot's previous utterance  The AIML pattern language consists only of words, spaces, and the wildcard symbols "_" and "*"  The words may consist only of letters and numerals  The pattern language is case invariant  Words are separated by a single space, and the wildcard characters function like words, similar to the initial pattern matching strategy of the Eliza system  More generally, AIML tags transform the reply into a mini computer program which can save data, activate other programs, give conditional responses, and recursively call the pattern matcher to insert the responses from other categories  Most AIML tags in fact belong to this template side sublanguage BIBREF13  
AIML language allows:
Symbolic reduction: Reduce complex grammatical forms to simpler ones 
Divide and conquer: Split an input into two or more subparts, and combine the responses to each 
Synonyms: Map different ways of saying the same thing to the same reply 
Spelling or grammar corrections: the bot both corrects the client input and acts as a language tutor 
Detecting keywords anywhere in the input that act like triggers for a reply 
Conditionals: Certain forms of branching to produce a reply 
Any combination of (1)-(6) 
When the bot chats with multiple clients, the predicates are stored relative to each client ID  For example, the markup INLINEFORM0 set name INLINEFORM1 "name" INLINEFORM2 Matthew INLINEFORM3 /set INLINEFORM4 stores the string Matthew under the predicate named "name"  Subsequent activations of INLINEFORM5 get name="name" INLINEFORM6 return "Matthew"  In addition, one of the simple tricks that makes ELIZA and A L I C E  so believable is a pronoun swapping substitution  For instance:
U: My husband would like to invest with me 
S: Who else in your family would like to invest with you?
Types of Intentions
According to the types of intentions, conversational systems can be classified into two categories: a) goal-driven or task oriented, and b) non-goal-driven or end-to-end systems 
In a goal-driven system, the main objective is to interact with the user so that back-end tasks, which are application specific, are executed by a supporting system  As an example of application we can cite technical support systems, for instance air ticket booking systems, where the conversation system must interact with the user until all the required information is known, such as origin, destination, departure date and return date, and the supporting system must book the ticket  The most widely used approaches for developing these systems are Partially-observed Decision Processes (POMDP) BIBREF30 , Hidden Markov Models (HMM) BIBREF29 , and more recently, Memory Networks BIBREF28   Given that these approaches are data-oriented, a major issue is to collect a large corpora of annotated task-specific dialogs  For this reason, it is not trivial to transfer the knowledge from one to domain to another  In addition, it might be difficult to scale up to larger sets of tasks 
Non-goal-driven systems (also sometimes called reactive systems), on the other hand, generate utterances in accordance to user input, e g  language learning tools or computer games characters  These systems have become more popular in recent years, mainly owning to the increase of popularity of Neural Networks, which is also a data-oriented approach  The most recent state of the art to develop such systems have employed Recurrent Neural Networs (RNN) BIBREF34 , Dynamic Context-Sensitive Generation BIBREF35 , and Memory Networks BIBREF36 , just to name a few  Nevertheless, probabilistic methods such as Hidden Topic Markov Models (HTMM) BIBREF37 have also been evaluated  Goal-driven approach can create both pro-active and reactive chatbots, while non-goal-driven approach creates reactive chatbots  In addition, they can serve as a tool to goal-driven systems as in BIBREF28   That is, when trained on corpora of a goal-driven system, non-goal-driven systems can be used to simulate user interaction to then train goal-driven models 
Types of Context Reasoning
A dialogue system may support the context reasoning or not  Context reasoning is necessary in many occasions  For instance, when partial information is provided the chatbot needs to be able to interact one or more turns in order to get the complete information in order to be able to properly answer  In BIBREF38 , the authors present a taxonomy of errors in conversational systems  The ones regarding context-level errors are the ones that are perceived as the top-10 confusing and they are mainly divided into the following:
Excess/lack of proposition: the utterance does not provide any new proposition to the discourse context or provides excessive information than required 
Contradiction: the utterance contains propositions that contradict what has been said by the system or by the user 
Non-relevant topic: the topic of the utterance is irrelevant to the current context such as when the system suddenly jumps to some other topic triggered by some particular word in the previous user utterance 
Unclear relation: although the utterance might relate to the previous user utterance, its relation to the current topic is unclear 
Topic switch error: the utterance displays the fact that the system missed the switch in topic by the user, continuing with the previous topic 
Rule-oriented
In the state of the art most of the proposed approaches for context reasoning lies on rules using logics and knowledge bases as described in the Rule-oriented architecture sub-section  Given a set of facts extracted from the dialogue history and encoded in, for instance, FOL statements, a queries can be posed to the inference engine and produce answers  For instance, see the example in Table TABREF37   The sentences were extracted from BIBREF36 (which does not use a rule-oriented approach), and the first five statements are their respective facts  The system then apply context reasoning for the query Q: Where is the apple 
If statements above are received on the order present in Table TABREF37 , if the query Q: Where is the apple is sent, the inference engine will produce the answer A: Bedroom (i e , the statement INLINEFORM0 is found by the model and returned as True) 
Nowadays, the most common way to store knowledge bases is on triple stores, or RDF (Resource Description Framework) stores  A triple store is a knowledge base for the storage and retrieval of triples through semantic queries  A triple is a data entity composed of subject-predicate-object, like "Sam is at the kitchen" or "The apple is with Sam", for instance  A query language is needed for storing and retrieving data from a triple store  While SPARQL is a RDF query language, Rya is an open source scalable RDF triple store built on top of Apache Accumulo  Originally developed by the Laboratory for Telecommunication Sciences and US Naval Academy, Rya is currently being used by a number of american government agencies for storing, inferencing, and querying large amounts of RDF data 
A SPARQL query has a SQL-like syntax for finding triples matching specific patterns  For instance, see the query below  It retrieves all the people that works at IBM and lives in New York:
SELECT ?people
WHERE {
?people <worksAt> <IBM>  
?people <livesIn> <New York> 
}
Since triple stores can become huge, Rya provides three triple table index BIBREF39 to help speeding up queries:
SPO: subject, predicate, object
POS: predicate, object, subject
OSP: object, subject, predicate
While Rya is an example of an optimized triple store, a rule-oriented chatbot can make use of Rya or any triple store and can call the semantic search engine in order to inference and generate proper answers 
Data-oriented
Recent papers have used neural networks to predict the next utterance on non-goal-driven systems considering the context, for instance with Memory Networks BIBREF40   In this work BIBREF36 , for example the authors were able to generate answers for dialogue like below:
Sam walks into the kitchen 
Sam picks up an apple 
Sam walks into the bedroom 
Sam drops the apple 
Q: Where is the apple?
A: Bedroom
Sukhbaatar's model represents the sentence as a vector in a way that the order of the words matter, and the model encodes the temporal context enhancing the memory vector with a matrix that contains the temporal information  During the execution phase, Sukhbaatar's model takes a discrete set of inputs INLINEFORM0 that are to be stored in the memory, a query INLINEFORM1 , and outputs an answer INLINEFORM2   Each of the INLINEFORM3 , INLINEFORM4 , and INLINEFORM5 contains symbols coming from a dictionary with INLINEFORM6 words  The model writes all INLINEFORM7 to the memory up to a fixed buffer size, and then finds a continuous representation for the INLINEFORM8 and INLINEFORM9   The continuous representation is then processed via multiple computational steps to output INLINEFORM10   This allows back propagation of the error signal through multiple memory accesses back to the input during training  Sukhbaatar's also presents the state of the art of recent efforts that have explored ways to capture dialogue context, treated as long-term structure within sequences, using RNNs or LSTM-based models  The problem of this approach is that it is has not been tested for goal-oriented systems  In addition, it works with a set of sentences but not necessary from multi-party bots 
Platforms
Regarding current platforms to support the development of conversational systems, we can categorize them into three types: platforms for plugging chatbots, for creating chatbots and for creating service chatbots  The platforms for plugging chatbots provide tools for integrating them another system, like Slack  The chatbots need to receive and send messages in a specific way, which depends on the API and there is no support for actually helping on building chatbots behavior with natural language understanding  The platforms for creating chatbots mainly provide tools for adding and training intentions together with dialogue flow specification and some entities extraction, with no reasoning support  Once the models are trained and the dialogue flow specified, the chatbots are able to reply to the received intention  The platforms for creating service chatbots provide the same functionalities as the last one and also provide support for defining actions to be executed by the chatbots when they are answering to an utterance  Table TABREF43 summarizes current platforms on the market accordingly to these categories  There is a lack on platforms that allow to create chatbots that can be coordinated in a multiparty chat with governance or mediation 
A Conceptual Architecture for Multiparty-Aware Chatbots
In this section the conceptual architecture for creating a hybrid rule and machine learning-based MPCS is presented  The MPCS is defined by the the entities and relationships illustrated in Fig  FIGREF44 which represents the chatbot's knowledge  A Chat Group contains several Members that join the group with a Role  The role may constrain the behavior of the member in the group  Chatbot is a type of Role, to differentiate from persons that may also join with different roles  For instance, a person may assume the role of the owner of the group, or someone that was invited by the owner, or a domain role like an expert, teacher or other 
When a Member joins the Chat Group, it/he/she can send Utterances  The Member then classifies each Utterance with an Intent which has a Speech Act  The Intent class, Speech Act class and the Intent Flow trigger the Action class to be executed by the Member that is a Chatbot  The Chatbots associated to the Intention are the only ones that know how to answer to it by executing Actions  The Action, which implements one Speech Act, produces answers which are Utterances, so, for instance, the Get_News action produces an Utterance for which Intention's speech act is Inform_News  The Intent Flow holds the intent's class conversation graph which maps the dialog state as a decision tree  The answer's intention class is mapped in the Intent Flow as a directed graph G defined as following: DISPLAYFORM0
From the graph definitions, INLINEFORM0 is for vertices and INLINEFORM1 is for relations, which are the arrows in the graph  And in Equation EQREF46 :
INLINEFORM0 is the set of intentions pairs,
INLINEFORM0 is the set of paths to navigate through the intentions,
INLINEFORM0 is the arrow's head, and
INLINEFORM0 is the arrow's tail 
This arrow represents a turn from an utterance with INLINEFORM0 intention class which is replying to an utterance with INLINEFORM1 intention class to the state which an utterance with INLINEFORM2 intention's class is sent 
INLINEFORM0 is the intention class of the answer to be provided to the received INLINEFORM1 intention class 
In addition, each intent's class may refer to many Entities which, in turn, may be associated to several Features  For instance, the utterance
"I would like to invest USD10,000 in Savings Account for 2 years"
contains one entity – the Savings Account's investment option – and two features – money (USD10,000) and period of time (2 years)  The Intent Flow may need this information to choose the next node which will give the next answer  Therefore, if the example is changed a little, like
"I would like to invest in Savings Account",
INLINEFORM0 is constrained by the "Savings Account" entity which requires the two aforementioned features  Hence, a possible answer by one Member of the group would be
"Sure, I can simulate for you, what would be the initial amount and the period of time of the investment?"
With these conceptual model's elements, a MPCS system can be built with multiple chatbots  Next subsection further describes the components workflow 
Workflow
Figure FIGREF48 illustrates from the moment that an utterance is sent in a chat group to the moment a reply is generated in the same chat group, if the case  One or more person may be in the chat, while one or more chatbots too  There is a Hub that is responsible for broadcasting the messages to every Member in the group, if the case  The flow starts when a Member sends the utterance which goes to the Hub and, if allowed, is broadcasted  Many or none interactions norms can be enforced at this level depending on the application  Herein, a norm can be a prohibition, obligation or permission to send an utterance in the chat group 
Once the utterance is broadcasted, a chatbot needs to handle the utterance  In order to properly handle it, the chatbot parses the utterance with several parsers in the Parsing phase: a Topic Classifier, the Dependency Parsing, which includes Part-of-Speech tags and semantics tags, and any other that can extract metadata from the utterance useful for the reasoning  All these metadata, together with more criteria, may be used in the Frame parsing which is useful for context reasoning  All knowledge generated in this phase can be stored in the Context  Then, the Intent Classifier tries to detect the intent class of the utterance  If detected, the Speech Act is also retrieved  And an Event Detector can also check if there is any dialog inconsistency during this phase 
After that, the Filtering phase receives the object containing the utterance, the detected intent, and all metadata extracted so far and decides if an action should be performed to reply to the utterance  If yes, it is sent to the Acting phase which performs several steps  First the Action Classifier tries to detect the action to be performed  If detected, the action is executed  At this step, many substeps may be performed, like searching for an information, computing maths, or generating information to create the answer  All of this may require a search in the Context and also may activate the Error Detector component to check if the dialog did not run into a wrong state  After the answer is generated, the Filtering phase is activated again to check if the reply should be really sent  If so, it is sent to the Hub which, again may check if it can be broadcasted before actually doing it 
The topic classifier is domain-dependent and is not mandatory  However, the chatbot can better react when the intent or action is not detected, which means that it does not know how to answer  Many reasons might explain this situation: the set of intents might be incomplete, the action might not have produced the proper behavior, misunderstanding might happen, or the chatbot was not designed to reply to a particular topic  In all cases, it must be able to produce a proper reply, if needed  Because this might happen throughout the workflow, the sooner that information is available, the better the chatbot reacts  Therefore it is one of the first executions of the flow 
Dependency is the notion that linguistic units, e g  words, are connected to each other by directed links  The (finite) verb is taken to be the structural center of clause structure  All other syntactic units (words) are either directly or indirectly connected to the verb in terms of the directed links, which are called dependencies  It is a one-to-one correspondence: for every element (e g  word or morph) in the sentence, there is exactly one node in the structure of that sentence that corresponds to that element  The result of this one-to-one correspondence is that dependency grammars are word (or morph) grammars  All that exist are the elements and the dependencies that connect the elements into a structure  Dependency grammar (DG) is a class of modern syntactic theories that are all based on the dependency relation 
Semantic dependencies are understood in terms of predicates and their arguments  Morphological dependencies obtain between words or parts of words  To facilitate future research in unsupervised induction of syntactic structure and to standardize best-practices, a tagset that consists of twelve universal part-of-speech categories was proposed BIBREF41  
Dependency parsers have to cope with a high degree of ambiguity and nondeterminism which let to different techniques than the ones used for parsing well-defined formal languages  Currently the mainstream approach uses algorithms that derive a potentially very large set of analyses in parallel and when disambiguation is required, this approach can be coupled with a statistical model for parse selection that ranks competing analyses with respect to plausibility BIBREF42  
Below we present an example of a dependency tree for the utterance:
"I want to invest 10 thousands":
[s]""blue[l]:black
"tree": {
"want VERB ROOT": {
"I PRON nsubj": {},
"to ADP mark": {},
"invest VERB nmod": {
"thousands NOUN nmod": {
"10 NUM nummod": {}
}
}
}
The coarse-grained part-of-speech tags, or morphological dependencies (VERB, PRON, ADP, NOUN and NUM) encode basic grammatical categories and the grammatical relationships (nsubjs, nmod, nummod) are defined in the Universal Dependencies project BIBREF41  
In this module, the dependency tree generated is used together with a set of rules to extract information that is saved in the context using the Frame-based approach  This approach fills the slots of the frame with the extracted values from the dialogue  Frames are like forms and slots are like fields  Using the knowledge's conceptual model, the fields are represented by the elements Entities and Features  In the dependency tree example, the entity would be the implicit concept: the investment option, and the feature is the implicit concept: initial amount – 10 thousands  Since the goal is to invest, and there are more entities needed for that (i e , fields to be filled), the next node in the Intention Flow tree would return an utterance which asks the user the time of investment, if he/she has not provided yet 
This module could be implemented using different approaches according to the domain, but tree search algorithms will be necessary for doing the tree parsing 
The Intent Classifier component aims at recognizing not only the Intent but the goal of the utterance sent by a Member, so it can properly react  The development of an intent classifier needs to deal with the following steps:
i) the creation of dataset of intents, to train the classification algorithm;
ii) the design of a classification algorithm that provides a reasonable level of accuracy;
iii) the creation of dataset of trees of intents, the same as defined in i) and which maps the goals;
iv) the design of a plan-graph search algorithm that maps the goal's state to a node in the graph;
There are several approaches to create training sets for dialogues: from an incremental approach to crowdsourcing  In the incremental approach, the Wizard of Oz method can be applied to a set of potential users of the system, and from this study, a set of questions that the users asked posted to the `fake' system can be collected  These questions have to be manually classified into a set of intent classes, and used to train the first version of the system  Next, this set has to be increased both in terms of number of classes and samples per class 
The Speech Act Classifier can be implemented with many speech act classes as needed by the application  The more classes, the more flexible the chatbot is  It can be built based on dictionaries, or a machine learning-based classifier can be trained  In the table below we present the main and more general speech act classes BIBREF43 used in the Chatbots with examples to differentiate one from another:
There are at least as many Action classes as Speech Act classes, since the action is the realization of a speech act  The domain specific classes, like "Inform_News" or "Inform_Factoids", enhance the capabilities of answering of a chatbot 
The Action Classifier can be defined as a multi-class classifier with the tuple DISPLAYFORM0
where INLINEFORM0 is the intent of the answer defined in ( EQREF46 ), INLINEFORM1 is the speech act of the answer, INLINEFORM2 and INLINEFORM3 are the sets of entities and features needed to produce the answer, if needed, respectively 
This component is responsible for implementing the behavior of the Action class  Basic behaviors may exist and be shared among different chatbots, like the ones that implement the greetings, thanks or not understood  Although they can be generic, they can also be personalized to differentiate the bot from one another and also to make it more "real"  Other cases like to inform, to send a query, to send a proposal, they are all domain-dependent and may require specific implementations 
Anyway, figure FIGREF59 shows at the high level the generic workflow  If action class detected is task-oriented, the system will implement the execution of the task, say to guide a car, to move a robot's arm, or to compute the return of investments  The execution might need to access an external service in the Internet in order to complete the task, like getting the inflation rate, or the interest rate, or to get information about the environment, or any external factor  During the execution or after it is finished, the utterance is generated as a reply and, if no more tasks are needed, the action execution is finished 
In the case of coordination of chatbots, one or more chatbots with the role of mediator may exist in the chat group and, at this step, it is able to invite one or more chatbots to the chat group and it is also able to redirect the utterances, if the case 
The proposed architecture addresses the challenges as the following:
What is the message/utterance about? solved by the Parsing phase;
Who should reply to the utterance? solved by the Filtering phase and may be enforced by the Hub;
How the reply should be built/generated? solved by the Acting phase;
When should the reply be sent? may be solved by the Acting phase or the Filtering phase, and may be enforced by the Hub;
And Context and Logging module is used throughout all phases 
Architecture Implementation and Evaluation
This section presents one implementation of the conceptual architecture presented in last section  After many refactorings, a framework called SABIA (Speech-Act-Based Intelligent Agents Framework) has been developed and CognIA (Cognitive Investment Advisor) application has been developed as an instantiation of SABIA framework  We present then the accuracy and some automated tests of this implementation 
Speech-Act-based Intelligent Agents Framework
SABIA was developed on top of Akka middleware  Akka is a toolkit and runtime that implements the Actor Model on the JVM  Akka's features, like concurrency, distributed computing, resilience, and message-passing were inspired by Erlang's actor model BIBREF44 BIBREF45   The actor model is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation  In response to a message that it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to respond to the next received message  Actors may modify private state, but can only affect each other through messages (avoiding the need for any locks)  Akka middleware manages the actors life cycle and actors look up by theirs name, locally or remotely 
We implemented each Member of the Chat Group as an Actor by extending the UntypedActor class of Akka middleware  Yet, we created and implemented the SabiaActorSystem as a singleton (i e , a single instance of it exists in the system) BIBREF46 that has a reference to Akka's ActorSystem  During SabiaActorSystem's initialization, all parsers that consume too much memory during their initialization to load models are instantiated as singletons  In this way, we save time on their calls during the runtime  Moreover, all chat group management, like to join or leave the group, or to broadcast or filter a message at the Hub level is implemented in SABIA through the Chat Group behavior 
This is implemented in SABIA as a singleton that is initialized during the SabiaActorSystem initialization with the URL of the service that implements the dependency parsing and is used on each utterance's arrival through the execution of the tagUtterance method  The service must retrieve a JSON Object with the dependency tree which is then parsed using depth-first search 
SABIA does not support invariants for frame parsing  We are leaving this task to the instantiated application 
There are two intent classifiers that can be loaded with trained models in order to be ready to be used at runtime: the 1-nearest-neighbor (1NN) and the SVM-based classifier 
SABIA implements the Action Classifier assuming that the application uses a relational database with a data schema that implements the conceptual model presented in Figure FIGREF44   Then the invariants parts that use SQL are already present and the application only needs to implement the database connection and follow the required data schema 
SABIA provides partial implemented behavior for the Action through the Template method design pattern BIBREF46 , which implements the invariants parts of the action execution and leaves placeholders for customization 
CognIA: A Cognitive Investment Advisor
We developed CognIA, which is an instantiation of Sabia framework  A conversation is composed of a group chat that can contain multiple users and multiple chatbots  This example, in particular, has a mediator that can help users on financial matters, more specifically on investment options  For example, consider the following dialogue in the table below:
The Table TABREF71 shows an example that uses the mixed-initiative dialogue strategy, and a dialogue mediator to provide coordination control  In this example of an application, there are many types of intentions that should be answered: Q&A (question and answer) about definitions, investment options, and about the current finance indexes, simulation of investments, which is task-oriented and requires computation, and opinions, which can be highly subjective 
In Table SECREF72 , we present the interaction norms that were needed in Cognia  The Trigger column describes the event that triggers the Behavior specified in the third column  The Pre-Conditions column specifies what must happen in order to start the behavior execution  So, for instance, line 2, when the user sends an utterance in the chat group, an event is triggered and, if the utterance's topic is CDB (Certificate of Deposit which is a fixed rate investment) or if it is about the Savings Account investment option and the speech act is not Query_Calculation and the CDB and Savings Account members are not in the chat, then the behavior is activated  The bot members that implement these behaviors are called cdbguru and poupancaguru  Therefore these names are used when there is a mention 
Note that these interactions norms are not explicitly defined as obligations, permissions, and prohibitions  They are implict from the behavior described  During this implementation, we did not worry about explicitly defining the norms, because the goal was to evaluate the overall architecture, not to enhance the state of the art on norms specification for conversational systems  In addition, CognIA has only the presented interaction norms defined in Table SECREF72 , which is a very small set that that does not required model checking or verification of conflicts 
|p2cm|p5 0cm|p5 0cm|Cognia Interaction NormsCognia Interaction Norms
Trigger Pre-Conditions Behavior
On group chat creation Cognia chatbot is available Cognia chatbot joins the chat with the mediator role and user joins the chat with the owner_user role
On utterance sent by user Utterance's topic is CDB (cdbguru) or Savings Account (poupancaguru) and speech act is not Query_Calculation and they are not in the chat Cognia invites experts to the chat and repeats the utterance to them
On utterance sent by user Utterance's topic is CDB (cdbguru) or Savings Account (poupancaguru) and speech act is not Query_Calculation and they are in the chat Cognia waits for while and cdbguru or poupancaguru respectively handles the utterance  If they don't understand, they don't reply
On utterance sent by the experts If Cognia is waiting for them and has received both replies Cognia does not wait anymore
On utterance sent Utterance mentions cdbguru or poupancaguru cdbguru or poupancaguru respectively handles the utterance
On utterance sent Utterance mentions cdbguru or poupancaguru and they don't reply after a while and speech act is Query_Calculation Cognia sends I can only chat about investments   
On utterance sent Utterance mentions cdbguru or poupancaguru and they don't reply after while and speech act is not Query_Calculation Cognia sends I didn't understand
On utterance sent Utterance's speech act is Query_Calculation and period or initial amount of investment were not specified Cognia asks the user the missing information
On utterance sent Utterance's speech act is Query_Calculation and period and initial amount of investment were specified and the experts are not in the chat Cognia invites experts to the chat and repeats the utterance to them
On utterance sent Utterance's speech act is Query_Calculation and period and initial amount of investment were specified and the experts are in the chat Cognia repeats the utterance to experts
On utterance sent Utterance's speech act is Query_Calculation Cognia extracts variables and saves the context
On utterance sent Utterance's speech act is Query_Calculation and the experts are in the chat and the experts are mentioned Experts extract information, save in the context, compute calculation and send information
On utterance sent Utterance's speech act is Inform_Calculation and Cognia received all replies Cognia compares the results and inform comparison
On utterance sent Utterance mentions a chatbot but has no other text The chatbot replies How can I help you?
On utterance sent Utterance is not understood and speech act is Question The chatbot replies I don't know    I can only talk about topic X
On utterance sent Utterance is not understood and speech act is not Question The chatbot replies I didn't understand
On utterance sent Utterance's speech act is one of { Greetings, Thank, Bye } All chatbots reply to utterance
On group chat end All chatbots leave the chat, and the date and time of the end of chat is registered
We instantiated SABIA to develop CognIA as follows: the Mediator, Savings Account, CDB and User Actors are the Members of the Chat Group  The Hub was implemented using two servers: Socket io and Node JS which is a socket client of the Socket io server  The CognIA system has also one Socket Client for receiving the broadcast and forwarding to the Group Chat Manager  The former will actually do the broadcast to every member after enforcing the norms that applies specified in Table SECREF72   Each Member will behave according to this table too  For each user of the chat group, on a mobile or a desktop, there is its corresponding actor represented by the User Actor in the figure  Its main job is to receive Akka's broadcast and forward to the Socket io server, so it can be finally propagated to the users 
All the intents, actions, factual answers, context and logging data are saved in DashDB (a relational Database-as-a-Service system)  When an answer is not retrieved, a service which executes the module Search Finance on Social Media on a separate server is called  This service was implemented with the assumption that finance experts post relevant questions and answers on social media  Further details are explained in the Action execution sub-section 
We built a small dictionary-based topic classifier to identify if an utterance refers to finance or not, and if it refers to the two investment options (CDB or Savings Account) or not 
The dependency parsing is extremely important for computing the return of investment when the user sends an utterance with this intention  Our first implementation used regular expressions which led to a very fragile approach  Then we used a TensorFlow implementation BIBREF47 of a SyntaxNet model for Portuguese and used it to generate the dependency parse trees of the utterances  The SyntaxNet model is a feed-forward neural network that operates on a task-specific transition system and achieves the state-of-the-art on part-of-speech tagging, dependency parsing and sentence compression results BIBREF48   Below we present output of the service for the utterance:
"I want to invest 10 thousands in 40 months":
[s]""blue[l]:black
{ "original": "I would like to invest 10 thousands in 40 months",
"start_pos": [
23,
32],
"end_pos": [
27,
33],
"digits": [
10000,
40],
"converted": "I would like to invest 10000 in 40 months",
"tree": {
"like VERB ROOT": {
"I PRON nsubj": {},
"would MD aux":{
"invest VERB xcomp":{
"to TO aux": {},
"10000 NUM dobj": {},
"in IN prep": {
"months NOUN pobj":{
"40 NUM num": {}}}}}}}
The service returns a JSON Object containing six fields: original, start_pos, end_pos, digits, converted and tree  The original field contains the original utterance sent to the service  The converted field contains the utterance replaced with decimal numbers, if the case (for instance, "10 thousands" was converted to "10000" and replaced in the utterance)  The start_pos and end_pos are arrays that contain the start and end char positions of the numbers in the converted utterance  While the tree contains the dependency parse tree for the converted utterance 
Given the dependency tree, we implemented the frame parsing which first extracts the entities and features from the utterance and saves them in the context  Then, it replaces the extracted entities and features for reserved characters 
extract_period_of_investment (utteranceTree) [1] [t] numbersNodes INLINEFORM0 utteranceTree getNumbersNodes(); [t] foreach(numberNode in numbersNodes) do [t] parentsOfNumbersNode INLINEFORM1 numbersNode getParents() [t] foreach(parent in parentsOfNumbersNodes) do [t] if ( parent name contains { "day", "month", "year"} ) then [t] parentOfParent INLINEFORM2 parent getParent() [t] if ( parentOfParent is not null and
parentOfParent getPosTag==Verb and
parentOfParent name in investmentVerbsSet ) then [t] return numberNode
Therefore an utterance like "I would like to invest 10 thousands in 3 years" becomes "I would like to invest #v in #dt years"  Or "10 in 3 years" becomes "#v in #dt years", and both intents have the same intent class 
For doing that we implemented a few rules using a depth-first search algorithm combined with the rules as described in Algorithm UID79 , Algorithm UID79 and Algorithm UID79   Note that our parser works only for short texts on which the user's utterance mentions only one period of time and/ or initial amount of investment in the same utterance 
extract_initial_amount_of_investment (utteranceTree) [1] [t] numbersNodes INLINEFORM0 utteranceTree getNumbersNodes(); [t] foreach(numberNode in numbersNodes) do [t] parentsOfNumbersNode INLINEFORM1 numbersNode getParents() [t] foreach(parent in parentsOfNumbersNodes) do [t] if ( parent name does not contain { "day", "month", "year"} ) then [t] return numberNode
frame_parsing(utterance, utteranceTree) [1] [t] period INLINEFORM0 extract_period_of_investment (utteranceTree) [t] save_period_of_investment(period) [t] value INLINEFORM1 extract_initial_amount_of_investment (utteranceTree) [t] save_initial_amount_of_investment(value) [t] new_intent INLINEFORM2 replace(new_intent, period, "#dt") [t] new_intent INLINEFORM3 replace(new_intent, value, "#v")
In CognIA we have complemented the speech act classes with the ones related to the execution of specific actions  Therefore, if the chatbot needed to compute the return of investment, then, once it is computed, the speech act of the reply will be Inform_Calculation and the one that represents the query for that is Query_Calculation  In table TABREF81 we list the specific ones 
Given that there is no public dataset available with financial intents in Portuguese, we have employed the incremental approach to create our own training set for the Intent Classifier  First, we applied the Wizard of Oz method and from this study, we have collected a set of 124 questions that the users asked  Next, after these questions have been manually classified into a set of intent classes, and used to train the first version of the system, this set has been increased both in terms of number of classes and samples per class, resulting in a training set with 37 classes of intents, and a total 415 samples, with samples per class ranging from 3 to 37 
We have defined our classification method based on features extracted from word vectors  Word vectors consist of a way to encode the semantic meaning of the words, based on their frequency of co-occurrence  To create domain-specific word vectors, a set of thousand documents are needed related to desired domain  Then each intent from the training set needs to be encoded with its corresponding mean word vector  The mean word vector is then used as feature vector for standard classifiers 
We have created domain-specific word vectors by considering a set 246,945 documents, corresponding to of 184,001 Twitter posts and and 62,949 news articles, all related to finance  
The set of tweets has been crawled from the feeds of blog users who are considered experts in the finance domain  The news article have been extracted from links included in these tweets  This set contained a total of 63,270,124 word occurrences, with a vocabulary of 97,616 distinct words  With the aforementioned word vectors, each intent from the training set has been encoded with its corresponding mean word vector  The mean word vector has been then used as feature vector for standard classifiers 
As the base classifier, we have pursued with a two-step approach  In the first step, the main goal was to make use of a classifier that could be easily retrained to include new classes and intents  For this reason, the first implementation of the system considered an 1-nearest-neighbor (1NN) classifier, which is simply a K-nearest-neighbor classifier with K set to 1  With 1NN, the developer of the system could simply add new intents and classes to the classifier, by means of inserting new lines into the database storing the training set  Once we have considered that the training set was stable enough for the system, we moved the focus to an approach that would be able to provide higher accuracy rates than 1NN  For this, we have employed Support Vector Machines (SVM) with a Gaussian kernel, the parameters of which are optimized by means of a grid search 
We manually mapped the intent classes used to train the intent classifier to action classes and the dependent entities and features, when the case  Table TABREF85 summarizes the number of intent classes per action class that we used in CognIA 
For the majority of action classes we used SABIA's default behavior  For instance, Greet and Bye actions classes are implemented using rapport, which means that if the user says "Hi" the chatbot will reply "Hi" 
The Search News, Compute and Ask More classes are the ones that require specific implemention for CognIA as following:
Search News: search finance on social media service BIBREF49 , BIBREF50 receives the utterance as input, searches on previously indexed Twitter data for finance for Portuguese and return to the one which has the highest score, if found 
Ask More: If the user sends an utterance that has the intention class of simulating the return of investment, while not all variables to compute the return of investment are extracted from the dialogue, the mediator keeps asking the user these information before it actually redirects the query to the experts  This action then checks the state of the context given the specified intent flow as described in ( EQREF46 ) and ( EQREF57 ) in section SECREF4 to decide which variables are missing  For CognIA we manually added these dependencies on the database 
Compute: Each expert Chatbot implements this action according to its expertise  The savings account chatbot computes the formula ( EQREF90 ) and the certificate of deposit computes the formula ( EQREF92 )  Both are currently formulas for estimating in Brazil  DISPLAYFORM0
where INLINEFORM0 is the return of investment for the savings account, INLINEFORM1 is the initial value of investment, INLINEFORM2 is the savings account interest rate and INLINEFORM3 is the savings account rate base  DISPLAYFORM0
where INLINEFORM0 is the return of investment for certificate of deposit, INLINEFORM1 is the initial value of investment, INLINEFORM2 is the Interbank Deposit rate (DI in Portuguese), INLINEFORM3 is the ID's percentual payed by the bank (varies from 90% to 120%), INLINEFORM4 is the number of days the money is invested, and finally INLINEFORM5 is the income tax on the earnings 
Intention Classifier Accuracy
In Table TABREF95 we present the comparison of some distinct classification on the first version of the training set, i e  the set used to deploy the first classifier into the system  Roughly speaking, the 1NN classifier has been able to achieve a level of accuracy that is higher than other well-known classifiers, such as Logistic Regression and Naïve Bayes, showing that 1NN is suitable as a development classifier  Nevertheless, a SVM can perform considerable better than 1NN, reaching accuracies of about 12 percentage points higher, which demonstrates that this type of base classifier is a better choice to be deployed once the system is stable enough  It is worth mentioning that these results consider the leave-one-out validation procedure, given the very low number of samples in some classes 
As we mentioned, the use of an 1NN classifier has allowed the developer of the system to easily add new intent classes and samples whenever they judged it necessary, so that the system could present new actions, or the understanding of the intents could be improved  As a consequence, the initial training set grew from 37 to 63 classes, and from 415 to 659 samples, with the number of samples per class varying from 2 to 63  For visualizing the impact on the accuracy of the system, in Table TABREF96 we present the accuracy of the same classifiers used in the previous evaluation, in the new set  In this case, we observe some drop in accuracy for 1NN, showing that this classifier suffers in dealing with scalability  On the other hand, SVM has shown to scale very well to more classes and samples, since its accuracy kept at a very similar level than that with the other set, with a difference of about only 1 percentage point 
Testing SABIA
In this section, we describe the validation framework that we created for integration tests  For this, we developed it as a new component of SABIA's system architecture and it provides a high level language which is able to specify interaction scenarios that simulate users interacting with the deployed chatbots  The system testers provide a set of utterances and their corresponding expected responses, and the framework automatically simulates users interacting with the bots and collect metrics, such as time taken to answer an utterance and other resource consumption metrics (e g , memory, CPU, network bandwidth)  Our goal was to: (i) provide a tool for integration tests, (ii) to validate CognIA's implementation, and (iii) to support the system developers in understanding the behavior of the system and which aspects can be improved  Thus, whenever developers modify the system's source code, the modifications must first pass the automatic test before actual deployment 
The test framework works as follows  The system testers provide a set INLINEFORM0 of dialogues as input  Each dialogue INLINEFORM1 INLINEFORM2 INLINEFORM3 is an ordered set whose elements are represented by INLINEFORM4 , where INLINEFORM5 is the user utterance and INLINEFORM6 is an ordered set of pairs INLINEFORM7 that lists each response INLINEFORM8 each chatbot INLINEFORM9 should respond when the user says INLINEFORM10   For instance, Table UID98 shows a typical dialogue ( INLINEFORM11 ) between a user and the CognIA system  Note that we are omitting part of the expected answer with "   " just to better visualize the content of the table 
|p3 6cmp0 4cmp4 5cmp3 2cm|Content of dialogue INLINEFORM0 (example of dialogue in CognIA)Content of dialogue INLINEFORM1 (example of dialogue in CognIA
User utterance INLINEFORM0 rId Expected response INLINEFORM1 Chatbot INLINEFORM2
gray!25 hello 1 Hello Mediator
white what is cdb? 2 @CDBExpert what is cdb? Mediator
white 3 CDB is a type of investment that    CDB Expert
gray!25 which is better: cdb or savings account? 4 I found a post in the social media for     Mediator
white i would like to invest R$ 50 in six months 5 @SavingsAccountExpert and @CDBExpert, could you do a simulation    Mediator
white 6 If you invest in Savings Account,     Savings Account Exp 
white 7 If you invest in CDB,    CDB Expert
white 8 Thanks Mediator
white 9 @User, there is no significant difference   Mediator
gray!25 so i want to invest R$ 10000 in 2 years 10 @SavingsAccountExpert and @CDBExpert, could you do a simulation    Mediator
gray!25 11 If you invest in Savings Account,    Savings Account Exp 
gray!25 12 If you invest in CDB,    CDB Expert
gray!25 13 Thanks Mediator
gray!25 14 @User, in that case, it is better    Mediator
white what if i invest R$10,000 in 5 years? 15 @SavingsAccountExpert and @CDBExpert, could you do a simulation    Mediator
white 16 If you invest in Saving Account,    Savings Account Exp 
white 17 If you invest in CDB,    CDB Expert
white 18 Thanks Mediator
white 19 @User, in that case, it is better    Mediator
gray!25 how about 15 years? 20 @SavingsAccountExpert and @CDBExpert, could you do a simulation    Mediator
gray!25 21 If you invest in Savings Account,    Savings Account Exp
gray!25 22 If you invest in CDB,    CDB Expert
gray!25 23 Thanks Mediator
gray!25 24 @User, in that case, it is better    Mediator
white and 50,0000? 25 @SavingsAccountExpert and @CDBExpert, could you do a simulation    Mediator
white 26 If you invest in Savings Account,    Savings Account Exp 
white 27 If you invest in CDB,    CDB Expert
white 28 Thanks Mediator
white 29 @User, in that case, it is better   Mediator
gray!25 I want to invest in 50,000 for 15 years in CDB 30 Sure, follow this link to your bank    Mediator
white thanks 31 You are welcome  Mediator
The testers may also inform the number of simulated users that will concurrently use the platform  Then, for each simulated user, the test framework iterates over the dialogues in INLINEFORM0 and iterates over the elements in each dialogue to check if each utterance INLINEFORM1 was correctly responded with INLINEFORM2 by the chatbot INLINEFORM3   There is a maximum time to wait  If a bot does not respond with the expected response in the maximum time (defined by the system developers), an error is raised and the test is stopped to inform the developers about the error  Otherwise, for each correct bot response, the test framework collects the time taken to respond that specific utterance by the bot for that specific user and continues for the next user utterance  Other consumption resource metrics (memory, CPU, network, disk)  The framework is divided into two parts  One part is responsible to gather resource consumption metrics and it resides inside SABIA  The other part works as clients (users) interacting with the server  It collects information about time taken to answer utterances and checks if the utterances are answered correctly 
By doing this, we not only provide a sanity test for the domain application (CognIA) developed in SABIA framework, but also a performance analysis of the platform  That is, we can: validate if the bots are answering correctly given a pre-defined set of known dialogues, check if they are answering in a reasonable time, and verify the amount of computing resources that were consumed to answer a specific utterance  Given the complexity of CognIA, these tests enable debugging of specific features like: understanding the amount of network bandwidth to use external services, or analyzing CPU and memory consumption when responding a specific utterance  The later may happen when the system is performing more complex calculations to indicate the investment return, for instance 
CognIA was deployed on IBM Bluemix, a platform as a service, on a Liberty for Java Cloud Foundry app with 3 GB RAM memory and 1 GB disk  Each of the modules shown in Figure FIGREF74 are deployed on separate Bluemix servers  Node JS and Socket IO servers are both deployed as Node Cloud Foundry apps, with 256 MB RAM memory and 512 MB disk each  Search Finance on Social Media is on a Go build pack Cloud Foundry app with 128 MB RAM memory and 128 GB disk  For the framework part that simulates clients, we instantiated a virtual machine with 8 cores on IBM's SoftLayer that is able to communicate with Bluemix  Then, the system testers built two dialogues, i e , INLINEFORM0   The example shown in Table UID98 is the dialogue test INLINEFORM1   For the dialogue INLINEFORM2 , although it also has 10 utterances, the testers varied some of them to check if other utterances in the finance domain (different from the ones in dialogue INLINEFORM3 ) are being responded as expected by the bots  Then, two tests are performed and the results are analyzed next  All tests were repeated until the standard deviation of the values was less than 1%  The results presented next are the average of these values within the 1% margin 
Test 1: The first test consists of running both dialogues INLINEFORM0 and INLINEFORM1 for only one user for sanity check  We set 30 seconds as the maximum time a simulated user should wait for a bot correct response before raising an error  The result is that all chatbots (Mediator, CDBExpert, and SavingsAccountExpert) responded all expected responses before the maximum time  Additionally, the framework collected how long each chatbot took to respond an expected answer 
In Figure FIGREF101 , we show the results for those time measurements for dialogue INLINEFORM0 , as for the dialogue INLINEFORM1 the results are approximately the same  The x-axis (Response Identifier) corresponds to the second column (Resp  Id) in Table UID98   We can see, for example, that when the bot CDBExpert responds with the message 3 to the user utterance "what is cdb?", it is the only bot that takes time different than zero to answer, which is the expected behavior  We can also see that the Mediator bot is the one that takes the longest, as it is responsible to coordinate the other bots and the entire dialogue with the user  Moreover, when the expert bots (CDBExpert and SavingsAccountExpert) are called by the Mediator to respond to the simulation calculations (this happens in responses 6, 7, 11, 12, 16, 17, 21, 22, 26, 27), they take approximately the same to respond  Finally, we see that when the concluding responses to the simulation calculations are given by the Mediator (this happens in responses 9, 14, 19, 24, 29), the response times reaches the greatest values, being 20 seconds the greatest value in response 19  These results support the system developers to understand the behavior of the system when simulated users interact with it and then focus on specific messages that are taking longer 
Test 2: This test consists of running dialogue INLINEFORM0 , but now using eight concurrent simulated users  We set the maximum time to wait to 240 seconds, i e , eight times the maximum set up for the single user in Test 1  The results are illustrated in Figure FIGREF102 , where we show the median time for the eight users  The maximum and minimum values are also presented with horizontal markers  Note that differently than what has been shown in Figure FIGREF101 , where each series represents one specific chatbot, in Figure FIGREF102 , the series represents the median response time for the responses in the order (x-axis) they are responded, regardless the chatbot 
Comparing the results in Figure FIGREF102 with the ones in Figure FIGREF101 , we can see that the bots take longer to respond when eight users are concurrently using the platform than when a single user uses it, as expected  For example, CDBExpert takes approximately 5 times longer to respond response 3 to eight users than to respond to one user  On average, the concluding responses to the simulation questions (i e , responses 9, 14, 19, 24, 29) take approximately 7 3 times more to be responded with eight users than with one user, being the response 9 the one that presented greatest difference (11 4 times longer with eight users than with one)  These results help the system developers to diagnose the scalability of the system architecture and to plan sizing and improvements 
Conclusions and Future Work
In this article, we explored the challenges of engineering MPCS and we have presented a hybrid conceptual architecture and its implementation with a finance advisory system 
We are currently evolving this architecture to be able to support decoupled interaction norms specification, and we are also developing a multi-party governance service that uses that specification to enforce exchange of compliant utterances 
In addition, we are exploring a micro-service implementation of SABIA in order to increase its scalability and performance, so thousands of members can join the system within thousands of conversations 
Acknowledgments
The authors would like to thank Maximilien de Bayser, Ana Paula Appel, Flavio Figueiredo and Marisa Vasconcellos, who contributed with discussions during SABIA and CognIA's implementation 
Context 2: Introduction
Recurrent neural networks (RNNs), including gated variants such as the long short-term memory (LSTM) BIBREF0 have become the standard model architecture for deep learning approaches to sequence modeling tasks  RNNs repeatedly apply a function with trainable parameters to a hidden state  Recurrent layers can also be stacked, increasing network depth, representational power and often accuracy  RNN applications in the natural language domain range from sentence classification BIBREF1 to word- and character-level language modeling BIBREF2   RNNs are also commonly the basic building block for more complex models for tasks such as machine translation BIBREF3 , BIBREF4 , BIBREF5 or question answering BIBREF6 , BIBREF7   Unfortunately standard RNNs, including LSTMs, are limited in their capability to handle tasks involving very long sequences, such as document classification or character-level machine translation, as the computation of features or states for different parts of the document cannot occur in parallel 
Convolutional neural networks (CNNs) BIBREF8 , though more popular on tasks involving image data, have also been applied to sequence encoding tasks BIBREF9   Such models apply time-invariant filter functions in parallel to windows along the input sequence  CNNs possess several advantages over recurrent models, including increased parallelism and better scaling to long sequences such as those often seen with character-level language data  Convolutional models for sequence processing have been more successful when combined with RNN layers in a hybrid architecture BIBREF10 , because traditional max- and average-pooling approaches to combining convolutional features across timesteps assume time invariance and hence cannot make full use of large-scale sequence order information 
We present quasi-recurrent neural networks for neural sequence modeling  QRNNs address both drawbacks of standard models: like CNNs, QRNNs allow for parallel computation across both timestep and minibatch dimensions, enabling high throughput and good scaling to long sequences  Like RNNs, QRNNs allow the output to depend on the overall order of elements in the sequence  We describe QRNN variants tailored to several natural language tasks, including document-level sentiment classification, language modeling, and character-level machine translation  These models outperform strong LSTM baselines on all three tasks while dramatically reducing computation time 
Model
Each layer of a quasi-recurrent neural network consists of two kinds of subcomponents, analogous to convolution and pooling layers in CNNs  The convolutional component, like convolutional layers in CNNs, allows fully parallel computation across both minibatches and spatial dimensions, in this case the sequence dimension  The pooling component, like pooling layers in CNNs, lacks trainable parameters and allows fully parallel computation across minibatch and feature dimensions 
Given an input sequence INLINEFORM0 of INLINEFORM1 INLINEFORM2 -dimensional vectors INLINEFORM3 , the convolutional subcomponent of a QRNN performs convolutions in the timestep dimension with a bank of INLINEFORM4 filters, producing a sequence INLINEFORM5 of INLINEFORM6 -dimensional candidate vectors INLINEFORM7   In order to be useful for tasks that include prediction of the next token, the filters must not allow the computation for any given timestep to access information from future timesteps  That is, with filters of width INLINEFORM8 , each INLINEFORM9 depends only on INLINEFORM10 through INLINEFORM11   This concept, known as a masked convolution BIBREF11 , is implemented by padding the input to the left by the convolution's filter size minus one 
We apply additional convolutions with separate filter banks to obtain sequences of vectors for the elementwise gates that are needed for the pooling function  While the candidate vectors are passed through a INLINEFORM0 nonlinearity, the gates use an elementwise sigmoid  If the pooling function requires a forget gate INLINEFORM1 and an output gate INLINEFORM2 at each timestep, the full set of computations in the convolutional component is then: DISPLAYFORM0
where INLINEFORM0 , INLINEFORM1 , and INLINEFORM2 , each in INLINEFORM3 , are the convolutional filter banks and INLINEFORM4 denotes a masked convolution along the timestep dimension  Note that if the filter width is 2, these equations reduce to the LSTM-like DISPLAYFORM0
Convolution filters of larger width effectively compute higher INLINEFORM0 -gram features at each timestep; thus larger widths are especially important for character-level tasks 
Suitable functions for the pooling subcomponent can be constructed from the familiar elementwise gates of the traditional LSTM cell  We seek a function controlled by gates that can mix states across timesteps, but which acts independently on each channel of the state vector  The simplest option, which BIBREF12 term “dynamic average pooling”, uses only a forget gate: DISPLAYFORM0
We term these three options f-pooling, fo-pooling, and ifo-pooling respectively; in each case we initialize INLINEFORM0 or INLINEFORM1 to zero  Although the recurrent parts of these functions must be calculated for each timestep in sequence, their simplicity and parallelism along feature dimensions means that, in practice, evaluating them over even long sequences requires a negligible amount of computation time 
A single QRNN layer thus performs an input-dependent pooling, followed by a gated linear combination of convolutional features  As with convolutional neural networks, two or more QRNN layers should be stacked to create a model with the capacity to approximate more complex functions 
Variants
Motivated by several common natural language tasks, and the long history of work on related architectures, we introduce several extensions to the stacked QRNN described above  Notably, many extensions to both recurrent and convolutional models can be applied directly to the QRNN as it combines elements of both model types 
Regularization An important extension to the stacked QRNN is a robust regularization scheme inspired by recent work in regularizing LSTMs 
The need for an effective regularization method for LSTMs, and dropout's relative lack of efficacy when applied to recurrent connections, led to the development of recurrent dropout schemes, including variational inference–based dropout BIBREF13 and zoneout BIBREF14   These schemes extend dropout to the recurrent setting by taking advantage of the repeating structure of recurrent networks, providing more powerful and less destructive regularization 
Variational inference–based dropout locks the dropout mask used for the recurrent connections across timesteps, so a single RNN pass uses a single stochastic subset of the recurrent weights  Zoneout stochastically chooses a new subset of channels to “zone out” at each timestep; for these channels the network copies states from one timestep to the next without modification 
As QRNNs lack recurrent weights, the variational inference approach does not apply  Thus we extended zoneout to the QRNN architecture by modifying the pooling function to keep the previous pooling state for a stochastic subset of channels  Conveniently, this is equivalent to stochastically setting a subset of the QRNN's INLINEFORM0 gate channels to 1, or applying dropout on INLINEFORM1 : DISPLAYFORM0
Thus the pooling function itself need not be modified at all  We note that when using an off-the-shelf dropout layer in this context, it is important to remove automatic rescaling functionality from the implementation if it is present  In many experiments, we also apply ordinary dropout between layers, including between word embeddings and the first QRNN layer 
Densely-Connected Layers We can also extend the QRNN architecture using techniques introduced for convolutional networks  For sequence classification tasks, we found it helpful to use skip-connections between every QRNN layer, a technique termed “dense convolution” by BIBREF15   Where traditional feed-forward or convolutional networks have connections only between subsequent layers, a “DenseNet” with INLINEFORM0 layers has feed-forward or convolutional connections between every pair of layers, for a total of INLINEFORM1   This can improve gradient flow and convergence properties, especially in deeper networks, although it requires a parameter count that is quadratic in the number of layers 
When applying this technique to the QRNN, we include connections between the input embeddings and every QRNN layer and between every pair of QRNN layers  This is equivalent to concatenating each QRNN layer's input to its output along the channel dimension before feeding the state into the next layer  The output of the last layer alone is then used as the overall encoding result 
Encoder–Decoder Models To demonstrate the generality of QRNNs, we extend the model architecture to sequence-to-sequence tasks, such as machine translation, by using a QRNN as encoder and a modified QRNN, enhanced with attention, as decoder  The motivation for modifying the decoder is that simply feeding the last encoder hidden state (the output of the encoder's pooling layer) into the decoder's recurrent pooling layer, analogously to conventional recurrent encoder–decoder architectures, would not allow the encoder state to affect the gate or update values that are provided to the decoder's pooling layer  This would substantially limit the representational power of the decoder 
Instead, the output of each decoder QRNN layer's convolution functions is supplemented at every timestep with the final encoder hidden state  This is accomplished by adding the result of the convolution for layer INLINEFORM0 (e g , INLINEFORM1 , in INLINEFORM2 ) with broadcasting to a linearly projected copy of layer INLINEFORM3 's last encoder state (e g , INLINEFORM4 , in INLINEFORM5 ): DISPLAYFORM0
where the tilde denotes that INLINEFORM0 is an encoder variable  Encoder–decoder models which operate on long sequences are made significantly more powerful with the addition of soft attention BIBREF3 , which removes the need for the entire input representation to fit into a fixed-length encoding vector  In our experiments, we computed an attentional sum of the encoder's last layer's hidden states  We used the dot products of these encoder hidden states with the decoder's last layer's un-gated hidden states, applying a INLINEFORM1 along the encoder timesteps, to weight the encoder states into an attentional sum INLINEFORM2 for each decoder timestep  This context, and the decoder state, are then fed into a linear layer followed by the output gate: DISPLAYFORM0
where INLINEFORM0 is the last layer 
While the first step of this attention procedure is quadratic in the sequence length, in practice it takes significantly less computation time than the model's linear and convolutional layers due to the simple and highly parallel dot-product scoring function 
Experiments
We evaluate the performance of the QRNN on three different natural language tasks: document-level sentiment classification, language modeling, and character-based neural machine translation  Our QRNN models outperform LSTM-based models of equal hidden size on all three tasks while dramatically improving computation speed  Experiments were implemented in Chainer BIBREF16  
Sentiment Classification
We evaluate the QRNN architecture on a popular document-level sentiment classification benchmark, the IMDb movie review dataset BIBREF17   The dataset consists of a balanced sample of 25,000 positive and 25,000 negative reviews, divided into equal-size train and test sets, with an average document length of 231 words BIBREF18   We compare only to other results that do not make use of additional unlabeled data (thus excluding e g , BIBREF19 ) 
Our best performance on a held-out development set was achieved using a four-layer densely-connected QRNN with 256 units per layer and word vectors initialized using 300-dimensional cased GloVe embeddings BIBREF20   Dropout of 0 3 was applied between layers, and we used INLINEFORM0 regularization of INLINEFORM1   Optimization was performed on minibatches of 24 examples using RMSprop BIBREF21 with learning rate of INLINEFORM2 , INLINEFORM3 , and INLINEFORM4  
Small batch sizes and long sequence lengths provide an ideal situation for demonstrating the QRNN's performance advantages over traditional recurrent architectures  We observed a speedup of 3 2x on IMDb train time per epoch compared to the optimized LSTM implementation provided in NVIDIA's cuDNN library  For specific batch sizes and sequence lengths, a 16x speed gain is possible  Figure FIGREF15 provides extensive speed comparisons 
In Figure FIGREF12 , we visualize the hidden state vectors INLINEFORM0 of the final QRNN layer on part of an example from the IMDb dataset  Even without any post-processing, changes in the hidden state are visible and interpretable in regards to the input  This is a consequence of the elementwise nature of the recurrent pooling function, which delays direct interaction between different channels of the hidden state until the computation of the next QRNN layer 
Language Modeling
We replicate the language modeling experiment of BIBREF2 and BIBREF13 to benchmark the QRNN architecture for natural language sequence prediction  The experiment uses a standard preprocessed version of the Penn Treebank (PTB) by BIBREF25  
We implemented a gated QRNN model with medium hidden size: 2 layers with 640 units in each layer  Both QRNN layers use a convolutional filter width INLINEFORM0 of two timesteps  While the “medium” models used in other work BIBREF2 , BIBREF13 consist of 650 units in each layer, it was more computationally convenient to use a multiple of 32  As the Penn Treebank is a relatively small dataset, preventing overfitting is of considerable importance and a major focus of recent research  It is not obvious in advance which of the many RNN regularization schemes would perform well when applied to the QRNN  Our tests showed encouraging results from zoneout applied to the QRNN's recurrent pooling layer, implemented as described in Section SECREF5  
The experimental settings largely followed the “medium” setup of BIBREF2   Optimization was performed by stochastic gradient descent (SGD) without momentum  The learning rate was set at 1 for six epochs, then decayed by 0 95 for each subsequent epoch, for a total of 72 epochs  We additionally used INLINEFORM0 regularization of INLINEFORM1 and rescaled gradients with norm above 10  Zoneout was applied by performing dropout with ratio 0 1 on the forget gates of the QRNN, without rescaling the output of the dropout function  Batches consist of 20 examples, each 105 timesteps 
Comparing our results on the gated QRNN with zoneout to the results of LSTMs with both ordinary and variational dropout in Table TABREF14 , we see that the QRNN is highly competitive  The QRNN without zoneout strongly outperforms both our medium LSTM and the medium LSTM of BIBREF2 which do not use recurrent dropout and is even competitive with variational LSTMs  This may be due to the limited computational capacity that the QRNN's pooling layer has relative to the LSTM's recurrent weights, providing structural regularization over the recurrence 
Without zoneout, early stopping based upon validation loss was required as the QRNN would begin overfitting  By applying a small amount of zoneout ( INLINEFORM0 ), no early stopping is required and the QRNN achieves competitive levels of perplexity to the variational LSTM of BIBREF13 , which had variational inference based dropout of 0 2 applied recurrently  Their best performing variation also used Monte Carlo (MC) dropout averaging at test time of 1000 different masks, making it computationally more expensive to run 
When training on the PTB dataset with an NVIDIA K40 GPU, we found that the QRNN is substantially faster than a standard LSTM, even when comparing against the optimized cuDNN LSTM  In Figure FIGREF15 we provide a breakdown of the time taken for Chainer's default LSTM, the cuDNN LSTM, and QRNN to perform a full forward and backward pass on a single batch during training of the RNN LM on PTB  For both LSTM implementations, running time was dominated by the RNN computations, even with the highly optimized cuDNN implementation  For the QRNN implementation, however, the “RNN” layers are no longer the bottleneck  Indeed, there are diminishing returns from further optimization of the QRNN itself as the softmax and optimization overhead take equal or greater time  Note that the softmax, over a vocabulary size of only 10,000 words, is relatively small; for tasks with larger vocabularies, the softmax would likely dominate computation time 
It is also important to note that the cuDNN library's RNN primitives do not natively support any form of recurrent dropout  That is, running an LSTM that uses a state-of-the-art regularization scheme at cuDNN-like speeds would likely require an entirely custom kernel 
Character-level Neural Machine Translation
We evaluate the sequence-to-sequence QRNN architecture described in SECREF5 on a challenging neural machine translation task, IWSLT German–English spoken-domain translation, applying fully character-level segmentation  This dataset consists of 209,772 sentence pairs of parallel training data from transcribed TED and TEDx presentations, with a mean sentence length of 103 characters for German and 93 for English  We remove training sentences with more than 300 characters in English or German, and use a unified vocabulary of 187 Unicode code points 
Our best performance on a development set (TED tst2013) was achieved using a four-layer encoder–decoder QRNN with 320 units per layer, no dropout or INLINEFORM0 regularization, and gradient rescaling to a maximum magnitude of 5  Inputs were supplied to the encoder reversed, while the encoder convolutions were not masked  The first encoder layer used convolutional filter width INLINEFORM1 , while the other encoder layers used INLINEFORM2   Optimization was performed for 10 epochs on minibatches of 16 examples using Adam BIBREF28 with INLINEFORM3 , INLINEFORM4 , INLINEFORM5 , and INLINEFORM6   Decoding was performed using beam search with beam width 8 and length normalization INLINEFORM7   The modified log-probability ranking criterion is provided in the appendix 
Results using this architecture were compared to an equal-sized four-layer encoder–decoder LSTM with attention, applying dropout of 0 2  We again optimized using Adam; other hyperparameters were equal to their values for the QRNN and the same beam search procedure was applied  Table TABREF17 shows that the QRNN outperformed the character-level LSTM, almost matching the performance of a word-level attentional baseline 
Related Work
Exploring alternatives to traditional RNNs for sequence tasks is a major area of current research  Quasi-recurrent neural networks are related to several such recently described models, especially the strongly-typed recurrent neural networks (T-RNN) introduced by BIBREF12   While the motivation and constraints described in that work are different, BIBREF12 's concepts of “learnware” and “firmware” parallel our discussion of convolution-like and pooling-like subcomponents  As the use of a fully connected layer for recurrent connections violates the constraint of “strong typing”, all strongly-typed RNN architectures (including the T-RNN, T-GRU, and T-LSTM) are also quasi-recurrent  However, some QRNN models (including those with attention or skip-connections) are not “strongly typed”  In particular, a T-RNN differs from a QRNN as described in this paper with filter size 1 and f-pooling only in the absence of an activation function on INLINEFORM0   Similarly, T-GRUs and T-LSTMs differ from QRNNs with filter size 2 and fo- or ifo-pooling respectively in that they lack INLINEFORM1 on INLINEFORM2 and use INLINEFORM3 rather than sigmoid on INLINEFORM4  
The QRNN is also related to work in hybrid convolutional–recurrent models  BIBREF31 apply CNNs at the word level to generate INLINEFORM0 -gram features used by an LSTM for text classification  BIBREF32 also tackle text classification by applying convolutions at the character level, with a stride to reduce sequence length, then feeding these features into a bidirectional LSTM  A similar approach was taken by BIBREF10 for character-level machine translation  Their model's encoder uses a convolutional layer followed by max-pooling to reduce sequence length, a four-layer highway network, and a bidirectional GRU  The parallelism of the convolutional, pooling, and highway layers allows training speed comparable to subword-level models without hard-coded text segmentation 
The QRNN encoder–decoder model shares the favorable parallelism and path-length properties exhibited by the ByteNet BIBREF33 , an architecture for character-level machine translation based on residual convolutions over binary trees  Their model was constructed to achieve three desired properties: parallelism, linear-time computational complexity, and short paths between any pair of words in order to better propagate gradient signals 
Conclusion
Intuitively, many aspects of the semantics of long sequences are context-invariant and can be computed in parallel (e g , convolutionally), but some aspects require long-distance context and must be computed recurrently  Many existing neural network architectures either fail to take advantage of the contextual information or fail to take advantage of the parallelism  QRNNs exploit both parallelism and context, exhibiting advantages from both convolutional and recurrent neural networks  QRNNs have better predictive accuracy than LSTM-based models of equal hidden size, even though they use fewer parameters and run substantially faster  Our experiments show that the speed and accuracy advantages remain consistent across tasks and at both word and character levels 
Extensions to both CNNs and RNNs are often directly applicable to the QRNN, while the model's hidden states are more interpretable than those of other recurrent architectures as its channels maintain their independence across timesteps  We believe that QRNNs can serve as a building block for long-sequence tasks that were previously impractical with traditional RNNs 
Beam search ranking criterion
The modified log-probability ranking criterion we used in beam search for translation experiments is: DISPLAYFORM0
where INLINEFORM0 is a length normalization parameter BIBREF34 , INLINEFORM1 is the INLINEFORM2 th output character, and INLINEFORM3 is a “target length” equal to the source sentence length plus five characters  This reduces at INLINEFORM4 to ordinary beam search with probabilities: DISPLAYFORM0
and at INLINEFORM0 to beam search with probabilities normalized by length (up to the target length): DISPLAYFORM0
Conveniently, this ranking criterion can be computed at intermediate beam-search timesteps, obviating the need to apply a separate reranking on complete hypotheses 

ground_truth: Custom dataset with user questions; set of documents, twitter posts and news articles, all related to finance.

a self-collected financial intents dataset in Portuguese

prompt_front: You are given a scientific article and a question. Answer the question as concisely as you can, using a single phrase or sentence if possible. If the question cannot be answered based on the information in the article, write "unanswerable". If the question is a yes/no question, answer "yes", "no", or "unanswerable". Do not provide any explanation.

Please answer the questions based on the text provided below. What sentiment classification dataset is used?
Context 3: Introduction
Attempts toward constructing human-like dialogue agents have met significant difficulties, such as maintaining conversation consistency BIBREF0  This is largely due to inabilities of dialogue agents to engage the user emotionally because of an inconsistent personality BIBREF1  Many agents use personality models that attempt to map personality attributes into lower dimensional spaces (e g  the Big Five BIBREF2)  However, these represent human personality at a very high-level and lack depth  They prohibit the ability to link specific and detailed personality traits to characters, and to construct large datasets where dialogue is traceable back to these traits 
For this reason, we propose Human Level Attributes (HLAs), which we define as characteristics of fictional characters representative of their profile and identity  We base HLAs on tropes collected from TV Tropes BIBREF3, which are determined by viewers' impressions of the characters  See Figure FIGREF1 for an example  Based on the hypothesis that profile and identity contribute effectively to language style BIBREF4, we propose that modeling conversation with HLAs is a means for constructing a dialogue agent with stable human-like characteristics  By collecting dialogues from a variety of characters along with this HLA information, we present a novel labelling of this dialogue data where it is traceable back to both its context and associated human-like qualities 
We also propose a system called ALOHA (Artificial Learning On Human Attributes) as a novel method of incorporating HLAs into dialogue agents  ALOHA maps characters to a latent space based on their HLAs, determines which are most similar in profile and identity, and recovers language styles of specific characters  We test the performance of ALOHA in character language style recovery against four baselines, demonstrating outperformance and system stability  We also run a human evaluation supporting our results  Our major contributions are: (1) We propose HLAs as personality aspects of fictional characters from the audience's perspective based on tropes; (2) We provide a large dialogue dataset traceable back to both its context and associated human-like attributes; (3) We propose a system called ALOHA that is able to recommend responses linked to specific characters  We demonstrate that ALOHA, combined with the proposed dataset, outperforms baselines  ALOHA also shows stable performance regardless of the character's identity, genre of the show, and context of the dialogue  We plan to release all of ALOHA's data and code 
Related Work
Task completion chatbots (TCC), or task-oriented chatbots, are dialogue agents used to fulfill specific purposes, such as helping customers book airline tickets, or a government inquiry system  Examples include the AIML based chatbot BIBREF5 and DIVA Framework BIBREF6  While TCC are low cost, easily configurable, and readily available, they are restricted to working well for particular domains and tasks 
Open-domain chatbots are more generic dialogue systems  An example is the Poly-encoder from BIBREF7 humeau2019real  It outperforms the Bi-encoder BIBREF8, BIBREF9 and matches the performance of the Cross-encoder BIBREF10, BIBREF11 while maintaining reasonable computation time  It performs strongly on downstream language understanding tasks involving pairwise comparisons, and demonstrates state-of-the-art results on the ConvAI2 challenge BIBREF12  Feed Yourself BIBREF13 is an open-domain dialogue agent with a self-feeding model  When the conversation goes well, the dialogue becomes part of the training data, and when the conversation does not, the agent asks for feedback  Lastly, Kvmemnn BIBREF14 is a key-value memory network with a knowledge base that uses a key-value retrieval mechanism to train over multiple domains simultaneously  We use all three of these models as baselines for comparison  While these can handle a greater variety of tasks, they do not respond with text that aligns with particular human-like characteristics 
BIBREF15 li2016persona defines persona (composite of elements of identity) as a possible solution at the word level, using backpropagation to align responses via word embeddings  BIBREF16 bartl2017retrieval uses sentence embeddings and a retrieval model to achieve higher accuracy on dialogue context  BIBREF17 liu2019emotion applies emotion states of sentences as encodings to select appropriate responses  BIBREF18 pichl2018alquist uses knowledge aggregation and hierarchy of sub-dialogues for high user engagement  However, these agents represent personality at a high-level and lack detailed human qualities  LIGHT BIBREF19 models adventure game characters' dialogues, actions, and emotions  It focuses on the agent identities (e g  thief, king, servant) which includes limited information on realistic human behaviours  BIBREF20 pasunuru2018game models online soccer games as dynamic visual context  BIBREF21 wang2016learning models user dialogue to complete tasks involving certain configurations of blocks  BIBREF22 antol2015vqa models open-ended questions, but is limited to visual contexts  BIBREF23 bordes2016learning tracks user dialogues but is goal-oriented  BIBREF24 ilinykh2019meetup tracks players' dialogues and movements in a visual environment, and is grounded on navigation tasks  All of these perform well in their respective fictional environments, but are not a strong representation of human dialogue in reality 
Methodology ::: Human Level Attributes (HLA)
We collect HLA data from TV Tropes BIBREF3, a knowledge-based website dedicated to pop culture, containing information on a plethora of characters from a variety of sources  Similar to Wikipedia, its content is provided and edited collaboratively by a massive user-base  These attributes are determined by human viewers and their impressions of the characters, and are correlated with human-like characteristics  We believe that TV Tropes is better for our purpose of fictional character modeling than data sources used in works such as BIBREF25 shuster2019engaging because TV Tropes' content providers are rewarded for correctly providing content through community acknowledgement 
TV Tropes defines tropes as attributes of storytelling that the audience recognizes and understands  We use tropes as HLAs to calculate correlations with specific target characters  We collect data from numerous characters from a variety of TV shows, movies, and anime  We filter and keep characters with at least five HLA, as those with fewer are not complex enough to be correctly modeled due to reasons such as lack of data  We end up eliminating 5 86% of total characters, and end up with 45,821 characters and 12,815 unique HLA, resulting in 945,519 total character-HLA pairs  Each collected character has 20 64 HLAs on average  See Figure FIGREF1 for an example character and their HLAs 
Methodology ::: Overall Task
Our task is the following, where $t$ denotes “target":
Given a target character $c_t$ with HLA set $H_t$, recover the language style of $c_t$ without any dialogue of $c_t$ provided 
For example, if Sheldon Cooper from The Big Bang Theory is $c_t$, then $H_t$ is the set of HLA on the left side of Figure FIGREF1 
We define the language style of a character as its diction, tone, and speech patterns  It is a character specific language model refined from a general language model  We must learn to recover the language style of $c_t$ without its dialogue as our objective is to imitate human-like qualities, and hence the model must understand the language styles of characters based on their traits  If we feed $c_t$'s dialogue during training, the model will likely not effectively learn to imitate language styles based on HLAs, but based on the correlation between text in the training and testing dialogues BIBREF26 
We define character space as the character representations within the HLA latent space (see Figure FIGREF4), and the set $C = \lbrace c_1,c_2,   ,c_n\rbrace $ as the set of all characters  We define Observation (OBS) as the input that is fed into any dialogue model  This can be a single or multiple lines of dialogue along with other information  The goal of the dialogue model is to find the best response to this OBS 
Methodology ::: ALOHA
We propose a three-component system called ALOHA to solve the task (see Figure FIGREF6)  The first component, Character Space Module (CSM), generates the character space and calculates confidence levels using singular value decomposition BIBREF27 between characters $c_j$ (for $j = 1$ to $n$ where $j \ne t$) and $c_t$ in the HLA-oriented neighborhood 
The second component, Character Community Module (CCM), ranks the similarity between our target character $c_t$ with any other character $c_j$ by the relative distance between them in the character space 
The third component, Language Style Recovery Module (LSRM), recovers the language style of $c_t$ without its dialogue by training the BERT bi-ranker model BIBREF28 to rank responses from similar characters  Our results demonstrate higher accuracy at retrieving the ground truth response from $c_t$  Our system is also able to pick responses which are correct both in context as well as character space 
Hence, the overall process for ALOHA works as follows  First, given a set of characters, determine the character space using the CSM  Next, given a specific target character, determine the positive community and negative set of associated characters using the CCM  Lastly, using the positive community and negative set determined above along with a dialogue dataset, recover the language style of the target 
Methodology ::: Character Space Module (CSM)
CSM learns how to rank characters  We can measure the interdependencies between the HLA variables BIBREF29 and rank the similarity between the TV show characters  We use implicit feedback instead of neighborhood models (e g  cosine similarity) because it can compute latent factors to transform both characters and HLAs into the same latent space, making them directly comparable 
We define a matrix $P$ that contains binary values, with $P_{u,i} = 1$ if character $u$ has HLA $i$ in our dataset, and $P_{u,i} = 0$ otherwise  We define a constant $\alpha $ that measures our confidence in observing various character-HLA pairs as positive  $\alpha $ controls how much the model penalizes the error if the ground truth is $P_{u,i} = 1$  If $P_{u,i} = 1$ and the model guesses incorrectly, we penalize by $\alpha $ times the loss  But if $P_{u,i} = 0$ and the model guesses a value greater than 0, we do not penalize as $\alpha $ has no impact  This is because $P_{u,i} = 0$ can either represent a true negative or be due to a lack of data, and hence is less reliable for penalization  See Equation DISPLAY_FORM8  We find that using $\alpha =20$ provides decent results 
We further define two dense vectors $X_u$ and $Y_i$  We call $X_u$ the “latent factors for character $u$", and $Y_i$ the “latent factors for HLA $i$"  The dot product of these two vectors produces a value ($X_u^TY_i$) that approximates $P_{u,i}$ (see Figure FIGREF9)  This is analogous to factoring the matrix $P$ into two separate matrices, where one contains the latent factors for characters, and the other contains the latent factors for HLAs  We find that $X_u$ and $Y_i$ being 36-dimensional produces decent results  To bring $X_u^TY_i$ as close as possible to $P_{u,i}$, we minimize the following loss function using the Conjugate Gradient Method BIBREF30:
The first term penalizes differences between the model's prediction ($X_u^TY_i$) and the actual value ($P_{u,i}$)  The second term is an L2 regularizer to reduce overfitting  We find $\lambda = 100$ provides decent results for 500 iterations (see Section SECREF26) 
Methodology ::: Character Community Module (CCM)
CCM aims to divide characters (other than $c_t$) into a positive community and a negative set  We define this positive community as characters that are densely connected internally to $c_t$ within the character space, and the negative set as the remaining characters  We can then sample dialogue from characters in the negative set to act as the distractors (essentially negative samples) during LSRM training 
As community finding is an ill-defined problem BIBREF31, we choose to treat CCM as a simple undirected, unweighted graph  We use the values learned in the CSM for $X_u$ and $Y_i$ for various values of $u$ and $i$, which approximate the matrix $P$  Similar to BIBREF29 hu2008collaborative, we can calculate the correlation between two rows (and hence two characters) 
We then employ a two-level connection representation by ranking all characters against each other in terms of their correlation with $c_t$  For the first level, the set $S^{FL}$ is the top 10% (4582) most highly correlated characters with $c_t$ out of the 45,820 total other characters that we have HLA data for  For the second level, for each character $s_i$ in $S^{FL}$, we determine the 30 most heavily correlated characters with $s_i$ as set $S^{SL}_i$  The positive set $S^{pos}$ are the characters which are present in at least 10 $S^{SL}_i$ sets  We call this value 10 the minimum frequency  All other characters in our dialogue dataset make up the negative set $S^{neg}$  These act as our positive community and negative set, respectively  See Algorithm 1 in Appendix A for details, and Figure FIGREF11 for an example 
Methodology ::: Language Style Recovery Module (LSRM)
LSRM creates a dialogue agent that aligns with observed characteristics of human characters by using the positive character community and negative set determined in the CCM, along with a dialogue dataset, to recover the language style of $c_t$ without its dialogue  We use the BERT bi-ranker model from the Facebook ParlAI framework BIBREF32, where the model has the ability to retrieve the best response out of 20 candidate responses  BIBREF12, BIBREF19, BIBREF0 choose 20 candidate responses, and for comparison purposes, we do the same 
Methodology ::: Language Style Recovery Module (LSRM) ::: BERT
BIBREF28 is first trained on massive amounts of unlabeled text data  It jointly conditions on text on both the left and right, which provides a deep bi-directional representation of sentence inference  BERT is proven to perform well on a wide range of tasks by simply fine-tuning on one additional layer  We are interested in its ability to predict the next sentence, called Next Sentence Prediction  We perform further fine-tuning on BERT for our target character language style retrieval task to produce our LSRM model by optimizing both the encoding layers and the additional layer  We use BERT to create vector representations for the OBS and for each candidate response  By passing the first output of BERT's 12 layers through an additional linear layer, these representations can be obtained as 768-dimensional sentence-level embeddings  It uses the dot product between these embeddings to score candidate responses and is trained using the ranking loss 
Methodology ::: Language Style Recovery Module (LSRM) ::: Candidate response selection
is similar to the procedure from previous work done on grounded dialogue agents BIBREF0, BIBREF19  Along with the ground truth response, we randomly sample 19 distractor responses from other characters from a uniform distribution of characters, and call this process uniform character sampling  Based on our observations, this random sampling provides multiple context correct responses  Hence, the BERT bi-ranker model is trained by learning to choose context correct responses, and the model learns to recover a domain-general language model that includes training on every character

ground_truth: the IMDb movie review dataset BIBREF17

IMDb movie review

prompt_front: You are given a scientific article and a question. Answer the question as concisely as you can, using a single phrase or sentence if possible. If the question cannot be answered based on the information in the article, write "unanswerable". If the question is a yes/no question, answer "yes", "no", or "unanswerable". Do not provide any explanation.

Please answer the questions based on the text provided below. How big is the difference in performance between proposed model and baselines?
Context 3:  This results in a Uniform Model that can select context correct responses, but not responses corresponding to a target character with specific HLAs 
We then fine-tune on the above model to produce our LSRM model with a modification: we randomly sample the 19 distractor responses from only the negative character set instead  We choose the responses that have similar grammatical structures and semantics to the ground truth response, and call this process negative character sampling  This guides the model away from the language style of these negative characters to improve performance at retrieving responses for target characters with specific HLAs  Our results demonstrate higher accuracy at retrieving the correct response from character $c_t$, which is the ground truth 
Experiment ::: Dialogue Dataset
To train the Uniform Model and LSRM, we collect dialogues from 327 major characters (a subset of the 45,821 characters we have HLA data for) in 38 TV shows from various existing sources of clean data on the internet, resulting in a total of 1,042,647 dialogue lines  We use a setup similar to the Persona-Chat dataset BIBREF0 and Cornell Movie-Dialogs Corpus BIBREF33, as our collected dialogues are also paired in terms of valid conversations  See Figure FIGREF1 for an example of these dialogue lines 
Experiment ::: HLA Observation Guidance (HLA-OG)
We define HLA Observation Guidance (HLA-OG) as explicitly passing a small subset of the most important HLAs of a given character as part of the OBS rather than just an initial line of dialogue  This is adapted from the process used in BIBREF0 zhang2018personalizing and BIBREF10 wolf2019transfertransfo which we call Persona Profiling  Specifically, we pass four HLAs that are randomly drawn from the top 40 most important HLAs of the character  We use HLA-OG during training of the LSRM and testing of all models  This is because the baselines (see Section SECREF31) already follow a similar process (Persona Profiling) for training  For the Uniform Model, we train using Next Sentence Prediction (see Section SECREF12)  For testing, HLA-OG is necessary as it provides information about which HLAs the models should attempt to imitate in their response selection  Just passing an initial line of dialogue replicates a typical dialogue response task without HLAs  See Table TABREF19  Further, we also test our LSRM by explicitly passing four HLAs of `none' along with the initial line of dialogue as the OBS (No HLA-OG in Table TABREF19) 
Experiment ::: Training Details ::: BERT bi-ranker
is trained by us on the Persona-Chat dataset for the ConvAI2 challenge  Similar to BIBREF0 zhang2018personalizing, we cap the length of the OBS at 360 tokens and the length of each candidate response at 72 tokens  We use a batch size of 64, learning rate of 5e-5, and perform warm-up updates for 100 iterations  The learning rate scheduler uses SGD optimizer with Nesterov's accelerated gradient descent BIBREF34 and is set to have a decay of 0 4 and to reduce on plateau 
Experiment ::: Training Details ::: Uniform Model
is produced by finetuning the BERT bi-ranker on the dialogue data discussed in Section SECREF15 using uniform character sampling  We use the same hyperparameters as the BERT bi-ranker along with half-precision operations (i e  float16 operations) to increase batch size as recommended BIBREF7 
Experiment ::: Training Details ::: LSRM
is produced by finetuning on the Uniform Model discussed above using negative character sampling  We use the same hyperparameters as the BERT bi-ranker along with half-precision operations (i e  float16 operations) to increase batch size as recommended 
Evaluation ::: CSM Evaluation
We begin by evaluating the ability of the CSM component of our system to correctly generate the character space  To do so, during training, 30% of the character-HLA pairs (which are either 0 or 1) are masked, and this is used as a validation set (see Figure FIGREF9)  For each character $c$, the model generates a list of the 12,815 unique HLAs ranked similarly to BIBREF29 hu2008collaborative for $c$  We look at the recall of our CSM model, which measures the percentage of total ground truth HLAs (over all characters $c$) present within the top N ranked HLAs for all $c$ by our model  That is:
where $HLA_{c}^{gt}$ are the ground truth HLAs for $c$, and $HLA_{c}^{tN}$ are the top N ranked HLAs by the model for $c$  We use $N = 100$, and our model achieves 25 08% recall 
To inspect the CSM performance, we use the T-distributed Stochastic Neighbor Embedding (t-SNE) BIBREF35 to reduce each high-dimensionality data point to two-dimensions via Kullback-Leibler Divergence BIBREF36  This allows us to map our character space into two-dimensions, where similar characters from our embedding space have higher probability of being mapped close by  We sampled characters from four different groups or regions  As seen in Figure FIGREF4, our learned character space effectively groups these characters, as similar characters are adjacent to one another in four regions 
Evaluation ::: Automatic Evaluation Setup ::: Five-Fold Cross Validation
is used for training and testing of the Uniform Model and LSRM  The folds are divided randomly by the TV shows in our dialogue data  We use the dialogue data for 80% of these shows as the four-folds for training, and the dialogue data for the remaining 20% as the fifth-fold for validation/testing  The dialogue data used is discussed in Section SECREF15  This ensures no matter how our data is distributed, each part of it is tested, allowing our evaluation to be more robust to different characters  See Appendix C for five-fold cross validation details and statistics 
Evaluation ::: Automatic Evaluation Setup ::: Five Evaluation Characters
are chosen, one from each of the five testing sets above  Each is a well-known character from a separate TV show, and acts as a target character $c_t$ for evaluation of every model  We choose Sheldon Cooper from The Big Bang Theory, Jean-Luc Picard from Star Trek, Monica Geller from Friends, Gil Grissom from CSI, and Marge Simpson from The Simpsons  We choose characters of significantly different identities and profiles (intelligent scientist, ship captain, outgoing friend, police leader, and responsible mother, respectively) from shows of a variety of genres to ensure that we can successfully recover the language styles of various types of characters  We choose well-known characters because humans require knowledge on the characters they are evaluating (see Section SECREF40) 
For each of these five evaluation characters, all the dialogue lines from the character act as the ground truth responses  The initial dialogue lines are the corresponding dialogue lines to which these ground truth responses are responding  For each initial dialogue line, we randomly sample 19 other candidate responses from the associated testing set using uniform character sampling  Note that this is for evaluation, and hence we use the same uniform character sampling method for all models including ALOHA  The use of negative character sampling is only in ALOHA's training 
Evaluation ::: Baselines
We compare against four dialogue system baselines: Kvmemnn, Feed Yourself, Poly-encoder, and a BERT bi-ranker baseline trained on the Persona-Chat dataset using the same training hyperparameters (including learning rate scheduler and length capping settings) described in Section SECREF20  For the first three models, we use the provided pretrained (on Persona-Chat) models  We evaluate all four on our five evaluation characters discussed in Section SECREF28 
Evaluation ::: Key Evaluation Metrics ::: Hits@n/N
is the accuracy of the correct ground truth response being within the top $n$ ranked candidate responses out of $N$ total candidates  We measure Hits@1/20, Hits@5/20, and Hits@10/20 
Evaluation ::: Key Evaluation Metrics ::: Mean Rank
is the average rank that a model assigns the ground truth response among the 20 total candidates 
Evaluation ::: Key Evaluation Metrics ::: Mean Reciprocal Rank (MRR)
BIBREF37 looks at the mean of the multiplicative inverses of the rank of each correct answer out of a sample of queries $Q$:
where $rank_i$ refers to the rank position of the correct response for the $i$-th query, and $|Q|$ refers to the total number of queries in $Q$ 
Evaluation ::: Key Evaluation Metrics ::: @!START@$F_1$@!END@-score
equals $2 * \frac{precision*recall}{precision+recall}$  For dialogue, precision is the fraction of words in the chosen response contained in the ground truth response, and recall is the fraction of words in the ground truth response contained in the chosen response 
Evaluation ::: Key Evaluation Metrics ::: BLEU
BIBREF38 generally indicates how close two pieces of text are in content and structure, with higher values indicating greater similarity  We report our final BLEU scores as the average scores of 1 to 4-grams 
Evaluation ::: Human Evaluation Setup
We conduct a human evaluation with 12 participants, 8 male and 4 female, who are affiliated project researchers aged 20-39 at the University of [ANON]  We choose the same five evaluation characters as in Section SECREF28  To control bias, each participant evaluates one or two characters  For each character, we randomly select 10 testing samples (each includes an initial line of dialogue along with 20 candidate responses, one of which is the ground truth) from the same testing data for the automatic evaluation discussed in Section SECREF28 
These ten samples make up a single questionnaire presented in full to each participant evaluating the corresponding character, and the participant is asked to select the single top response they think the character would most likely respond with for each of the ten initial dialogue lines  See Figure FIGREF41 for an example  We mask any character names within the candidate responses to prevent human participants from using names to identify which show the response is from 
Each candidate is prescreened to ensure they have sufficient knowledge of the character to be a participant  We ask three prescreening questions where the participant has to identify an image, relationship, and occupation of the character  All 12 of our participants passed the the prescreening 
Results and Analysis ::: Evaluation Results
Table TABREF44 shows average results of our automatic and human evaluations  Table TABREF45 shows average Hits@1/20 scores by evaluation character  See Appendix F for detailed evaluation results  ALOHA is the model with HLA-OG during training and testing, and ALOHA (No HLA-OG) is the model with HLA-OG during training but tested with the four HLAs in the OBS marked as `none' (see Section SECREF17)  See Appendix G for demo interactions between a human, BERT bi-ranker baseline, and ALOHA for all five evaluation characters 
Results and Analysis ::: Evaluation Challenges
The evaluation of our task (retrieving the language style of a specific character) is challenging and hence the five-fold cross validation is necessary for the following reasons:
The ability to choose a context correct response without attributes of specific characters may be hard to separate from our target metric, which is the ability to retrieve the correct response of a target character by its HLAs  However, from manual observation, we noticed that in the 20 chosen candidate responses, there are typically numerous context correct responses, but only one ground truth for the target character (for an example, see Figure FIGREF41)  Hence, a model that only chooses dialogue based on context is distinguishable from one that learns HLAs 
Retrieving responses for the target character depends on the other candidate responses  For example, dialogue retrieval performance for Grissom from CSI, which is a crime/police context, is higher than other evaluation characters (see Table TABREF45), potentially due to other candidate responses not falling within the same crime/police context 
Results and Analysis ::: Performance: ALOHA vs  Humans
As observed from Table TABREF44, ALOHA has a performance relatively close to humans  Human Hits@1/20 scores have a mean of 40 67% and a median over characters of 40%  The limited human evaluation sample size limits what can be inferred, but it indicates that the problem is solved to the extent that ALOHA is able perform relatively close to humans on average  Notice that even humans do not perform extremely well, demonstrating that this task of character based dialogue retrieval is more difficult than typical dialogue retrieval tasks BIBREF19, BIBREF12 
Looking more closely at each character from Table TABREF45, we can see that human evaluation scores are higher for Sheldon and Grissom  This may be due to these characters having more distinct personalities, making them more memorable 
We also look at Pearson correlation values of the Hits@1/20 scores across the five evaluation characters  For human versus Uniform Model, this is -0 4694, demonstrating that the Uniform Model, without knowledge of HLAs, fails to imitate human impressions  For human versus ALOHA, this is 0 4250, demonstrating that our system is able to retrieve character responses somewhat similarly to human impressions  Lastly, for human versus the difference in scores between ALOHA and Uniform Model, this is 0 7815  The difference between ALOHA and the Uniform Model, which is based on the additional knowledge of the HLAs, is hence shown to improve upon the Uniform Model similarly to human impressions  This demonstrates that HLAs are indeed an accurate method of modeling human impressions of character attributes, and also demonstrates that our system, ALOHA, is able to effectively use these HLAs to improve upon dialogue retrieval performance 
Results and Analysis ::: Performance: ALOHA vs  Baselines
ALOHA, combined with the HLAs and dialogue dataset, achieves a significant improvement on the target character language style retrieval task compared to the baseline open-domain chatbot models  As observed from Table TABREF44, ALOHA achieves a significant boost in Hits@n/N accuracy and other metrics for retrieving the correct response of five diverse characters with different identities (see Section SECREF28) 
Results and Analysis ::: Performance: ALOHA vs  Uniform Model
We observe a noticeable improvement in performance between ALOHA and the Uniform Model in recovering the language styles of specific characters that is consistent across all five folds (see Tables TABREF44 and TABREF45), indicating that lack of knowledge of HLAs limits the ability of the model to successfully recover the language style of specific characters  We claim that, to the best of our knowledge, we have made the first step in using HLA-based character dialogue clustering to improve upon personality learning for chatbots 
ALOHA demonstrates an accuracy boost for all five evaluation characters, showing that the system is robust and stable and has the ability to recover the dialogue styles of fictional characters regardless of the character's profile and identity, genre of the show, and context of the dialogue 
Results and Analysis ::: Performance: HLA-OG
As observed from Table TABREF44, ALOHA performs slightly better overall compared to ALOHA (No HLA-OG)  Table TABREF45 shows that this slight performance increase is consistent across four of the five evaluation characters  In the case of Sheldon, the HLA-OG model performs a bit worse  This is possibly due to the large number of Sheldon's HLAs (217) compared to the other four evaluation characters (average of 93 75), along with the limited amount of HLAs we are using for guidance due to the models' limited memory  In general, HLA Observation Guidance during testing appears to improve upon the performance of ALOHA, but this improvement is minimal 
Conclusion and Future Work
We proposed Human Level Attributes (HLAs) as a novel approach to model human-like attributes of characters, and collected a large volume of dialogue data for various characters with complete and robust profiles  We also proposed and evaluated a system, ALOHA, that uses HLAs to recommend tailored responses traceable to specific characters, and demonstrated its outperformance of the baselines and ability to effectively recover language styles of various characters, showing promise for learning character or personality styles  ALOHA was also shown to be stable regardless of the character's identity, genre of show, and context of dialogue 
Potential directions for future work include training ALOHA with a multi-turn response approach BIBREF0 that tracks dialogue over multiple responses, as we could not acquire multi-turn dialogue data for TV shows  Another potential is the modeling of the dialog counterpart (e g  the dialogue of other characters speaking to the target character)  Further, performing semantic text exchange on the chosen response with a model such as SMERTI BIBREF39 may improve the ability of ALOHA to converse with humans  This is because the response may be context and HLA correct, but incorrect semantically (e g  the response may say the weather is sunny when it is actually rainy)  HLA-aligned generative models is another area of exploration  Typically, generative models produce text that is less fluent, but further work in this area may lead to better results  Lastly, a more diverse and larger participant pool is required due to the limited size of our human evaluation 

ground_truth: Metric difference between Aloha and best baseline score:
Hits@1/20: +0.061 (0.3642 vs 0.3032)
MRR: +0.0572(0.5114 vs 0.4542)
F1: -0.0484 (0.3901 vs 0.4385)
BLEU: +0.0474 (0.2867 vs 0.2393)