<!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>Integrated, Ubiquitous and Collaborative Process Mining with Chat Bots</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Software and Process Engineering Technical University of</institution>
          <country country="DK">Denmark</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Within the process mining eld we are witnessing a tremendous growth of applications and development frameworks available to perform data analyses. Such growth, which is very positive and desirable, comes with the cost of learning each new tool and di culties in integrating di erent systems in order to complement the analyses. In addition, we are noticing the lack of tools enabling collaboration among the users involved in a project. Finally, we think it would be highly recommended to enable ubiquitous processing of data. This paper proposes a solution to all these issues by presenting a chat bot which can be included in discussions to enable the execution of process mining directly from the chat.</p>
      </abstract>
      <kwd-group>
        <kwd>Process Mining Chat bots Ubiquitous computing</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Process mining [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] has been gaining more attention over the previous years,
becoming an impactful discipline, both in terms of research maturity and
applications/implementations availability. It comprises the analysis of data referring
to business process events and, within itself, it is possible to identify several
sub-disciplines, such as control- ow discovery, conformance checking and
process extension [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>
        With a multitude of tools available, both as standalone, web applications and
libraries, process mining projects can now be completed taking advantage of a
broad range of possibilities. In particular, just by focusing on the open source
tools, one of the leading software is ProM [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] (with its ProM Lite variant). In
addition, some libraries are becoming popular, since they allow the development
of software in di erent programming languages, such as bupaR [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] (for the R
language) and PM4Py [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] (for the Python language). Data can be exchanged
between these tools, for example by using the XES standard [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], however,
combining these tools together can become cumbersome as it is always necessary to
dump the log and change environment.
      </p>
      <p>
        Another important issue, that only recently is receiving attention [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], is the
role of human involvement in the data analysis process [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Speci cally, all
process mining tools currently available do not allow the collaborative execution of
mining projects. Many of them provide functionalities to share the results of the
analysis, for example via web dashboards, but there is no support for true
collaboration and interaction. The increasing availability of network connections and
smart-devices should be a key driver of human involvement in mining projects.
      </p>
      <p>To address all these challenges, the tool described in this paper has been
designed with the following functional requirements in mind:
{ To propose a uniform interface to interact with any number of process mining
applications in a seamless way and without the need of confronting every
time a steep learning curve;
{ To enable collaboration on process mining projects by design: not just
sharing intermediate or nal results, but discussing and performing each
individual step of the analysis in real-time and allow all persons involved to
contribute to it;
{ To enable ubiquitous and truly platform independent execution of process
mining projects (e.g., start a mining session at the o ce PC, continue on the
smartphone while commuting, and nish the analysis at home, on a tablet).</p>
      <p>The rest of the paper is structured as follows: Sec. 2 reports some technical
details about the tool, Sec. 3 describes the main implementation details, and
nally Sec. 4 concludes the paper.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Technical Details</title>
      <p>
        The strategy we decide to adopt in order ful ll our requirements is to develop
a chat bot [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] (sometimes also referred to as chatter bot ) that can be included
in a discussion on an instant messaging platform. Such bot, in turn, enables
to interact with it in order to perform speci c steps of the analysis (i.e., the
actual process mining) and sharing the results with all people involved in the
discussion.
      </p>
      <p>The general idea behind a chat bot is to exploit the APIs o ered by di erent
instant messaging systems and de ne a software, i.e. the bot, that consumes each
message sent by the participants in a discussion. Whenever a message matches
a prede ned pattern (also known as command ) which is recognized by the bot,
the software performs some actions and sends the response back into the
discussion so that all participants can read it. The software that runs the bot has
to be executed in a machine, i.e. a server, which has access to the APIs of the
instant messaging. In the context of this paper, we decided to use the instant
messaging platform Telegram1 due to its explicit support of chat bots, as well
as its portability, which is manifested in a number of implementations available
for a large number of platforms, including open source applications2.</p>
      <p>The chat bot we devised, which is called Process Mining Bot (or pmbot),
assumes that each chat is analyzing a single log at the time. This log, called the</p>
      <sec id="sec-2-1">
        <title>1 See https://telegram.org/. 2 See https://telegram.org/apps.</title>
        <p>ProM
bupaR
PM4Py</p>
        <p>pmbot
pyTelegramBotAPI</p>
        <p>Chat cj
Chat ck</p>
        <p>Chat ci
current log, is provided to the bot by sharing it within the chat. When a le is
shared, the pmbot automatically is noti ed and, if such le contains an event
log, the server running the pmbot will download it and it will be used for all
following analyses. By uploading a new le, the current log is overwritten with
the new one. It is important to note that if a le containing the log is uploaded
in a chat, it is not necessary for all clients to download it (in fact, only the pmbot
has to download it). This is of critical importance as it enables the analysis also
in devices where memory is a precious resource, such as smart-phones.</p>
        <p>
          As depicted on the right-hand side of Figure 1, the Process Mining Bot can
be included in as many chats as needed: it will keep track of each of them
individually and therefore each chat will have its own current log. The left-hand
side of Figure 1 depicts the three di erent process mining frameworks, written
in three di erent programming languages that the current implementation of
the pmbot interacts with ProM [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ], bupaR [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ], and PM4Py [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]. As previously
mentioned, the pmbot interacts with the other chat members by \reading" each
event being generated in the chat and, whenever one of these messages matches
one of the commands, this is recognized and the corresponding action is triggered.
The current implementation of the pmbot supports the following commands:
nstart This command initiates a new process mining session, by asking a license
code, needed to use the resources required by the bot;
ndescribelog Command to produce general log statistics, including the number
of traces in the log, the number of activities, their distribution and a couple
of charts with the duration of the process instances and the events over time.
        </p>
        <p>
          This command uses the PM4Py library;
nhm [DEP THR] This command runs the Heuristics Miner algorithm [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] and
sends back pictures (one with the heuristics net and another with the Petri
net) of the mined model. The default value of the dependency threshold can
be overwritten. This command uses the PM4Py library;
nalpha This command performs the Alpha Miner algorithm [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] on the current
log. This command uses the PM4Py library;
ndfg This command computes and returns the Direct Following Graph
computed on the current log using the PM4Py library;
nim Command to perform the Inductive Miner algorithm [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] on the current log
and to get the picture of the resulting model. This command uses ProM;
nprecedencematrix This command produces the precedence matrix of all
activities in the current log by using the bupaR library;
ndottedchart, nrelativedottedchart These two commands plot the dotted
chart of the current log by using either a relative or absolute time scale.
        </p>
        <p>These commands use the bupaR library;
nresources Command to plot how often each resource is involved in an event,
by using the bupaR library;
nkeepactivities This command changes the current log by ltering it in order
to keep only some activities. The user can enter the name of all activities to
keep until a special termination command is given;
nremovefilters This command can be used to reset the current log to its
original form (i.e., the same status as it has been uploaded). It is useful to reset
the current log whenever the users want to the applied lters.</p>
        <p>The current set of commands already allows several interesting analyses.
Actually, in all data and process mining projects it is arguable that the most
important element of the analysis are the users who have to be smart in (i)
understanding which algorithm is the most suitable in the given setting and (ii) interpreting
the results of the mining algorithm. On top of this, the ability to recursively
apply lters allows the investigation to go beyond the raw log.</p>
        <p>Whenever treating data, one of the most delicate elements is the con
dentiality of the data. Whenever implementing a bot it is important to understand that
it is actually just an application running on someone's machine and the owner
of such machine has access to the log. Therefore, in case the data to be mined is
con dential it might be wise to have an in house and trusted machine allocated
to the purpose. In addition to the machine running the pmbot, when the log is
uploaded it has to transit over the Telegram's servers. To impede Telegram from
being able to read the log, the current implementation supports encrypted zip
les for transmitting the le. Of course, more advanced techniques (e.g., GPG)
might be easily implemented as well.</p>
        <p>A second element to be considered is the accountability of the activities
performed by the bot: if the log le is very large, the machine running the
pmbot might require a vast amount of resources. For this reason, in the current
implementation of the bot we introduced a limit on the size of the event log
(easily adjustable in the con guration le) and, in order to send any command,
it is necessary to enter a \license code". This code enables the access to speci c
set of functionalities and time-based coded might also be implemented to grant
access only for limited periods.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3 Implementation Details</title>
      <p>The Process Mining Bot has been implemented as a standalone Python
software, exploiting the Telegram API3 and, in particular, the corresponding Python</p>
      <sec id="sec-3-1">
        <title>3 See https://core.telegram.org/bots/api.</title>
        <p>
          wrapping implemented in the pyTelegramBotAPI4. The current version of the
software embeds the PM4Py libraries. In order to execute bupaR and ProM,
external calls are done using the subprocess Python module. The complete source
code of the bot is available in GitHub at https://github.com/delas/pmbot.
A screencast showing all functionalities in a mock-up session is available at
https://youtu.be/eg8jJ3bB0NI. Finally, a detailed tutorial presenting a walk
through of the basic steps in order to interact with the bot is available at [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Conclusions</title>
      <p>In this paper we presented an innovative technique of completing process
mining projects in a collaborative, ubiquitous, platform independent and integrated
manner. The technique exploits the idea of chat bots and, by including them
into existing instant messaging discussions, it is possible to have direct access to
process mining functionalities. The prototype implementation presented in this
paper is available for Telegram and the bot is capable of executing commands
on ProM, bupaR, and PM4Py.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>van der Aalst</surname>
          </string-name>
          , W.M.: Process Mining. Springer, second edn. (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>van der Aalst</surname>
            ,
            <given-names>W.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weijters</surname>
          </string-name>
          , T.A.
          <string-name>
            <surname>J.M.M.</surname>
          </string-name>
          <article-title>: Rediscovering Work ow Models from Event-based Data Using Little Thumb</article-title>
          .
          <source>Integr Comput Aided Eng</source>
          <volume>10</volume>
          (
          <issue>2</issue>
          ) (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>van der Aalst</surname>
            ,
            <given-names>W.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weijters</surname>
            ,
            <given-names>T.A.J.M.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Maruster</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>Work ow Mining: Discovering Process Models from Event Logs</article-title>
          .
          <source>IEEE Trans Knowl Data Eng</source>
          <volume>16</volume>
          (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Ankerst</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Human Involvement and Interactivity of the Next Generation's Data Mining Tools</article-title>
          . In: ACM SIGMOD DMKD, position paper (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Berti</surname>
          </string-name>
          , A., van Zelst, S., van der Aalst, W.:
          <article-title>Process Mining for Python (PM4Py): Bridging the Gap Between Process-</article-title>
          and
          <string-name>
            <given-names>Data</given-names>
            <surname>Science</surname>
          </string-name>
          .
          <source>In: CEUR-WS Online Proceedings of the ICPM Demo Track</source>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Burattin</surname>
          </string-name>
          , A.: pmbot
          <string-name>
            <surname>Tutorial</surname>
          </string-name>
          (
          <year>2019</year>
          ), https://github.com/delas/pmbot/wiki
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. Gunther,
          <string-name>
            <given-names>C.W.</given-names>
            ,
            <surname>Verbeek</surname>
          </string-name>
          ,
          <string-name>
            <surname>E.H.M.W.</surname>
          </string-name>
          : XES Standard De nition. www.xesstandard.org (
          <year>2009</year>
          ), http://www.xes-standard.org/
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>IEEE</given-names>
            <surname>Task</surname>
          </string-name>
          <article-title>Force on Process Mining: Process Mining Manifesto</article-title>
          .
          <source>In: Business Process Management Workshops</source>
          . pp.
          <volume>169</volume>
          {
          <fpage>194</fpage>
          . Springer-Verlag (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Janssenswillen</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Depaire</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Swennen</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jans</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vanhoof</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          : bupaR:
          <article-title>Enabling reproducible business process analysis</article-title>
          .
          <source>Knowl Based Syst</source>
          <volume>163</volume>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Leemans</surname>
            ,
            <given-names>S.J.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fahland</surname>
          </string-name>
          , D., van der Aalst, W.M.:
          <article-title>Discovering Block-Structured Process Models from Event Logs - A Constructive Approach</article-title>
          .
          <source>In: Proceedings of Petri Nets</source>
          . pp.
          <volume>311</volume>
          {
          <fpage>329</fpage>
          . Springer Berlin Heidelberg (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Mauldin</surname>
            ,
            <given-names>M.L.</given-names>
          </string-name>
          :
          <article-title>ChatterBots, Tinymuds, and the Turing Test: Entering the Loebner Prize Competition</article-title>
          .
          <source>In: AAAI</source>
          . vol.
          <volume>94</volume>
          , pp.
          <volume>16</volume>
          {
          <issue>21</issue>
          (
          <year>1994</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Minku</surname>
            ,
            <given-names>L.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mendes</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Turhan</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Data mining for software engineering and humans in the loop</article-title>
          .
          <source>Progress in Arti cial Intelligence</source>
          <volume>5</volume>
          (
          <issue>4</issue>
          ),
          <volume>307</volume>
          {314 (Nov
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Verbeek</surname>
            ,
            <given-names>E.H.M.W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Buijs</surname>
            , J., van Dongen,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>van der Aalst</surname>
          </string-name>
          , W.M.
          <article-title>: ProM 6: The Process Mining Toolkit</article-title>
          .
          <source>In: BPM 2010 Demo</source>
          . pp.
          <volume>34</volume>
          {
          <issue>39</issue>
          (
          <year>2010</year>
          )
          <article-title>4 See https</article-title>
          ://github.com/eternnoir/pyTelegramBotAPI.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>