Skip to content

A matrix chatbot with integrated natural language processing, which functions as a digital learning assistant.

License

Notifications You must be signed in to change notification settings

jquku/Matrix-Chatbot

Repository files navigation

Matrix-Chatbot

Table of contents

This natural language processing matrix-chatbot is designed for the messenger Element (previously named Riot.im) and is based on the matrix-nio client libary. The chatbot can be used as a digital learning assistant for students and answers lecture related questions with references to slides. The chatbot communicates in english and german. Knowledge extension is achieved by simply adding new rules in predetermined files that serve as a data basis for the chatbot. The application also offers a statistical overview of frequently asked topics, which can be queried directly via the chatbot.

Prerequisites

  • python version 3.5+
  • pip3
  • docker.io
  • docker-compose

Configuration

Setup

  1. Clone this repository and navigate into the repoistory folder
  2. Install all the requirements
    pip3 install -r requirements.txt
  3. Add all the nltk data
    python3 -m nltk.downloader all
  4. Start the docker container
    docker-compose up -d
  5. Navgiate into folder models and create all the tables
    python3 database.py
  6. Add data basis by entering the folder modules and call the following scripts
    python3 index_evaluation.py
    python3 organisation_evaluation.py
    python3 small_talk_evaluation.py
  7. Start the chatbot
    python3 main.py
    

After starting the chatbot any user may be able to communicate with the bot. In the Element messenger, the chatbot can be added to a room via matrix ID.

E2EE support

The support is still a work in progress for the project. Messages sent to an encrypted room cannot be handled yet. For future development, this is how matrix-nio with E2EE support can be downloaded on Ubuntu.

  1. Install the latest version of python-olm For e2e support, installing the libolm C libary is recommended
    git clone https://gitlab.matrix.org/matrix-org/olm.git
    sudo make
    sudo make install
    sudo ldcfongig
  2. Install matrix-nio, if you want e2e support call
    pip3 install "matrix-nio[e2e]"
    

Architecture

The software architecture is modular and consists of seven modules. Modular software architecture

Database schema

Chabot data is being anonymized and stored in 7 tables in a relational PostgreSQL database. The database is accessible via docker container. Database scheme

Sequence diagram

This sequence diagram describes how an incoming text message is processed by the chatbot to generate a response fitting the user's message. Sequence Diagram

NLP strategy

Test messages are processed with an nlp component. The processing is necessary to standardize the messages which allows the chatbot to later find fitting entries (rules) from the data basis. NLP strategy

License

MIT licensed

Copyright (C) 2020 Jonathan Quade

About

A matrix chatbot with integrated natural language processing, which functions as a digital learning assistant.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages