Hochschulassistent Mario

Hochschulassistent Mario
Photo by Yuyeung Lau / Unsplash

This project was developed as part of the Deep Learning course at Kaiserslautern University of Applied Sciences in the summer semester of 2021. The project is a chatbot that primarily answers questions about Kaiserslautern University of Applied Sciences. The primary target groups are people interested in studying and current students. For example, questions about entry criteria, study courses or contact details of professors can be asked and be answered by the bot.

The chatbot is a multi-container docker application created with Docker Compose. The application is based on three containers. The frontend container is based on Node.js. Using a React App as a basis, the user interface of the chatbot was developed with the react-chatbot-kit in the frontend container. The backend container is based on Python. The web framework Flask is used to receive http requests from the frontend with the respective input texts.

The input text is then sent to wit.ai which extracts intents and entities from the input text and delivers them back to the backend. Wit.ai is an open and extensible Natural Language Processing engine for developers. It can be used to train example utterances that are assigned to certain intents and in which entities are defined that serve as variables. Optionally, traits can also be used to recognize emotions, for example. Input data that were incorrectly assigned to an intent or for which incorrect entities were recognised can be correctly assigned afterwards on wit.ai and then a training for the underlying model can be initiated to improve the classification. With the help of this information, an action can be triggered depending on the intent and the respective entities. So the intents provide a rough context, and the entities specify the context in more detail. This information is sent back to the backend with a confidence level.

On the basis of this information a json response is generated depending on the intent and the entities and sent back to the frontend. Depending on the intent, the backend retrieves data from a MongoDB database that has been loaded with information in advance. The MongoDB is running in the third docker container of the application. The database contains data that would take time to load live. This increases the performance of the chatbot. The data is extracted from websites of Kaiserslautern University of Applied Sciences using the Python library Beautiful Soup. The frontend container generates the response that is displayed in the chatbot based on the incoming json response from the backend. Input data that has nothing to do with Kaiserslautern University of Applied Sciences is sent to the Google Assistant with the help of the Google Assistant SDK. The assistant then generates answers to general questions that cannot normally be answered by the chatbot. If the answer contains a picture in addition to a text answer, this will also be displayed in the chatbot.

The chatbot could be further developed in a number of areas. Entities that have previously been recognised could be saved in order to maintain the context over several questions. In this way, questions could be answered without having to provide all the necessary information in a single question. In addition, the depth of the data could be extended. For example, in the next step, the module descriptions could be loaded to get information about learning objectives or similar information about the modules of the degree programmes.