<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Chatbot Extended with Argumentation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Stefano Bistarelli</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Francesco Santini</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Carlo Taticchi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Mathematics and Computer Science, University of Perugia</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>We present an argumentative chatbot, whose aim is to work in favor of (pro) or against (con) a given topic. Information is internally represented as a Bipolar Argumentation Framework, and semantics are computed with the purpose to select the argument to propose to the end-user. We use DialogFlow as the support framework to develop chatbots. Chatbots (or simply bots) are software whose main aim is to simulate human conversations, usually in the form of an exchange of text messages. In recent years, this kind of application has made a great leap forward, also thanks to the significant advances in the field of Artificial Intelligence. Two are the most exploited technologies for implementing a chatbot: Natural Language Processing (NLP) and Artificial Neural Networks (ANN ). NLP allows for automatically process written or spoken information, by operating lexical, grammatical, syntactic and semantic analyses. On the other hand, ANNs are trained on large amount of data to correctly classify information in input. Bots are widely used to streamline the communication process between the user and the ofered services. Examples of real-world applications are represented by customer service, home banking, smart homes and management of IoT devices [1]. Although chatbots built starting from machine learning techniques are able to respond to requests in input, the user is not always willing to accept the provided answers, especially if they are not part of an explicit logical process which the user can follow and understand. In this work, we take a first step towards the development of a chatbot that, instead of exploiting algorithms based on matching and ANN data, uses logic deduction rules to generate its answers. In particular, we use Abstract Argumentation [2] to handle the information exchanged during the conversation and to allow our chatbot for simulating a debate between two people who either want to make a decision together (pro bot) or discuss to afirm their theses ( con bot). The two people (or agents) enact an argumentation-based dialogue [3] in which knowledge can be exchanged, for instance, trough a concurrent argumentation language [4, 5, 6]. The paper is structured as follows: Sect. 2 illustrates components and features of the proposed chatbot; Sect. 3 reports some relate work; finally, Sect. 4 concludes the paper with final remarks.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Chatbot</kwd>
        <kwd>Bipolar Argumentation</kwd>
        <kwd>DialogFlow</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>2. Extending Chatbots with Argumentation</title>
      <p>There exist several platforms that help the development of chatbots: some examples by the
big tech players are Wit.ai1, IBM Watson Assistant2, Azure Bot Service3, and Amazon Lex4.
The framework we chose to develop our chatbot is DialogFlow5, a chatbot and virtual assistant
development-platform by Google. Each agent developed with DialogFlow is composed of one
or more intents which manage the interaction with the user. Each intent consists of four basic
elements: i) a set of training phrases that contains examples of what a user can (semantically)
say and is used to activate individual intents; ii) actions which define the behaviour of the
agent and trigger predetermined operations; iii) a set of parameters that can be extracted from
user input to generate specific responses; iv) responses to be proposed to the user. Response
messages, then, can be of two types.</p>
      <p>
        We use Bipolar Argumentation Frameworks (BAF ) [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], where a framework is defined by a
triplet ⟨, ℛdef , ℛsupp ⟩: ℛdef collects defeat relations, while ℛsupp collects support between
two arguments. To compute extensions on BAFs we used Aspartix [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ],6 which returns the set of
accepted arguments as, for example, {in(a), in(b)}, {in(a)}, etc. We describe the components
of our chatbot with the help of Fig. 1, also providing insights of the implemented functionalities.
The bot is divided into three modules: i) the user interface module, ii) the DialogFlow module,
and iii) the module related to the algorithms we implemented.
      </p>
      <p>The first module includes a web interface: the user interface, shown in Fig. 2, provides a direct
