<!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>
      <issn pub-type="ppub">1613-0073</issn>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Towards Improving a Student Advisory Service Chatbot Using Knowledge Graphs</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Daniel Delev</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Emmie Schifer</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Felix Vogl</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andreea Iana</string-name>
          <email>andreea.iana@uni-mannheim.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Heiko Paulheim</string-name>
          <email>heiko.paulheim@uni-mannheim.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Workshop</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Chatbot, Retrieval Augmented Generation (RAG)</institution>
          ,
          <addr-line>Large Language Model, ChatGPT, Knowledge Graph, Dialogue</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Mannheim, Data And Web Science Group</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Student advisory services at universities face a high volume of repetitive inquiries, which can be time-consuming and labor-intensive to address. In this paper, we explore the potential of chatbots to provide personalized support by leveraging university web pages and study regulation documents. Our prototype demonstrates the feasibility of chatbots in identifying relevant information and answering student queries. However, we also identify limitations in handling nuanced cases, particularly cohort-specific regulations. To address these challenges, we propose the integration of knowledge graphs as a potential extension to enhance the dialogue capabilities of the chatbot.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>https://www.heikopaulheim.com/ (H. Paulheim)
CEUR</p>
      <p>ceur-ws.org
1
Crawling</p>
      <p>and
Scraping</p>
      <p>Text</p>
      <p>Chunks</p>
      <sec id="sec-1-1">
        <title>4a RCehtruienvkal</title>
        <p>3
User Interaction
Question</p>
        <p>Embedding</p>
        <p>User
Question</p>
        <p>User</p>
        <p>Context
Chatbot</p>
      </sec>
      <sec id="sec-1-2">
        <title>FCiltheurninkg 4b</title>
        <p>Answer
Generation
5
User
Answer</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2. Prototype</title>
      <p>The prototype introduced in this paper consists of two preprocessing steps: (1) web scraping, and (2)
text chunking and augmentation. At the user interaction stage, the chatbot executes a fixed protocol,
(3) collecting initial personal information on the candidate, (4a) retrieving and (4b) filtering relevant
document chunks, and (5) generating an answer from those chunks. Figure 1 shows the overall process.</p>
      <p>The prototype has been developed and tested for study programs of the School of Business Informatics
at the University of Mannheim, but can be applied to other study programs as well.</p>
      <sec id="sec-2-1">
        <title>2.1. Data Preparation</title>
        <p>To collect relevant data, we run a web scraper starting from the School of Business Informatics Web page,
and following links to Web pages and PDF files (which are the common format to provide documents
such study regulations) up to a depth of 3. The final dataset consists of of 668 HTML files (43 MB) and
983 PDF files (1,234 GB).</p>
        <p>Not all of the documents are relevant for answering questions in the context of academic advisory
(for example, by crawling PDFs from the faculty Web page, academic papers and CVs are also caught,
among others). However, manual filtering is infeasible, so we rely on later processing steps and/or
automatic filtering to identify the relevant documents for a question at hand.</p>
        <p>In order to use texts in a RAG setting, they need to be injected in the prompts (see below). Since there
are token limits for prompts (4,096 tokens for ChatGPT-3.5 Turbo, which was used for this project),
most of the texts are too large to be used directly. Therefore, they are divided into smaller chunks (using
a chunk size of 1,000 characters, with an overlap of 200 characters) before further processing.</p>
        <p>Furthermore, each text chunk is augmented with metadata. The prototype uses two metadata fields,
i.e., the study program (one of the study programs taught at the School of Business Informatics, or
“general”), and a short summary. Both are generated by feeding the corresponding chunk into ChatGPT
and making it determine the study program and a summary in a zero-shot setting. An evaluation on a
small sample showed that the metadata are correct in 65% of the cases.</p>
        <p>For all text chunks, embedding vectors are created using LlamaIndex1. Those are stored in a vector
index so that they can be used for passage retrieval.</p>
        <p>Note that while the data collection and preparation has been done once for this proof-of-concept
prototype, in a productive deployment, it would be re-run periodically in order to always deliver up to
date responses.</p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. User Interactions</title>
        <p>As shown in Fig 1, ChatGPT is not used directly, but invoked by the chatbot that interfaces with the
user. When collecting the question, it asks for context like the study program the user is enrolled in. In
parallel, the user’s question is embedded using the same method as for the text chunks, and the text
chunks with the closest vectors are retrieved and filtered by the metadata according to the context
provided by the user.</p>
        <p>The final prompt used to provide an answer to the user which is passed to ChatGPT looks as follows:
