1.1.1 • Published 5 years ago

prozorro_ai v1.1.1

Weekly downloads
8
License
ISC
Repository
github
Last release
5 years ago

Description

This subsystem is designed to provide suggestions based on machine learning models.

Notice! It is recommended to use this library starting from version 1.1.0 that introduces authentication via an API key.

Installation

Node

Install with npm:

npm install prozorro_ai

Browser

Include the latest script directly from npm.

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

OR

  1. Download the latest distribution in releases.
  2. Make sure to serve it from your webserver.
  3. Include it on the client from a SCRIPT tag.

Usage

Import

Import script to use Prozorro_AI.

For webpack:

import Prozorro_AI from "prozorro_ai"

For requirejs:

const Prozorro_AI = require('prozorro_ai')

For cdn:

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

Authentication

This library requires authentication via an API key. The API key is issued after the registration confirmation on the https://ocdsanalytics.com/ website. You can find it in the API section on the Account page.

Use API key as follows:

Prozorro_AI.client({apiKey: 'Insert your API_KEY here'}).units.suggest({
...
})

Unit prediction

Based on the inputs, you can get the most probable unit of measurement.

Try it

propertydescriptiontyperequireddefault
1tenderTitleA name of the tenderstringrequired at least one of № 1-4' '
2tenderDescriptionA description of the tenderstringrequired at least one of № 1-4' '
3itemDescriptionA description of the goods, services to be providedstringrequired at least one of № 1-4' '
4itemClassificationThe primary classification for the item. It is mandatory for classification.scheme to be CPV.stringrequired at least one of № 1-4' '
5accuracyCutoffProbability thresholdstring/numbernot required0.1
6limitNumber of the results to be displayedstring/numbernot required5

The example would be as follows:

Find unit of measurement based on tender's title and description, item's description and classification.

Request:

import Prozorro_AI from "prozorro_ai";
// const Prozorro_AI = require('prozorro_ai');
Prozorro_AI.client({apiKey: 'Insert your API_KEY here'}).units.suggest({
  tenderTitle: 'Тканини бавовняні',
  tenderDescription: 'Відбілений сатин',
  itemDescription: 'Сатин відбілений. Склад - 100% бавовна, ширина 200 см',
  itemClassification: '19212000-5'
}, {accuracyCutoff: '0.02', limit: '5'})
.then(response => {
  console.log(response);
}, error => {
  console.log(error);
})

Response:

[
	{
	  id: 'MTR',
      name: 'метри',
      symbol: 'м',
      accuracy: 0.5046774744987488
	},
	{
	  id: 'LM',
      name: 'Погонний метр',
      symbol: 'пог.м.',
      accuracy: 0.40248599648475647
	},
	{
	  id: 'H87',
      name: 'штуки',
      symbol: 'шт.',
      accuracy: 0.05680004507303238
	}
]

Classification prediction

Based on the inputs, you can get the most probable classification.

Try it

propertydescriptiontyperequireddefault
1tenderTitleA name of the tenderstringrequired at least one of № 1-4' '
2tenderDescriptionA description of the tenderstringrequired at least one of № 1-4' '
3itemDescriptionA description of the goods, services to be providedstringrequired at least one of № 1-4' '
4itemUnitName of the unit based on the UN/CEFACT Recommendation 20 unit code.stringrequired at least one of № 1-4' '
5accuracyCutoffProbability thresholdstring/numbernot required0.1
6limitNumber of the results to be displayedstring/numbernot required5

Find classification based on tender's title and description, item's description and unit of measure.

Request:

import Prozorro_AI from "prozorro_ai";
// const Prozorro_AI = require('prozorro_ai');
Prozorro_AI.client({apiKey: 'Insert your API_KEY here'}).classifications.suggest({
  tenderTitle: 'Технічне обслуговування і ремонт офісної техніки',
  tenderDescription: 'Послуги з технічного обслуговування принтерів та картриджів',
  itemDescription: 'Послуги з технічного обслуговування принтерів',
  itemUnit: 'E48'
}, {accuracyCutoff: '0.02', limit: '5'})
.then(response => {
  console.log(response);
}, error => {
  console.log(error);
})

Response:

[
	{
	  id: '50310000-1',
      description: 'Технічне обслуговування і ремонт офісної техніки',
      scheme: 'ДК021',
      accuracy: 0.23198238015174866
	},
	{
	  id: '50323000-5',
      description: 'Ремонт і технічне обслуговування комп’ютерних периферійних пристроїв',
      scheme: 'ДК021',
      accuracy: 0.07701390236616135
	},
	{
	  id: '50320000-4',
      description: 'Послуги з ремонту і технічного обслуговування персональних комп’ютерів',
      scheme: 'ДК021',
      accuracy: 0.07315685600042343
	}
]

Examples

Various examples can be viewed here