Skip to content

Adding support for new algorithms

dema121 edited this page Mar 18, 2020 · 1 revision

Adding support for new algorithms/models

To add support of new models and algorithms it is possible to create a new QA-Integrator-Model in the system. To do this, you can go to the qa_integrator/models/ directory and start from the python module called model_base_placeholder. This is a module that outlines the structure of the code and the functions it must offer so that it can communicate with the QA-Integrator following a unified format. Here are the functions that must be present in the new module, described in detail in the placeholder:

  • test_function()
  • do_prediction(documents, questions_formatted, prediction_dir)
  • get_prediction(prediction_dir)
  • do_training(documents_questions, training_dir)
  • is_training_completed(training_dir)
  • training_completed_at(training_dir)

Once the code of a new QA-Integrator-Model has been implemented, its existence must be indicated to the QA-Engine through the configuration file config.json. Add to the list under the field models_available an object with these fields:

  • from: name of the general python module which makes accessible the various QA-Integrator-Model. Normally qa_integrator.models
  • name: name of the python module just created in the from module which implements the QA-Integrator-Model.
  • api_name: name to be used outside the API to use the corresponding QA-Model.

Clone this wiki locally