Use t h e f o l l o w i n g p i e c e s o f c o n t e x t t o a n s w e r t h e
q u e s t i o n a t t h e end .</p>
        <p>E x e c u t e t h e s e s t e p s :
1 − a l w a y s a n s w e r i n t h e l a n g u a g e t h e q u e s t i o n was g i v e n
i n
2 − r e a d t h e c o n t e x t , do n o t u s e i n f o r m a t i o n o u t s i d e o f
t h e c o n t e x t t o a n s w e r t h e q u e s t i o n
3 − i f t h e a n s w e r i s n o t p r o v i d e d i n t h e g i v e n c o n t e x t ,
s a y where more i n f o r m a t i o n c a n p o s s i b l y be f o u n d
4 − a n s w e r t h e q u e s t i o n
−−−−−−−−−−−−−−−−−−−−−−−−
C o n t e x t : { c o n t e x t }
Q u e s t i o n : I am s t u d y i n g t h e { s t u d y _ p r o g r a m } . { q u e s t i o n }
where study_program and context are the study program asked for in the previous dialogue, and the
text chunks retrieved, respectively, and question is the question provided by the user.</p>
      </sec>
      <sec id="sec-2-3">
        <title>2.3. Evaluation</title>
        <p>We have evaluated the proposed approach using a set of 23 questions, both in English and German.
Each question was tested with two diferent study programs as a context, leading to an overall set of
46 questions and gold standard answers. The answers given by the chatbot were manually evaluated
against the gold standard. The final prototype yields an overall rate of correct answers of 83%.</p>
        <p>CS214</p>
        <p>relatedTo
hasPrerequisite
chunk34723</p>
        <p>CS101
doc54783
relatedTo</p>
        <p>MSc Data</p>
        <p>Science
extractedFrom
extractedFrom
chunk43987
contradicts
relatedTo
chunk51378
extractedFrom
doc79832
relatedTo</p>
        <p>Msc Comp.</p>
        <p>Science</p>
        <p>
          In a preliminary study, we also evaluated PaperQA [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] as an out of the box end-to-end solution, but
achieved less than 50% correct answers. Therefore, the approach was discarded.
        </p>
        <p>We also evaluated the document chunk retrieval step in isolation for each of the test questions,
considering the precision@5 (i.e., the rate of relevant documents among the top 5 retrieved document
chunks). The approach achieves a total rate of 87%, i.e., on average, 4.4 out of the top 5 document chunks
are relevant for answering the question at hand. Interestingly, without considering the metadata, the
rate drops to 63% (i.e., 3.1 out of the top 5 document chunks).
3. Potential of Using a Knowledge Graph
As discussed above, the dialogue currently follows a fixed script. This also means that the same context
information is always collected, regardless of whether that information is required or not. However,
some questions require no context information (When do the lectures start in the fall semester? ), others
may require the study program (How many credits do I need to collect in the fundamentals module? ),
others may even require other information on the student’s individual track record (Can I attend the
advanced course on software engineering? , e.g., if this course has specific requirements).</p>
        <p>
          Organizing the collected text information in a knowledge graph, as shown in Fig. 2, can help
identifying those required pieces of context information in an interative process of retrieving document
chunks and narrowing down the set of relevant chunks in an interactive dialogue with the user. The
information in the knowledge graph may include the metadata discussed above, but also further
information on the curriculum [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ], like information extracted from a module catalogue (e.g., course
prerequisites, as shown in the left part of the figure).
        </p>
        <p>
          Although the rate of relevant document chunks retrieved is rather good, as discussed above, we often
observe the retrieval of contradicting chunks, which then leads to wrong or unspecific answers. This
may be the case, e.g., for chunks extracted from documents concerning diferent study programs, in
which diferent regulations are in place. Detecting such contradictions by means of automatic stance
detection [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] and explicitly modeling them in the knowledge graph, as shown in the figure, is a good
way to both identify those cases, as well as making the chatbot ask specific questions to narrow down
the set of retrieved chunks. In the example shown in the figure, retrieving the two contradicting chunks
chunk43987 and chunk51378, the knowledge graph could be traversed to find out that both refer to
diferent study programs, to make the chatbot ask for the user’s study program, and ultimately discard
non-fitting document chunks before passing them to the answer generation.
        </p>
        <p>
          Finally, if the knowledge graph becomes deeper and more connected, encompassing more metadata
and interlinks inbetween the text chunks, which are represented as nodes in the graph, knowledge
graph embeddings [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ] can be used to improve the retrieval process.
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>4. Conclusion</title>
      <p>In this paper, we have introduced a first prototype for a student advisory chatbot. The chatbot is based
on a document collection harvested from the Web, which is preprocessed and enriched using an LLM.
The text chunks are then used in the information retrieval block in a retrieval augmented generation
(RAG) based chatbot implemented with LangChain and ChatGPT.</p>
      <p>In the future, it would be interesting to test the approach in a broader setting, covering more study
programs and/or schools. While the approach itself is considered scalable, this will also pose challenges
with respect to identifying relevant information if the amount of processed contents is larger.</p>
      <p>Moreover, we have discussed how a knowledge graph can help improving the behavior and output of
the chatbot. Especially for identifying which context information is required from the user, a knowledge
graph may be beneficial and help extending the system from a chatbot following a static script to an
interactive bot asking directed questions based on information modeled in the knowledge graph. This
will be even more crucial if the approach is used on a broader scale, as discussed above.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>M.</given-names>
            <surname>Goemans</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Kapinos</surname>
          </string-name>
          ,
          <article-title>A quantitative study of community college student-advisor appointments and student success metrics</article-title>
          ,
          <source>NACADA Journal 44</source>
          (
          <year>2024</year>
          )
          <fpage>38</fpage>
          -
          <lpage>54</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>T.</given-names>
            <surname>Wu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>He</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Sun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Liu</surname>
          </string-name>
          , Q.-L. Han,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Tang</surname>
          </string-name>
          ,
          <article-title>A brief overview of chatgpt: The history, status quo and potential future development</article-title>
          ,
          <source>IEEE/CAA Journal of Automatica Sinica</source>
          <volume>10</volume>
          (
          <year>2023</year>
          )
          <fpage>1122</fpage>
          -
          <lpage>1136</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>O.</given-names>
            <surname>Topsakal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T. C.</given-names>
            <surname>Akinci</surname>
          </string-name>
          ,
          <article-title>Creating large language model applications utilizing langchain: A primer on developing llm apps fast</article-title>
          ,
          <source>in: International Conference on Applied Engineering and Natural Sciences</source>
          , volume
          <volume>1</volume>
          ,
          <year>2023</year>
          , pp.
          <fpage>1050</fpage>
          -
          <lpage>1056</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>V.</given-names>
            <surname>Rawte</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Sheth</surname>
          </string-name>
          ,
          <string-name>
            <surname>A. Das</surname>
          </string-name>
          ,
          <article-title>A survey of hallucination in large foundation models</article-title>
          ,
          <source>arXiv preprint arXiv:2309.05922</source>
          (
          <year>2023</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>P.</given-names>
            <surname>Lewis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Perez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Piktus</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Petroni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Karpukhin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Goyal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Küttler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Lewis</surname>
          </string-name>
          , W.-t. Yih,
          <string-name>
            <given-names>T.</given-names>
            <surname>Rocktäschel</surname>
          </string-name>
          , et al.,
          <article-title>Retrieval-augmented generation for knowledge-intensive nlp tasks</article-title>
          ,
          <source>Advances in Neural Information Processing Systems</source>
          <volume>33</volume>
          (
          <year>2020</year>
          )
          <fpage>9459</fpage>
          -
          <lpage>9474</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J.</given-names>
            <surname>Lála</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O. O</given-names>
            <surname>'Donoghue</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Shtedritski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Cox</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. G.</given-names>
            <surname>Rodriques</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. D.</given-names>
            <surname>White</surname>
          </string-name>
          ,
          <article-title>Paperqa: Retrievalaugmented generative agent for scientific research</article-title>
          ,
          <source>arXiv preprint arXiv:2312.07559</source>
          (
          <year>2023</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>M.</given-names>
            <surname>Zouri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ferworn</surname>
          </string-name>
          ,
          <article-title>An ontology-based approach for curriculum mapping in higher education</article-title>
          ,
          <source>in: 2021 IEEE 11th Annual Computing and communication workshop and conference (CCWC)</source>
          , IEEE,
          <year>2021</year>
          , pp.
          <fpage>0141</fpage>
          -
          <lpage>0147</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>D.</given-names>
            <surname>Küçük</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Can</surname>
          </string-name>
          ,
          <article-title>Stance detection: A survey, ACM Computing Surveys (CSUR) 53 (</article-title>
          <year>2020</year>
          )
          <fpage>1</fpage>
          -
          <lpage>37</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>H.</given-names>
            <surname>Paulheim</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Ristoski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Portisch</surname>
          </string-name>
          ,
          <source>Embedding Knowledge Graphs with RDF2vec</source>
          , Springer Nature,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>