/concept

Node.js library for accessing to the Microsoft Concept Graph API

Primary LanguageJavaScriptMIT LicenseMIT

concept npm version

npm

Node.js library for accessing to the Microsoft Concept Graph API

Setup

npm install concept

Score by P(c|e)

const Concept = require('concept');
Concept.setAPIKey('MY API KEY');
Concept.scoreByProb('microsoft').then((data) => {
  // e.g. score = {
  //   "company": "0.62",
  //   "technology company": "0.024",
  //   ...
  // };
});

Score by MI

const Concept = require('concept');
Concept.setAPIKey('MY API KEY');
Concept.scoreByMI('microsoft', 0).then((score) => {
  // e.g. score = {
  //   "company": "0.62",
  //   "technology company": "0.024",
  //   ...
  // };
});

Score by P(e|c)

const Concept = require('concept');
Concept.setAPIKey('MY API KEY');
Concept.scoreByTypi('microsoft', 0).then((score) => {
  // e.g. score = {
  //   "company": "0.62",
  //   "technology company": "0.024",
  //   ...
  // };
});

Score by NPMI

const Concept = require('concept');
Concept.setAPIKey('MY API KEY');
Concept.scoreByNPMI('microsoft', 0).then((score) => {
  // e.g. score = {
  //   "company": "0.62",
  //   "technology company": "0.024",
  //   ...
  // };
});

Score by PMI^K

const Concept = require('concept');
Concept.setAPIKey('MY API KEY');
Concept.scoreByPMIK('microsoft', 1.5, 0).then((score) => {
  // e.g. score = {
  //   "company": "0.62",
  //   "technology company": "0.024",
  //   ...
  // };
});

Score by BLC

const Concept = require('concept');
Concept.setAPIKey('MY API KEY');
Concept.scoreByCross('microsoft', 10, 0).then((score) => {
  // e.g. score = {
  //   "company": "0.62",
  //   "technology company": "0.024",
  //   ...
  // };
});

Development

Run the tests

npm test

API Documentation

https://concept.research.microsoft.com/help/index#!/Concept/Concept_ScoreByProb