A pattern-based intelligent agent that responds to university course and student-related questions, using an RDF graph database and natrual language processing (NLP).
Unibot is developed in Python using a number of libraries including rdflib, pandas, spaCy, and tika to process and represent information as an interconnected knowledge base (graph). It utilizes various other tools like Apache Jena Fuseki to offer a SPARQL server and Rasa chatbot framework to offer a natural language interface that can be used to query the knowledge graph through natural language.
Unibot contains a set of scripts that given the data can automatically construct a knowledge graph to represent information about:
- Universities:
- Name of the university
- Link to the university's entry in DBpedia and/or Wikidata
- Courses:
- Course name
- Course subject
- Course number
- Course credits
- Course description
- A link to a web page with the course information if available
- Course outline, if available
- Lectures in a course:
- Lecture number
- Lecture name
- Lecture content, such as:
- Slides
- Worksheets
- Readings (book chapters, web pages, etc)
- Other materials (videos, images, etc)
- A link to a web page with the lecture information, if available
- Topics covered in a course
- Students
- Name (first, last)
- ID number
- Completed courses with their grades
- Competencies, defined as a set of topics, based on the courses a student successfully passed
Unibot's knowledge graph re-uses existing vocabularies including FOAF and VIVO where appropriate and uses FOCU, its own vocabulary.
The diagram below illustrates the design of the graph. You can get a closer and more detailed look at the graph through its schema.
After cloning the repository, install the dependencies outlined in the requirements.txt file. For convenience, you can use Python's venv
package to install dependencies in a virtual environment. You can find the instructions on creating and activating a virtual environment in the official documentation. After setting up and activating your environment, you can install the dependencies by running the following command in your terminal:
$ pip install -r requirements.txt
Now the instructions below in order:
- Convert pdf files to text files by running the following command in your terminal:
python -m /Data/Topics/txt_generator.py
- Construct the knowledge base by running the following command in your terminal:
python -m main.py
-
Populate the fuseki database by creating a project named
Project1
and upload database.nt. -
Lastly, run the fuseki server in the background, move to the
rasa
directory by running the following command in your terminal:
cd rasa
Launch unibot by running the following command in your terminal:
rasa run actions && rasa shell
You can now talk to unibot, try one of the questions below:
- Which topics is Trenae Bryan competent in?
- Which students have retaken the same course at least 2 times?
- How many students are enrolled in each course that is offered by Concordia University?
Unibot is licensed under the terms of MIT License