Introducing a Chatbot to the Web Portal of a Higher Education Institution to Enhance Student Interaction †
Abstract
:1. Introduction
2. Methods
- Define the purpose and objectives: this will help guide development and ensure the chatbot is useful.
- Choose a platform or framework: there are several options available to develop chatbots with LLMs, namely the following:
- -
- Dialogflow (Google): a platform from Google that uses Google Cloud NLP;
- -
- Microsoft Bot Framework: a Microsoft platform for creating chatbots;
- -
- Rasa: an open source framework for chatbot development with LLMs;
- -
- IBM Watson Assistant: an IBM solution for creating chatbots.
- Training and data: for the chatbot to properly understand and respond to user queries, it has to be trained with relevant data.
- Channel integration: it can be on a website, mobile app, social media, etc. It is important to integrate the chatbot with relevant channels.
- Development and configuration: Use the chosen platform or framework to develop the chatbot. Configure the conversation flow, responses, and actions.
- Test and tune: Test the chatbot exhaustively to identify issues and adjust its responses and behavior. Make sure it understands questions and responds appropriately.
- Deployment: after testing, the chatbot must be deployed.
- Continuous improvements: an LLM chatbot can be improved over time as more data and feedback from users are collected.
- Support and maintenance: the chatbot must be continuously updated and provide ongoing support to deal with user issues and queries.
2.1. Concepts
- What is Streamlit?
- What is a Chatbot?
2.2. Environment Configuration
- streamlit -> a library to create interactive web applications for projects that use machine learning and data science;
- streamlit_chat -> this component is used to create user interfaces;
- langchain -> A framework used to develop applications that use language models. This provides a regular interface to use chains, integration’s with different tools, and end-to-end chains for regular applications;
- sentence_transformers -> A library to allow the use of transformer models (BERT, RoBERTa, and others) and generate text semantic representations (embeddings) used for document indexation;
- openai -> OpenAI’s library, which allows one to use its language model, (GPT-3.5-turbo), and generate human-like text;
- unstructured and unstructured[local-inference] -> libraries used for document processing and unstructured data management;
- pinecone-client -> A client for Pinecone, a service vector database which allows one to perform similarity searches of vector data.
Listing 1. Streamlit libraries installation. |
pip install -r streamlit_requir.txt |
3. Results and Discussion
- Document Indexing
- Loading documents from a directory with LangChain
Listing 2. Loading documents. |
from langchain.document_loaders import DirectoryLoader directory_to_load = ’/content_info/data’ def load_documents(directory_to_load): loader = DirectoryLoader(directory_to_load) loaded_docs = loader.load() return loaded_docs loaded_docs = load_documents(directory_to_load) len(loaded_docs) |
- Document splitting
Listing 3. Document splitting. |
from langchain.text_splitter import RecursiveCharacterTextSplitter def split_documents(docs, size_chunk=500, overlap_chunk=20): splitter_text = RecursiveCharacterTextSplitter(size_chunk=size_chunk, overlap_chunk=overlap_chunk) documents = splitter_text.split_documents(docs) return documents documents = split_documents(docs) print(len(documents)) |
- Embedding creation
Listing 4. Embedding creation. |
from langchain.embeddings import SentenceTransformerEmbeddings embeddings_txt = SentenceTransformerEmbeddings(mdel_name=“all-MiniLM-L6-v2”) |
- Storing embeddings using Pinecone
Listing 5. Storing embeddings using Pinecone. |
from langchain.pinecone import PineconeIndexer def index_embeddings(embeddings, documents): indexer = PineconeIndexer(api_key=‘your-api-key-from-pinecone’, index_name=‘your-index-name’) indexer.index(embeddings, documents) index_embeddings(embeddings, documents) |
- Creating the chatbot Interface with Streamlit
- Streamlit Chat Component
Listing 6. Install streamlit-chat component. |
pip install streamlit-chat |
Listing 7. Streamlit import. |
import streamlit as stlit from streamlit_chat import chat @st.cache(allow_output_mutation=True) def get_chat(): return chat() chat = get_chat() |
Listing 8. Chat interface creation. |
chat.add_message(“Hi, how can i help you today?”, “bot”) |
- Integrating Chatbot with LangChain
Listing 9. Chatbot integration. |
from langchain import LangChain def load_chain_openai(): chain_openai = LangChain(api_key=’your-api-key-from-openai’) return chain_openai chain_openai = load_chain_openai() |
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Sjöström, J.; Dahlin, M. Tutorbot: A chatbot for higher education practice. In Proceedings of the Designing for Digital Transformation. Co-Creating Services with Citizens and Industry: 15th International Conference on Design Science Research in Information Systems and Technology, DESRIST 2020, Kristiansand, Norway, 2–4 December 2020; Proceedings 15. Springer: Berlin/Heidelberg, Germany, 2020; pp. 93–98. [Google Scholar]
- Hien, H.T.; Cuong, P.N.; Nam, L.N.H.; Nhung, H.L.T.K.; Thang, L.D. Intelligent assistants in higher-education environments: The FIT-EBot, a chatbot for administrative and learning support. In Proceedings of the 9th International Symposium on Information and Communication Technology, Danang City, Vietnam, 6–7 December 2018; pp. 69–76. [Google Scholar]
- Sandoval, Z.V. Design and implementation of a chatbot in online higher education settings. Issues Inf. Syst. 2018, 19, 44–52. [Google Scholar]
- Taecharungroj, V. “What Can ChatGPT Do?” Analyzing Early Reactions to the Innovative AI Chatbot on Twitter. Big Data Cogn. Comput. 2023, 7, 35. [Google Scholar] [CrossRef]
- Lappalainen, Y.; Narayanan, N. Aisha: A Custom AI Library Chatbot Using the ChatGPT API. J. Web Librariansh. 2023, 17, 37–58. [Google Scholar] [CrossRef]
- Fan, L.; Lafia, S.; Li, L.; Yang, F.; Hemphill, L. DataChat: Prototyping a Conversational Agent for Dataset Search and Visualization. arXiv 2023, arXiv:2305.18358. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Oliveira, P.F.; Matos, P. Introducing a Chatbot to the Web Portal of a Higher Education Institution to Enhance Student Interaction. Eng. Proc. 2023, 56, 128. https://doi.org/10.3390/ASEC2023-16621
Oliveira PF, Matos P. Introducing a Chatbot to the Web Portal of a Higher Education Institution to Enhance Student Interaction. Engineering Proceedings. 2023; 56(1):128. https://doi.org/10.3390/ASEC2023-16621
Chicago/Turabian StyleOliveira, Pedro Filipe, and Paulo Matos. 2023. "Introducing a Chatbot to the Web Portal of a Higher Education Institution to Enhance Student Interaction" Engineering Proceedings 56, no. 1: 128. https://doi.org/10.3390/ASEC2023-16621