<!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>The Droid You're Looking For: C-4PM, a Conversational Agent for Declarative Process Mining⋆</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Yago Fontenla-Seco</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sarah Winkler</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alessandro Gianola</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marco Montali</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Manuel Lama</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alberto Bugarín-Diz</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Centro Singular de Investigación en Tecnoloxías Intelixentes (CiTIUS)</institution>
          ,
          <addr-line>Universidade de Santiago de Compostela</addr-line>
          ,
          <country country="ES">Spain</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Free University of Bozen-Bolzano</institution>
          ,
          <addr-line>Bolzano</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2023</year>
      </pub-date>
      <fpage>10</fpage>
      <lpage>15</lpage>
      <abstract>
        <p>The efective presentation of process models to non-expert users in a way that allows them to understand and query these models is a well-known research challenge. Conversational interfaces, with their low expertise requirements, ofer a potential solution. While procedural models like Petri nets are not ideal for linguistic presentation, declarative models, specifically the Declare specification, provide a more suitable option. This paper introduces C-4PM, the ifrst conversational agent for declarative process specifications. C-4PM facilitates tasks such as consistency, conformance, and model checking through a conversation-driven modular pipeline. The feasibility of the tool was assessed through a preliminary evaluation on a healthcare process.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Process Mining</kwd>
        <kwd>Conversational Agent</kwd>
        <kwd>Declare</kwd>
        <kwd>NLP</kwd>
        <kwd>NLG</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Process model understandability and interpretability is widely recognized as an open
challenge by the Process Mining community [
        <xref ref-type="bibr" rid="ref1 ref2 ref3 ref4">1, 2, 3, 4</xref>
        ]. Highly technical knowledge is
needed to understand process models, particularly in complex environments like healthcare
[
        <xref ref-type="bibr" rid="ref3 ref5 ref6">3, 5, 6</xref>
        ]. Process models are most typically presented as visualizations using imperative or
procedural representations, such as Petri nets or directly-follows graphs (DFGs). DFGs
are the most commonly used due to their simplicity and ability to highlight process issues.
However, experts caution that DFGs can be prone to misinterpretation, especially when
viewed with filtered data [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. In contrast to imperative process modeling, declarative
process specifications, such as those obtained with the Declare language [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], seek to
balance flexibility and control by characterizing a process with a set of constraints on the
allowed and forbidden action patterns. While this results in compact specifications, the
hidden dependencies [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] emerging from the interplay of constraints make it very dificult
to understand which traces are accepted or rejected by a declarative specification [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
      <p>
        Making (declarative) process mining accessible to non-expert users calls for developing
more efective methods that enhance process model understanding, mitigate
misinterpretations, and promote accurate insights. This is especially relevant in complex environments
like healthcare, where users possess the domain expertise required to pose relevant queries
over their processes, but lack expertise in process mining. For this purpose, we present
C-4PM,1 the first conversational agent for declarative process mining. Based on an event
log (and optionally a Declare specification), C-4PM has the ability to discover the
declarative specification of a process and perform multiple reasoning tasks, such as consistency,
conformance and model checking. Interacting with the user via a text interface, C-4PM
takes as input a question expressed in natural language, identifies the user intention and,
exploiting a Large Language Model (LLM), translates the relevant parts of the input into
an intermediate abstract logical representation that can be appropriately used for the
reasoning task identified. Finally, C-4PM expresses the result back in natural language
via the LLM. The motivation to use declarative process specifications comes not only from
the capacity of expressing Declare patterns directly in natural language, but also because
these patterns cover the majority of relationships between activities that are important
in practice. Declare supports the specification of constraints on the temporal evolution
of a process, without explicitly indicating how process instances should be routed and
thus being more flexible than imperative models [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Furthermore, as it is grounded in
Linear Temporal Logic on Finite Traces (LTLf), this allows to perform reasoning tasks
based on this logic. Indeed, C-4PM delegates all reasoning tasks to dedicated tools for
Declare and LTLf, using the LLM only for linguistic expression.
      </p>
      <p>
        Related work. Although the potential of Natural Language Processing (NLP) and
Natural Language Generation (NLG) for Business Process Management (BPM) was
recognized a decade ago [
        <xref ref-type="bibr" rid="ref11 ref12">11, 12</xref>
        ], the practical implementation of process mining tools
with natural language interfaces has been limited. NLG has been used to explain event
logs and processes to users [
        <xref ref-type="bibr" rid="ref13 ref14">13, 14</xref>
        ], and to verbalize BPMN models [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], but without
explicitly supporting reasoning and querying. NLP techniques have also been used to
extract BPMN models from textual descriptions of processes [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. More recently, a
conversational interface for process mining was proposed; however, restricted to existing
process mining tools (based on imperative models) and lacking reasoning support [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. C-4PM: Overview and Features</title>
      <p>
        C-4PM is based on the Rasa Framework [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] and is divided in two main components: the
Rasa Stack (or Rasa Open Source) and the Action Server (based on the Rasa SDK). In
the Rasa Stack, the Natural Language Understanding (NLU) module handles user intent
classification and entity extraction from the user input; and the Rasa Core module is in
charge of the dialogue management i.e.: deciding the next action in the conversation based
1Repository with source code, documentation and demonstration: https://github.com/Yagouus/c-4pm
on the context and user input. Once an action is decided by the dialogue manager, the
Action Server runs the appropriate reasoning tasks and generates the response that will
be delivered to the user. All components work together to enable efective communication
and interaction in the conversational system.
      </p>
      <p>
        Reasoning is supported by the NL2LTL [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] and Declare4Py [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] frameworks. NL2LTL
is in charge of translating the natural language input of the user to an appropriate
LTLf formula that can be used by Declare4Py for multiple reasoning tasks. When the
NLU module identifies that the user intent is to perform a reasoning task in which
some LTLf formula has to be extracted from the input, the NL2LTL module is called.
NL2LTL can operate with two diferent engines, namely a RASA implementation and a
GPT one, in our particular case the GPT engine is used as we have extended the LTLf
formulas originally supported by NL2LTL and we found that adapting the prompt used
with the GPT engine yields more accurate results that those obtained by modifying the
original RASA engine. Declare4Py is a Python library based on the Declare language
that is designed to analyze processes using declarative, constraint-based models (process
specifications). Backed by Declare4Py, C-4PM has the ability to automatically discover
the declarative specification of a process based on event log data using the approach
presented in [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ] and perform all reasoning tasks supported by Declare4Py, namely:
conformance, consistency, model, and query checking2.
      </p>
      <p>
        Running example To better illustrate how C-4PM operates we will use an example
based on the Sepsis event log [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]. This log contains 1050 traces describing the treatment
process of sepsis patients in a Dutch hospital. For instance, users can ask:3
2Even though supported by Declare4Py, multi-perspective Declare in C-4PM is proposed as future work.
3All tasks with exemplary queries can be found in the project’s repository: https://github.com/Yagouus/c-4pm
• “Explain the model of the process”, for the system to explain the discovered
Declare specification in natural language to grasp a general idea of it (specification
description).
• If the discovered (or given as input) Declare specification allows for any trace at all
(consistency checking) as a way of checking if the specification is correct and aligns
with the event log e.g.: “Does the model allow for any behavior?”.
• Examples of traces that conform (or not) to the specification to get a general idea
of the frequent behavior in the process can be retrieved by asking “Can you give
me traces from the log that conform to the model?”, i.e., for conformance checking.
• To know whether some behavior is supported by the model, e.g., whether it is
possible that patients experience first admission to normal care, and later on to
intensive care, one may ask “Is it possible that activity Admission IC occurs after
activity Admission NC has taken place?”. This constitutes a form of model checking.
• Knowing that cases in which the above behavior happens are considered
problematic [20, p.299], a user might ask “Are there cases where Admission IC happens
after Admission NC?”.
      </p>
      <p>In the latter two cases, C-4PM translates the user input to LTLf and to the corresponding
Declare constraint response(AdmissionNC, AdmissionIC), and checks in the former case
whether it is consistent with the model, and in the latter uses it for conformance checking.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Evaluation and Future Work</title>
      <p>As C-4PM is a proof-of-concept implementation, extensive experiments are left for
future work. However, all the described functionality can already be used and tested. A
preliminary user validation has been conducted with process mining experts to evaluate its
performance. The performed tests have yielded positive results, indicating the potential
efectiveness of the tool in addressing the challenges of presenting process models and
facilitating the interaction of non-expert users with a declarative process specification;
efectively allowing them to perform multiple reasoning tasks in a transparent and
understandable manner. While further investigation and evaluation are necessary to fully
assess the maturity and reliability of the tool, the initial feedback provides promising
indications of its viability and potential.</p>
      <p>Future work Future work is focused on enhancing the user experience by exploring new
NLU and NLG techniques, potentially migrating towards a more powerful Large Language
Model (LLM) NLU based systems that can provide a deeper and more context-aware
conversation. Furthermore, expanding the scope of reasoning tasks that the system can
handle, such as complex decision-making and logical inference, would contribute to its
overall efectiveness. Finally, future research eforts should focus on conducting more
comprehensive evaluations to establish the tool’s maturity and reliability in a wider
range of contexts. Conducting a comprehensive user validation study involving a diverse
range of users and scenarios would provide even more valuable insights into the system’s
usability and performance, guiding further improvements and refinements.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>L.</given-names>
            <surname>Barbieri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Madeira</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Stroeh</surname>
          </string-name>
          , W. van der Aalst,
          <article-title>Towards a natural language conversational interface for process mining</article-title>
          ,
          <source>in: PM Workshops</source>
          ,
          <year>2022</year>
          , pp.
          <fpage>268</fpage>
          -
          <lpage>280</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>F.</given-names>
            <surname>Mannhardt</surname>
          </string-name>
          , Responsible Process Mining, Springer,
          <year>2022</year>
          , pp.
          <fpage>373</fpage>
          -
          <lpage>401</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>E.</given-names>
            <surname>Rojas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Munoz-Gama</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Sepúlveda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Capurro</surname>
          </string-name>
          ,
          <article-title>Process mining in healthcare: A literature review</article-title>
          ,
          <source>Journal of Biomedical Informatics</source>
          <volume>61</volume>
          (
          <year>2016</year>
          )
          <fpage>224</fpage>
          -
          <lpage>236</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>I.</given-names>
            <surname>Beerepoot</surname>
          </string-name>
          , et al.,
          <article-title>The biggest business process management problems to solve before we die</article-title>
          ,
          <source>Computers in Industry</source>
          <volume>146</volume>
          (
          <year>2023</year>
          )
          <fpage>103837</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>R.</given-names>
            <surname>Mans</surname>
          </string-name>
          ,
          <string-name>
            <surname>W. van der Aalst</surname>
          </string-name>
          , R. Vanwersch,
          <article-title>Process mining in healthcare: evaluating and exploiting operational healthcare processes</article-title>
          ,
          <source>SpringerBriefs in BPM</source>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>E.</given-names>
            <surname>Batista</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Solanas</surname>
          </string-name>
          ,
          <article-title>Process mining in healthcare: A systematic review</article-title>
          ,
          <source>in: Proc. 9th IISA</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>6</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>F.</given-names>
            <surname>Zerbato</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Sofer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Weber</surname>
          </string-name>
          ,
          <article-title>Process mining practices: Evidence from interviews</article-title>
          ,
          <source>in: Business Process Management</source>
          , Springer,
          <year>2022</year>
          , pp.
          <fpage>268</fpage>
          -
          <lpage>285</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>C.</given-names>
            <surname>Di Ciccio</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Montali</surname>
          </string-name>
          ,
          <source>Declarative Process Specifications: Reasoning</source>
          , Discovery, Monitoring, Springer,
          <year>2022</year>
          , pp.
          <fpage>108</fpage>
          -
          <lpage>152</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Montali</surname>
          </string-name>
          , et al.,
          <article-title>Declarative specification and verification of service choreographies</article-title>
          ,
          <source>ACM Trans. Web</source>
          <volume>4</volume>
          (
          <year>2010</year>
          ) 3:
          <fpage>1</fpage>
          -
          <lpage>3</lpage>
          :
          <fpage>62</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>C.</given-names>
            <surname>Haisjackl</surname>
          </string-name>
          , et al.,
          <article-title>Understanding declare models: strategies, pitfalls, empirical results</article-title>
          ,
          <source>Softw. Syst. Model</source>
          .
          <volume>15</volume>
          (
          <year>2016</year>
          )
          <fpage>325</fpage>
          -
          <lpage>352</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>H. van der</given-names>
            <surname>Aa</surname>
          </string-name>
          , et al.,
          <article-title>Challenges and opportunities of applying natural language processing in business process management</article-title>
          ,
          <source>in: 27th COLING</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>2791</fpage>
          -
          <lpage>2801</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>H.</given-names>
            <surname>Leopold</surname>
          </string-name>
          ,
          <source>Natural Language in Business Process Models</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Fontenla-Seco</surname>
          </string-name>
          , et al.,
          <article-title>A framework for the automatic description of healthcare processes in natural language: Application in an aortic stenosis integrated care process</article-title>
          ,
          <source>Journal of Biomedical Informatics</source>
          <volume>128</volume>
          (
          <year>2022</year>
          )
          <fpage>104033</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Fontenla-Seco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Lama</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Bugarín</surname>
          </string-name>
          ,
          <article-title>Process-to-text: A framework for the quantitative description of processes in natural language</article-title>
          , in: Trustworthy AI - Integrating
          <string-name>
            <surname>Learning</surname>
          </string-name>
          ,
          <source>Optimization and Reasoning</source>
          ,
          <year>2021</year>
          , pp.
          <fpage>212</fpage>
          -
          <lpage>219</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>H. van der Aa</surname>
          </string-name>
          , H. Leopold,
          <string-name>
            <given-names>H. A.</given-names>
            <surname>Reijers</surname>
          </string-name>
          ,
          <article-title>Detecting inconsistencies between process models and textual descriptions</article-title>
          ,
          <source>in: Proc. 13th BPM</source>
          ,
          <year>2015</year>
          , pp.
          <fpage>90</fpage>
          -
          <lpage>105</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>T.</given-names>
            <surname>Bocklisch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Faulkner</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Pawlowski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Nichol</surname>
          </string-name>
          , Rasa:
          <article-title>Open source language understanding and dialogue management</article-title>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>F.</given-names>
            <surname>Fuggitti</surname>
          </string-name>
          , T. Chakraborti, NL2LTL
          <article-title>- a python package for converting natural language (NL) instructions to linear temporal logic (LTL) formulas</article-title>
          , in: AAAI,
          <year>2023</year>
          , pp.
          <fpage>16428</fpage>
          -
          <lpage>16430</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>I.</given-names>
            <surname>Donadello</surname>
          </string-name>
          , et al.,
          <article-title>Declare4py: A python library for declarative process mining, in: BPM (PhD/Demos)</article-title>
          ,
          <source>CEUR Workshop Proceedings</source>
          ,
          <year>2022</year>
          , pp.
          <fpage>117</fpage>
          -
          <lpage>121</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>F. M.</given-names>
            <surname>Maggi</surname>
          </string-name>
          , et al.,
          <article-title>Eficient discovery of understandable declarative process models from event logs</article-title>
          ,
          <source>in: CAiSE</source>
          <year>2012</year>
          ,
          <year>2012</year>
          , pp.
          <fpage>270</fpage>
          -
          <lpage>285</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>F.</given-names>
            <surname>Mannhardt</surname>
          </string-name>
          ,
          <string-name>
            <surname>Multi-perspective Process</surname>
            <given-names>Mining</given-names>
          </string-name>
          ,
          <source>Ph.D. thesis</source>
          , Technical University of Eindhoven,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>