AI integrations: Prozorro_AI library

date 20-05-2019

Overview

OCDS Analytics includes a plugin that is designed to provide predictions based on AI and machine learning modules. Basically, this subsystem “predicts” a field value with high probability based on the other fields’ inputs.

For more information on Predictions see:

We decided to go even further and develop a prediction library that can be easily integrated into any e-procurement platform. The first AI integration was developed for the Ukrainian e-procurement system ProZorro - Prozorro_AI. It is a light and easy in use JavaScript library designed to provide suggestions based on OCDS Analytics’ Predictions.

Installing Prozorro_AI

You can choose the most suitable installation option.

If you want to include the latest script directly from cdn:

<script src="https://cdn.jsdelivr.net/npm/prozorro_ai@1.1.0/prozorro_ai.min.js"></script>

If you want to use Node:

npm install prozorro_ai

If you want to include the library locally, then download the latest distribution (see releases), make sure to serve it from your web server, and include it in the client from a script tag.

You will also have to import the script in order to use Prozorro_AI (except the case when you use cdn since it declares the module automatically):

  • for webpack: import Prozorro_AI from "prozorro_ai"
  • for requirejs: const Prozorro_AI = require('prozorro_ai')

Note that all OCDS Analytics services require authentication via an API key. Currently, it is free. All you have to do is register on the https://ocdsanalytics.com website and get the API key on your Account page. Insert it as follows:

Prozorro_AI.client({apiKey: '9efb4e84cb73aeb41d6347de377264e825ed36b3'}).units.suggest({
...
})

Suggesting Item Classification

The Prozorro_AI suggestion will work if at least one of these fields is filled in:

Property Description Type Default
tenderTitle A name of the tender string ' '
tenderDescription A description of the tender string ' '
itemDescription A description of the goods, services to be provided string ' '
itemUnit Name of the unit based on the UN/CEFACT Recommendation 20 unit code. string ' '

The probability threshold and the number of results to be displayed can be configured.

Property Description Type Default
accuracyCutoff Probability threshold string/number 0.1
limit Number of results to be displayed string/number 5

Here is what an example of request/response would look like:

To give you a better idea of how the library works, we designed a couple of demo examples:

Item unit suggestion demo Item classification suggestion demo

If you find this post interesting, subscribe to our newsletter to get news and updates. Or follow us on Facebook.