Socket
Socket
Sign inDemoInstall

nlp-mitie

Package Overview
Dependencies
126
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nlp-mitie

A node binding for the MIT Information Extraction library


Version published
Weekly downloads
11
decreased by-45%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

MITIE

This project is a node binding for the MIT Information Extraction library. It's written in C++ and js.

If you use MITIE, you already know how to use nlp-mitie.

Supported platforms: Mac OS X | Linux

Installing

$ tnpm install nlp-mitie --save

Quick Start

$ git clone git@github.com:alvinhui/nlp-mitie.git
$ cd nlp-mitie
$ tnpm install
$ node examples/english/ner.js

Examples

Named Entity Extractor(NER)

import { NerTrainer, NerTrainingInstance } from 'nlp-mitie';

const sample  = new NerTrainingInstance(['My', 'name', 'is', 'Davis', 'King', 'and', 'I', 'work', 'for', 'MIT', '.']);
sample.addEntity(3, 2, 'person');
sample.addEntity(9, 1, 'org');

const sample2 = new NerTrainingInstance(['The', 'other', 'day', 'at', 'work', 'I', 'saw', 'Brian', 'Smith', 'from', 'CMU', '.'])
sample2.addEntity(7, 2, 'person')
sample2.addEntity(10, 1, 'org')

const trainer = new NerTrainer('models/english/total_word_feature_extractor.dat');
trainer.add(sample);
trainer.add(sample2);
const ner = trainer.train();

const tokens = ['I', 'met', 'with', 'John', 'Becker', 'at', 'HBU', '.']
const entities = ner.extractEntities(tokens, true);
console.log(entities);
// [ {'score': 0.8662716633696536,'entity': 'org','start': 6,'end': 7} ]

Keywords

FAQs

Last updated on 15 Mar 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc