Socket
Socket
Sign inDemoInstall

cogserv-entity-linking

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cogserv-entity-linking

Node.js client for Microsoft Cognitive Services API - Entity Linking


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

cogserv-entity-linking

Node.js API client for Microsoft Cognitive Services - Entity Linking

Usage

First, set your Microsoft Cognitive Service Entity Link key:

export COGSERV_ENTITYLINK_KEY=<your_api_key>`

Then in your code you can invoke linkEntities with params having the following schema:

{
  text: <text_in_string>,
  selection: <words_or_phrases_in_string>,
  offset: <offset_in_string>
}

Example:

'use strict'
const fs = require('fs')
const async = require('async')
const linkEntities = require('cogserv-entity-linking').linkEntities

const getText = (callback) => {
  fs.readFile('./sample.txt', 'utf8', (err, data) => {
    if (err) return callback(err)
    console.log(data)
    callback(null, data)
  })
}
async.waterfall([
  getText,
  (text, callback) => {
    let params = {
      text: text
    }
    return linkEntities(params, callback)
  }
], (err, result) => {
  if (err) return console.error(err)
  console.log(JSON.stringify(JSON.parse(result), null, 2))
})

Keywords

FAQs

Package last updated on 01 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc