<!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>NLP as a Service: An API to Convert between Process Models and Natural Language Text</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Thomas Freytag</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Benjamin Kanzler</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Nils Leger</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Daniel Semling</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Cooperative State University (DHBW) Karlsruhe</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Natural Language Processing, NLP as a Service</institution>
          ,
          <addr-line>Webservice, BPMN, PNML</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>An interesting extension of contemporary BPM tools is the ability to export graphical process models into natural language and vice versa, i.e. to mine a graphical process model from a description in natural language. Both transformations are computationally complex Natural Language Processing (NLP) problems and usually require elaborated algorithms, data structures, and IT resources. This contribution describes the architecture of a platform providing NLP-based conversion in both directions as a service, i.e. via a public webservice interface, addressing BPM users or modelers as well as software engineers aiming to add NLP features to existing BPM tools.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>This contribution is about a resource allowing NLP-based transformations between graphical
models and natural language via a public webservice. Currently supported modeling languages
are PNML (workflow Petri nets) and BPMN. The resource can either be used on a publicly
available shared server or tailored, built, and deployed on own premises.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Architecture of NLP as a Service</title>
      <p>The general architecture of the resource is shown in figure 1. The two webservice applications
for verbalizing a model into a text (“Process2Text” or short P2T) and for mining a model from a
text (“Text2Process” or short T2P) are deployed in separate docker containers1, providing all
necessary NLP algorithms and data structures (named here “NLP libraries”). The algorithms
of these two components are described in more detail in the following sections 3 and 4 of this
paper.</p>
      <p>
        On the frontend side, users can access the provided NLP functions via a simple website or by
calling the REST API directly on source code level. Both functions accept a string parameter as
input and return a string as output. Examples scenarios for using the service from the client
perspective are shown in section 5. More details on the structure of the webservice API and
how to call the service from other software products can be taken from the additional document
delivered with this publication ([
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]).
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Backend Software of the P2T Webservice</title>
      <p>We first have a look at the P2T part of the application, the T2P part will follow in the next section.