interaction with the chatbot. Before starting the conversation, the user can adjust a number of
settings as follows. First, a topic can be selected among those supported by the bot. Then, it is
possible to choose the argumentation semantics that the bot will use to formulate its answers.
Finally, the user decides whether the bot should produce responses in favour of her claims or
against them. The conversation begins by entering a sentence in the text box panel. The chatbot
replies with an answer, chosen according to the specified settings, after which the user can
1Wit.ai: https://wit.ai.
2IBM Watson Assistant: https://www.ibm.com/cloud/watson-assistant/.
3Azure Bot Service: https://azure.microsoft.com/en-us/services/bot-service/.
4Amazon Lex: https://aws.amazon.com/lex/.
5DialogFlow: https://cloud.google.com/dialogflow/docs/.</p>
      <p>6Aspartix Webpage: https://www.dbai.tuwien.ac.at/proj/argumentation/systempage/.
enter a new argument. Each input is followed by a response and, with every interaction of this
exchange between user and bot, the web interface also displays a representation of the BAF
used to compute the answer. In this BAF, the argument matched to the user input is highlighted
in green, while the argument corresponding to the bot output is highlighted in grey.</p>
      <p>The second module of the chatbot, which in Fig. 1 is indicated by the central red box, is
formed exclusively by DialogFlow. The Google development framework in our project is used
only as a means to perform NLP operations. The third and last module of the bot includes all the
algorithms we use to compute the extensions and the reinstatement labelling of the obtained
AF. In Fig. 1 this module is represented by the green box on the right.
2.1. How the Chatbot Works
Now that we have described its components, we will see how the chatbot processes the sentences
entered by a user and how to give the answers. Each time a user enters a sentence in the text
area of our interface the system sends it to the DialogFlow module. This module takes the user’s
sentence and through the features of NLP performs the association between the sentence and
an intent that forms the bot. An intent is the key element that makes up a chatbot developed
with DialogFlow as it is able to categorise the sentences entered by a user. In this work we have
created an intent for each argument that makes up a topic. Once the user’s phrase is associated
with an intent, DialogFlow sends a request to our API service. These APIs allow for obtaining
an answer by extracting the most fitting argument from the underlying BAF. For this purpose,
two diferent procedures can be used, depending on whether the chatbot acts pro or con the
topic.</p>
      <p>In case the user is talking with the pro bot, the response argument is selected among those
which are acceptable together with the user argument, according to the selected semantics. On
the other hand, if the user is talking with the con bot, the response argument will be selected
among those which attack the user argument. In both the cases described above, once this
answer topic is selected, one of the reply sentences that is associated with the argument is
selected. Such sentences are associated when the BAF chatbot is created. Finally, the API sends
such sentence back to the request previously made by DialogFlow (Fig. 1b), which will return it
to the screen as a response to the user.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Related Work</title>
      <p>
        Most of related work [
        <xref ref-type="bibr" rid="ref10 ref11 ref9">9, 10, 11</xref>
        ] deals with persuasive argumentative chatbots designed by A.
Hunter and co-authors. These software tools engage in persuasive dialogues, with the purpose
to make the user change their current stance on a subject. To accomplish this, the chatbot needs
a method to select persuasive counterarguments, or switch topic and present a new argument.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] the authors develop a conversational agent able to explain issues related to global
warming: the approach relies on textual entailment to identify the best answer for a statement
conveyed by a human agent. The work in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] adopts an argumentative-based chatbot to provide
recommendations and explanations to help stroke patients in self-managing their condition, in
collaboration with healthcare professionals. Same objectives are shared with the work in [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ].
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] approach to dialogue management using chatbots in combination with social practices
and argumentation theory. The use of social practice theory provides a way to contextualise
the dialogue and thus providing all kinds of background information that can be subsequently
used to interpret the input of the student and also to guide the conversation.
      </p>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusions and Future Work</title>
      <p>In this paper we have described the whole procedure we followed in order to create a chatbot
that uses solutions based on Abstract Argumentation as a method to generate answers to be
given to the user interacting with the chatbot.</p>
      <p>We started by studying the basic concepts of argumentation and applied them to our database,
