<!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>Knowledge Graph based Intelligent Conversational Agent for UK Immigration Case Work⋆</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Smriti Kotiyal</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dhavalkumar Thakker</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Yash Dubal</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>A Y &amp; J Solicitors</institution>
          ,
          <addr-line>London</addr-line>
          <country country="UK">UK</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Bradford</institution>
          ,
          <addr-line>Bradford</addr-line>
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Artificial Intelligence (AI) is reaching every domain relevant to human life. However, within a traditional domain like law, and specifically Immigration Law (IL), the reach of AI has been limited. The plethora of knowledge available within the UK IL archives, tacit knowledge from immigration solicitors and case workers and all other sources of information remains underutilised in building AI based systems. This paper presents early results from the first ever Innovate UK funded project on the use of AI in IL. The scope of the project is to design a decision support system (DSS) using Knowledge Graph (KG) technology for serving clients and preparing cases for immigration case workers. This paper presents the first substantial KG, capturing the knowledge from IL experts and archives, and the design and development of an AI based conversational agent that utilises the KG.</p>
      </abstract>
      <kwd-group>
        <kwd>Knowledge Graph</kwd>
        <kwd>Conversational Agent</kwd>
        <kwd>Immigration</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        The UK visa immigration (UKVI) system is an intricate network of rules which is