The algorithm is mainly based on the original open source software developed belonging to the</p>
      <sec id="sec-3-1">
        <title>1Docker is an open-source container virtualization software (http://www.docker.com)</title>
        <p>
          research performed by Henrik Leopold et. al. [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] and has been adapted and extended over the
years by the authors of this paper. Figure 2 shows the outline of the P2T algorithm.
        </p>
        <p>
          The conversion takes a process model as input and starts with extracting the relevant linguistic
information (“Text Planning”), mainly by analyzing labels of tasks and task-related resource
assignments. The tagging and parsing is done with support of the freely available Stanford
CoreNLP toolset 2 and the linguistic database WordNet3. The result is converted to a Refined
Process Structure Tree (RPST), a generic data structure for process graph components as
introduced in [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. Afterwards various heuristics to restructure and fine-tune the RPST ( “Text
Structuring) are applied, followed by “Sentence Planning” in order to create grammatically
correct sentence structures. The RPST leaves are processed and enriched with semantic
information derived from the control flow of the graph, leading to the construction of a Deep
Syntactic Tree (DSyncT). After the additional refinement of text fragments, a realizer tool is
applied in order to generate a naturally-sounding English text which is finally returned to the
caller. The source code of the service and additional documention can be found on GitHub
under http://github.com/tfreytag/P2T.
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Backend Software of the T2P Webservice</title>
      <p>
        The opposite direction of the transformation (T2P) is as well based on an existing open source
software product implementing the research published in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and has been enhanced
and adapted. As in the case of P2T, the algorithms make use of third-party open source software
tools and data structures. Figure 3 shows the major steps of the T2P algorithm. As a first
step, the input string is analyzed by the Stanford CoreNLP parser and split up into sentences
and words according to the underlying grammar rules. The subsequent steps make use of
WordNet (see above) and FrameNet4. After this, the semantically relevant elements of the
textual process model (i.e. actors, actions, business objects, resources) can be determined. The
result is written into a data structure “WorldModel” containing all contributing model elements
and their interrelations. Finally, the WorldModel is converted into the preselected native process
      </p>
      <sec id="sec-4-1">
        <title>2http://nlp.stanford.edu/software/lex-parser.shtml</title>
        <p>3http://wordnet.princeton.edu
4http://framenet.icsi.berkeley.edu/fndrupal
model format. The last step is to compute a visual layout for the automatically generated process
graph. This can be either done on server side or on client side. The source code of the service
and additional documention can be found on GitHub under http://github.com/tfreytag/T2P.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Client Software using NLP as a Service</title>
      <p>
        A reference software for using NLP as a Service is WoPeD5, a tool which has already been
presented at previous BPM conferences [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ].
      </p>
      <sec id="sec-5-1">
        <title>5Workflow Petrinet Designer, http://www.woped.org</title>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusion and Outlook</title>
      <p>
        The described resource “NLP as a Service” provides a standardized interface to access P2T and
T2P conversion features for BPM tools. Modelers can either export their process model into a
readable text, or create a process model from a given textual description. Various practical as
well as scientific use cases can be identified. An existing reference application is WoPeD [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. In
the future, further enhancements of both NLP algorithms as well as support for other modelling
languages like e.g. EPCs are planned.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Freytag</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Allgaier</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Burattin</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Danek-Bulius</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>WoPeD - A “Proof-of-Concept” Platform for Experimental BPM Research Projects</article-title>
          ,
          <source>In: Proceedings of the BPM Demo Sessions</source>
          , Barcelona,
          <year>September 2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Freytag</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Allgaier</surname>
            ,
            <given-names>P.:</given-names>
          </string-name>
          <article-title>WoPeD goes NLP: Conversion between Workflow Nets and Natural Language</article-title>
          . BPM Conference Demo Session. http://ceur-ws.org/Vol2196/BPM_2018_paper_21.pdf, Sydney, Australia,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Friedrich</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Mendling</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Puhlmann</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Process Model Generation from Natural Language Text</article-title>
          . In: Mouratidis H.; Rolland C. (eds):
          <source>Advanced Information Systems Engineering (CAiSE</source>
          <year>2011</year>
          ). LNCS vol.
          <volume>6741</volume>
          , Springer, Berlin,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Leopold</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          :
          <source>Natural Language in Business Process Models: Theoretical Foundations, Techniques, and Applications. Lecture Notes in Business Information Processing</source>
          , Vol.
          <volume>168</volume>
          , Springer, Berlin,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Leopold</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Mendling</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Polyvyanyy</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Generating Natural Language Texts from Business Process Models</article-title>
          . In: Ralyté,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Franch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            ,
            <surname>Brinkkemper</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Wrycza</surname>
          </string-name>
          , S. (eds)
          <article-title>Advanced Information Systems Engineering</article-title>
          . CAiSE
          <year>2012</year>
          . LNCS vol.
          <volume>7328</volume>
          . Springer, Berlin,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Polyvyanyy</surname>
            <given-names>A.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Vanhatalo J.; Völzer</surname>
            <given-names>H.</given-names>
          </string-name>
          :
          <article-title>Simplified Computation and Generalization of the Refined Process Structure Tree</article-title>
          . In: Bravetti M.;
          <string-name>
            <surname>Bultan</surname>
            <given-names>T</given-names>
          </string-name>
          . (eds) Web Services and
          <string-name>
            <given-names>Formal</given-names>
            <surname>Methods</surname>
          </string-name>
          . LNCS vol.
          <volume>6551</volume>
          , Springer, Berlin,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Riefer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Ternis</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ; Thaler,
          <string-name>
            <surname>T:</surname>
          </string-name>
          <article-title>Mining Process Models from Natural Language Text: A State-of-the-Art Analysis</article-title>
          .
          <source>Processings of Multikonferenz Wirtschaftsinformatik (MKWI 16), March</source>
          <volume>9</volume>
          -11, Illmenau, Germany,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Freytag</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Kanzler</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Leger</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Semling</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>NLP as a Service - Technical Documentation</article-title>
          , https://woped.dhbw-karlsruhe.de/wp-content/uploads/TechnicalDocumentation.pdf.
          <source>Accessed on July 30th</source>
          ,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>