writing procedures for selecting topics as answers. Finally, we designed and implemented a
web interface with which users can interact with the chatbot.</p>
      <p>
        As future work we will consider the possibility to add arguments and relations (i.e., supports
and attacks) dynamically to the argumentation graph directly during the conversation with the
user. The current implementation is endowed with a centralised store that serves as a knowledge
base for the agents. We would like to devise a model in which the store is, instead, distributed.
Moreover, we plan to extend ConArgLib [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] to deal with support relations and integrate it with
the chatbot, instead of relying on Aspartix. For this purpose, a meta-argumentation approach
such as the one used in [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] could be considered.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Shevat</surname>
          </string-name>
          ,
          <article-title>Designing bots: Creating conversational experiences,</article-title>
          <string-name>
            <surname>O'Reilly Media</surname>
          </string-name>
          , Inc.,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>P. M.</given-names>
            <surname>Dung</surname>
          </string-name>
          ,
          <article-title>On the acceptability of arguments and its fundamental role in nonmonotonic reasoning, logic programming and n-person games</article-title>
          ,
          <source>Artif. Intell</source>
          <volume>77</volume>
          (
          <year>1995</year>
          )
          <fpage>321</fpage>
          -
          <lpage>357</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>H.</given-names>
            <surname>Prakken</surname>
          </string-name>
          ,
          <article-title>Historical overview of formal argumentation</article-title>
          ,
          <source>FLAP</source>
          <volume>4</volume>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>S.</given-names>
            <surname>Bistarelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Taticchi</surname>
          </string-name>
          ,
          <article-title>Towards an implementation of a concurrent language for argumentation</article-title>
          ,
          <source>in: AIxIA</source>
          <year>2020</year>
          , volume
          <volume>12414</volume>
          <source>of LNCS</source>
          , Springer,
          <year>2020</year>
          , pp.
          <fpage>154</fpage>
          -
          <lpage>171</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>S.</given-names>
            <surname>Bistarelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Taticchi</surname>
          </string-name>
          ,
          <article-title>A concurrent language for argumentation</article-title>
          ,
          <source>in: AI3@AIxIA</source>
          <year>2020</year>
          , volume
          <volume>2777</volume>
          <source>of CEUR Workshop Proceedings, CEUR-WS.org</source>
          ,
          <year>2020</year>
          , pp.
          <fpage>75</fpage>
          -
          <lpage>89</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>S.</given-names>
            <surname>Bistarelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Taticchi</surname>
          </string-name>
          ,
          <article-title>Introducing a tool for concurrent argumentation</article-title>
          ,
          <source>in: JELIA</source>
          <year>2021</year>
          , volume
          <volume>12678</volume>
          <source>of LNCS</source>
          , Springer,
          <year>2021</year>
          , pp.
          <fpage>18</fpage>
          -
          <lpage>24</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>C.</given-names>
            <surname>Cayrol</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Lagasquie-Schiex</surname>
          </string-name>
          ,
          <article-title>On the acceptability of arguments in bipolar argumentation frameworks</article-title>
          ,
          <source>in: ECSQARU</source>
          <year>2005</year>
          , volume
          <volume>3571</volume>
          <source>of LNCS</source>
          , Springer,
          <year>2005</year>
          , pp.
          <fpage>378</fpage>
          -
          <lpage>389</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>W.</given-names>
            <surname>Dvorák</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. A.</given-names>
            <surname>Gaggl</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Rapberger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. P.</given-names>
            <surname>Wallner</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Woltran</surname>
          </string-name>
          ,
          <article-title>The ASPARTIX system suite</article-title>
          ,
          <source>in: COMMA</source>
          <year>2020</year>
          , volume
          <volume>326</volume>
          <source>of FAIA</source>
          , IOS Press,
          <year>2020</year>
          , pp.
          <fpage>461</fpage>
          -
          <lpage>462</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>L. A.</given-names>
            <surname>Chalaguine</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hunter</surname>
          </string-name>
          ,
          <article-title>A persuasive chatbot using a crowd-sourced argument graph and concerns</article-title>
          ,
          <source>in: COMMA</source>
          <year>2020</year>
          , volume
          <volume>326</volume>
          <source>of FAIA</source>
          , IOS Press,
          <year>2020</year>
          , pp.
          <fpage>9</fpage>
          -
          <lpage>20</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>L. A.</given-names>
            <surname>Chalaguine</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hunter</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. W. W.</given-names>
            <surname>Potts</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Hamilton</surname>
          </string-name>
          ,
          <article-title>Impact of argument type and concerns in argumentation with a chatbot</article-title>
          ,
          <source>in: ICTAI</source>
          <year>2019</year>
          , IEEE,
          <year>2019</year>
          , pp.
          <fpage>1557</fpage>
          -
          <lpage>1562</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>E.</given-names>
            <surname>Hadoux</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hunter</surname>
          </string-name>
          ,
          <article-title>Comfort or safety? gathering and using the concerns of a participant for better persuasion</article-title>
          ,
          <source>Argument Comput</source>
          .
          <volume>10</volume>
          (
          <year>2019</year>
          )
          <fpage>113</fpage>
          -
          <lpage>147</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>D.</given-names>
            <surname>Toniuc</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Groza</surname>
          </string-name>
          ,
          <string-name>
            <surname>Climebot:</surname>
          </string-name>
          <article-title>An argumentative agent for climate change</article-title>
          ,
          <source>in: ICCP</source>
          <year>2017</year>
          , IEEE,
          <year>2017</year>
          , pp.
          <fpage>63</fpage>
          -
          <lpage>70</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>N.</given-names>
            <surname>Kökciyan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            <surname>Sassoon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Sklar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Modgil</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Parsons</surname>
          </string-name>
          ,
          <article-title>Applying metalevel argumentation frameworks to support medical decision making</article-title>
          ,
          <source>IEEE Intell. Syst</source>
          .
          <volume>36</volume>
          (
          <year>2021</year>
          )
          <fpage>64</fpage>
          -
          <lpage>71</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>I.</given-names>
            <surname>Sassoon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Kökciyan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Sklar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Parsons</surname>
          </string-name>
          ,
          <article-title>Explainable argumentation for wellness consultation</article-title>
          ,
          <source>in: EXTRAAMAS</source>
          <year>2019</year>
          , volume
          <volume>11763</volume>
          <source>of LNCS</source>
          , Springer,
          <year>2019</year>
          , pp.
          <fpage>186</fpage>
          -
          <lpage>202</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>F.</given-names>
            <surname>Dignum</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Bex</surname>
          </string-name>
          ,
          <article-title>Creating dialogues using argumentation and social practices</article-title>
          ,
          <source>in: INSCI</source>
          <year>2017</year>
          , volume
          <volume>10750</volume>
          <source>of LNCS</source>
          , Springer,
          <year>2017</year>
          , pp.
          <fpage>223</fpage>
          -
          <lpage>235</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>S.</given-names>
            <surname>Bistarelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Rossi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Santini</surname>
          </string-name>
          ,
          <article-title>Conarglib: an argumentation library with support to search strategies and parallel search</article-title>
          ,
          <source>J Exp Theor Artif Intell</source>
          <volume>0</volume>
          (
          <year>2020</year>
          )
          <fpage>1</fpage>
          -
          <lpage>28</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>G.</given-names>
            <surname>Alfano</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Cohen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Gottifredi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Greco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Parisi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G. R.</given-names>
            <surname>Simari</surname>
          </string-name>
          ,
          <article-title>Dynamics in abstract argumentation frameworks with recursive attack and support relations</article-title>
          ,
          <source>in: ECAI</source>
          <year>2020</year>
          , volume
          <volume>325</volume>
          <source>of Frontiers in Artificial Intelligence and Applications</source>
          , IOS Press,
          <year>2020</year>
          , pp.
          <fpage>577</fpage>
          -
          <lpage>584</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>