accessed for information by immigration case workers and applicants while
making visa applications [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ]. This complexity of finding answers surnfig through
multiple IL archives can be a laborious job even for an expert. The applicants
in turn pursue experts’ advice for simple queries at costly rates. KG has not
been eficiently utilised in this domain [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. To address this challenge, A Y &amp;
J Solicitors3 and the University of Bradford4 have come together to work on
a Knowledge Transfer Partnership (KTP) project funded by Innovate UK, to
transform specialist knowledge and expertise into KGs to develop an intelligent
conversational agent (ICA). The UK immigration information is available in
a wide variety of sources like the UKVI website [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], UK IL archives [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], tacit
knowledge from immigration solicitors and case workers, communication scripts
between the experts and the clientele, and so on. With this project, we have
⋆ Supported by Innovate UK
3 https://ayjsolicitors.com/
4 https://www.bradford.ac.uk/external/
captured this knowledge into a KG and utilised it to build an AI system called
LILA (Legal Immigration Artificial IntelLigence Advice) which is available as a
conversational agent. With the advent of LILA, we provide the clients a platform
for initial customer interaction which would help the immigration experts in A
Y &amp; J with the increased influx of clients.
      </p>
      <p>This paper provides an account of the design and implementation of the
KG for ICA built with focus on the “Skilled Worker” (SW) visa category. It also
provides the early results of the ICA, which understands the queries, reasons and
traverses through the KG to provide consolidated and most appropriate answers,
which are conventionally scattered through multiple sources of IL information.
We tested our solution against a set of questions and achieved results with more
than 80% accuracy. The scope of the project extends to building LILA as a
DSS to help the immigration experts and case workers in the company with visa
application preparation and client’s information collection.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        The growing amount of enriching information in the world makes it exceedingly
essential for it to be more queryable to fetch relevant search results for the
users. The development and use of question answering (QA) systems is ongoing
for many years including domains’ specific ontology systems [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Few advances
have been made in QA systems in the legal domain [
        <xref ref-type="bibr" rid="ref7 ref8">7, 8</xref>
        ] and problem-based
reasoning [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. In law, however, the potential of AI extends to deeper dimensions
which are continually being explored. One such project was taken up by the
researchers in the Oxford University which aimed to explore and implement the
potential of AI in English Law domain [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Legal expert systems are a focus
of research since 1980s and there is a significant need to develop legal DSSs
to provide free legal services to the users [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. We follow the same ambition of
using AI to provide approachability to the non-lawyers with informed consent
[
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] using our domain-based KG. Our system is the first of its kind to be built
for the UK’s Immigration law domain.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Knowledge Graph Development for Intelligent</title>
    </sec>
    <sec id="sec-4">
      <title>Conversational Agent</title>
      <p>
        We have followed METHONTOLOGY methodology for developing the KG which
is a well-structured way to build ontologies from scratch [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. Initially, a
workshop was held with the immigration solicitors and case workers in A Y &amp; J
Solicitors, to understand the process and conditions of a SW visa. Proeteg´´ [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]
was used to build the KG model using the information retained from the
workshop. Figure 1 shows a structural example of one of the eligibility requirements
modelled in the graph for SW visa. The nodes or classes (circles) in the graph
have multiple data and object properties to widen the search criteria. The gfiure
shows the instances (diamonds) of the point-based system class as associated
with the Eligibility criteria for a SW visa.
      </p>
      <p>One of the challenges of answering legal queries is to provide appropriate
proofs to support the answers in the form of Law Acts and Clauses. Considering
this, a semi-automated approach was adopted to acquire knowledge into the
KG by developing a Python solution. It uses Beautiful Soup and Owlready2
packages to parse the IL archives and save the fetched information into the
instances of a KG “Clause” class respectively. These instances would point to
the relevant entities of the KG via the object property hasClause. In Figure
1, the Skill Level instance has two properties: hasDefinition that defines the
instance, and hasClause that connects it to the exact clause associated with
“Points for a job at the appropriate skill level(mandatory)” clause of
the UK IL archives. Hence, Skill Level instance becomes the data centre for all
the information specific to skill level of the ofered job. The information is saved
in the KG as shown in Figure 2.</p>
    </sec>
    <sec id="sec-5">
      <title>Development of Intelligent Conversational Agent</title>
      <p>
        Architecture To utilise the developed ontology in section 3 into an ICA, a Python
solution has been developed which connects the user interface with a text
processing toolkit called GATE [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. The GATE developer performs information
extraction from the queries’ corpus using its processing resources (PR) which
include tokenizer, named entity and parts of speech recognizer. The ontology is
loaded into GATE using its OntoGazetteer PR which maps the corpus to the
ontology classes to generate Lookup type annotations. A question can be asked
in multiple ways. For example, both the questions “My passport is expiring, is
this a problem?” and “Will I have any problem if my passport expires soon?”
have the same meaning. However, our solution classifies these questions into 2
diferent question templates (QT) according to the way they are constructed.
We use GATE’S JAPE grammars to classify queries into relevant QTs. JAPE
has a set of patterns/rules which may or may not contain regular expressions to
match the diferent QTs and log it into the annotations. All these annotations,
consisting of the ontology matched entities’ URIs, token types, QT and their
ofsets, are sent back to the solution as output. Python algorithms have been
developed to process each QT which uses the QT class output from GATE to
select the correct algorithm and annotations output to formulate a SPARQL
query against the selected algorithm. This is then used to fetch answers from
the KG which are further structured into a human readable format and sent to
the user interface as shown in figure 3.
Question Templates We collected a set of 239 frequently asked questions from
online resources to analyse their types and ways they are structured. We,
therefore, classiefid them into 6 QTs as shown below to be used as explained above.
In section 5, we will discuss the implementation of algorithm for QT1.
– Type QT1 – Stated Fact. Followed by a question?
– Type QT2 – How ?
– Type QT3 - Can/Will/Would ?
– Type QT4 - Do/Does/Should ?
– Type QT5 - What ?
– Type QT6 - Which/Who/When/Where/Why
?
5
      </p>
    </sec>
    <sec id="sec-6">
      <title>Implementation</title>
      <p>Following the system architecture in figure 3, we have developed a Python Flask
solution which provides a user interface as per figure 5. The solution
communicates with GATE using Python GateNLP package and extracts relevant entities
and relations. We have developed an algorithm for processing QT1 which uses
SPARQL to find a relationship between the fetched entities which can be classes
or instances, making a subgraph from the KG. Figure 4 gives the working
iterations of the algorithm with an example. The found relations are used to fetch
their definitions or isDefinedBy annotations from the KG to form an answer.</p>
      <p>
        The KG plays an essential role in generating annotations from the user input.
To facilitate better matching, Python NLTK WordNet has been used to extract
synonyms, hyponyms and hypernyms of the KG nodes’ names and added as
respective class annotations using Proeteg´.´ Another set of word dictionary has
also been created by measuring the average of WuPalmer – Wordnet similarity
[
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] between the class name and words immigration and law. This is to filter
out many irrelevant words to make the process more eficient. To examine their
utility in information extraction from KG, 6 diferent sets of word dictionaries
have been created as under.
      </p>
      <p>– Set 1 – With all synonyms, hyponyms and hypernyms
– Set 2 – With only synonyms and hyponyms
– Set 3 - With only synonyms
– Set 4 - With all synonyms, hyponyms and hypernyms with wup similarity
– Set 5 - With all synonyms and hyponyms with wup similarity
– Set 6 - With only synonyms with wup similarity
The presented system ofers answers to basic SW visa related queries which can
be straightforward or complex. This is the very first version of the ICA as part
of our project due for production deployment. The system performance is as
expected at this point and the integration of algorithms for rest of the QTs
are in progress. We are also aware of how the information in the IL archives
captured in the KG can change overtime. Hence, we are also working on making
the KG semi-dynamic where it detects any changes in the UK IL and can allow
the experts to insert them with sanity and consistency checks. The next step
is to improve the system upon feedback from the users and to upgrade it with
an ability to ask follow-up questions and collect information for visa application
preparation.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Wakisaka</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cardwell</surname>
            ,
            <given-names>P.J. Exploring</given-names>
          </string-name>
          <article-title>the trajectories of highly skilled migration law and policy in Japan and the UK</article-title>
          .
          <source>CMS 9</source>
          ,
          <issue>43</issue>
          (
          <year>2021</year>
          ). https://doi.org/10.1186/s40878-021-00251-3
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Manning</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Collinson</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <year>2019</year>
          .
          <article-title>Complexity in the Immigration Rules: politics or the outcome of Judicial Review?</article-title>
          .
          <source>Judicial Review</source>
          ,
          <volume>24</volume>
          (
          <issue>2</issue>
          ), pp.
          <fpage>85</fpage>
          -
          <lpage>92</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. Dong*,
          <string-name>
            <given-names>B.</given-names>
            ,
            <surname>Yu</surname>
          </string-name>
          ,
          <string-name>
            <surname>H.</surname>
          </string-name>
          <article-title>and</article-title>
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <year>2022</year>
          .
          <article-title>A Knowledge Graph Construction Approach for Legal Domain</article-title>
          . [online] Doaj.org. Available at: https://doaj.org/article/ 1171aa4f67054b39802e54b8d18d5a90
          <source>[Accessed 8 April</source>
          <year>2022</year>
          ].
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4. Gov.uk.
          <year>2022</year>
          .
          <article-title>Welcome to GOV</article-title>
          .UK. [online] Available at: https://www.gov.
          <source>uk/ [Accessed 8 April</source>
          <year>2022</year>
          ].
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. GOV.UK.
          <year>2022</year>
          . Archive: Immigration Rules. [online] Available at: https:// www.gov.uk/government/collections/archive-immigration-rules
          <source>[Accessed 4 March</source>
          <year>2022</year>
          ].
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Bouziane</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bouchiha</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Doumi</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Malki</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <year>2015</year>
          .
          <source>Question Answering Systems: Survey and Trends. Procedia Computer Science</source>
          ,
          <volume>73</volume>
          , pp.
          <fpage>366</fpage>
          -
          <lpage>375</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Bach</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cham</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Thien</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Phuong</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <year>2017</year>
          .
          <article-title>Question Analysis for Vietnamese Legal Question Answering</article-title>
          .
          <source>In: 2017 9th International Conference on Knowledge and Systems</source>
          Engineering(KSE)
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>McElvain</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sanchez</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Matthews</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Teo</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pompili</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Custis</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <year>2017</year>
          . WestSearch Plus:
          <article-title>A Non-factoid Question-Answering System for the Legal Domain</article-title>
          .
          <source>In: 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval. [online] SIGIR'19 Association for Computing Machinery</source>
          , pp.
          <fpage>1361</fpage>
          -
          <lpage>1364</lpage>
          . Available at: https://doi.org/10.1145/3331184.3331397 [Accessed 8
          <string-name>
            <surname>April</surname>
          </string-name>
          <year>2022</year>
          ].
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Junior</surname>
            , A.,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Orlandi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Graux</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hossari</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>O</given-names>
            <surname>'Sullivan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Hartz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            , and
            <surname>Dirschl</surname>
          </string-name>
          ,
          <string-name>
            <surname>C.</surname>
          </string-name>
          <year>2020</year>
          .
          <article-title>Knowledge Graph-Based Legal Search over German Court Cases</article-title>
          . In The Semantic Web:
          <article-title>ESWC 2020 Satellite Events: ESWC 2020 Satellite Events</article-title>
          , Heraklion, Crete, Greece, May 31 - June 4,
          <year>2020</year>
          , Revised Selected Papers. SpringerVerlag, Berlin, Heidelberg,
          <fpage>293</fpage>
          -
          <lpage>297</lpage>
          . DOI: https://doi.org/10.1007/978-3-
          <fpage>030</fpage>
          -62327- 2 44
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10. Oxford Law Faculty.
          <year>2022</year>
          .
          <article-title>Unlocking the Potential of Artificial Intelligence for English Law</article-title>
          . [online] Available at: https://www.law.
          <source>ox.ac.uk/ unlocking-potential-artificial-intelligence-english-law [Accessed 8 April</source>
          <year>2022</year>
          ].
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Greenleaf</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mowbray</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Chung</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <year>2017</year>
          .
          <article-title>Building Sustainable Free Legal Advisory Systems: Experiences from the History of AI ; Law</article-title>
          . SSRN Electronic Journal,.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Kurteva</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          (
          <year>2021</year>
          ).
          <article-title>Implementing Informed Consent with Knowledge Graphs</article-title>
          . In: , et al.
          <article-title>The Semantic Web: ESWC 2021 Satellite Events</article-title>
          .
          <source>ESWC 2021. Lecture Notes in Computer Science()</source>
          , vol
          <volume>12739</volume>
          . Springer, Cham. https://doi.org/10.1007/978-3-
          <fpage>030</fpage>
          -80418-3 28
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13. Lo´pez,
          <string-name>
            <surname>M.F.</surname>
          </string-name>
          ,
          <article-title>Gom´ez-Per´ez,</article-title>
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Sierra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.P.</given-names>
            , &amp;
            <surname>Sierra</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.P.</surname>
          </string-name>
          (
          <year>1999</year>
          ).
          <article-title>Building a chemical ontology using methontology and the ontology design environment</article-title>
          .
          <source>Ontologies</source>
          ,
          <volume>14</volume>
          ,
          <fpage>37</fpage>
          -
          <lpage>46</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Research</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <year>2022</year>
          . proeteg´.´ [online] Protege.stanford.edu. Available at: https: //protege.stanford.
          <source>edu/ [Accessed 8 April</source>
          <year>2022</year>
          ].
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Gate</surname>
          </string-name>
          .ac.uk.
          <year>2022</year>
          . GATE.ac.uk - index.html. [online] Available at: https://gate. ac.
          <source>uk/ [Accessed 8 April</source>
          <year>2022</year>
          ].
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Wu</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Palmer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <year>1994</year>
          .
          <article-title>Proceedings of the 32nd Annual Meeting on Association for Computational Linguistics</article-title>
          . Las Cruces, New Mexico:
          <article-title>Association for Computational Linguistics</article-title>
          , pp.
          <fpage>133</fpage>
          -
          <lpage>138</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>