Skip to content

Project structure

Andrea Demattè edited this page Mar 2, 2020 · 2 revisions

Project structure tree

qa-engine
├── actual_models
│   ├── bert-model
│   ├── bert-qa
│   └── squad_dir
├── config_util
├── qa_integrator
│   ├── models
│   │   └── qa_bert
│   │   └── model_base_placeholder
│   └── qa_models_integrator.py
├── app.py
├── config.example.json
├── delete_unused_predictions_cron.py
├── delete_unused_predictions_cron_stop.py
├── prepare_environment.sh
├── service_start.sh
├── service_stop.sh
├── service_update.sh
└── requirements_python2.txt
└── requirements_python3.txt

Project structure explanation

Above will be analyzed each significant folder and significant file.

actual_models/

In this folder there are the effective QA-models, with their structure. These files are used by the qa-engine to launch predictions

config_util/

This folder contains the parser of the real configuration file "config.json"

qa_integrator/qa_models_integrator.py

This module is responsible to load and call the exposed functions of the QA-engine-models

qa_integrator/models/

This folder contains QA-engine-models integration modules that talk with the QA-engine. Each folder located in this directory is a QA model that the QA-engine could support and makes available. This is the folder where to start writing a new model integration.

app.py

This is the entry point for the QA-engine. This is what it does:

  • Checks the environment resources ("actual_models" folder) and downloads missing one.
  • Exposes the http API service
  • Sets a system cronjob to delete unused predictions

config.example.json

An example of configuration params of the project. Copy the file with customized params in a file called "config.json" in the root of the project.

delete_unused_predictions_cron.py

Script called by the system cronjob that deletes predictions older than a time.

delete_unused_predictions_cron_stop.py

Script called by the user, if it wants to remove the system cronjob.

prepare_environment.sh

Script that downloads the needed resources for the QA-models.

service_start.sh

Script that starts the QA-engine in background.

service_stop.sh

Script that stops the QA-engine in background.

service_update.sh

Script that updates the code from the repo.

requirements_python2.txt

Pip requirements for python 2 stuff

requirements_python3.txt

Pip requirements for python 3 stuff