wink-ner
Language agnostic named entity recognizer
Recognize named entities in a sentence using wink-ner
. It is a part of wink — a growing family of high quality packages for Statistical Analysis, Natural Language Processing and Machine Learning in NodeJS.
Installation
Use npm to install:
npm install wink-ner --save
Getting Started
Simple Named Entity Recognition
var ner = require( 'wink-ner' );
var myNER = ner();
var trainingData = [
{ text: 'manchester united', entityType: 'club', uid: 'manu' },
{ text: 'manchester', entityType: 'city' },
{ text: 'U K', entityType: 'country', uid: 'uk' }
];
myNER.learn( trainingData );
var winkTokenizer = require( 'wink-tokenizer' );
var tokenize = winkTokenizer().tokenize;
var tokens = tokenize( 'Manchester United is a football club based in Manchester, U. K.' )
tokens = myNER.recognize( tokens );
console.log( tokens );
Integration with POS Tagging
The tokens
returned from recognize()
may be further passed down to
tag()
api of wink-tokenizer
for pos tagging.
Just in case you need to assign
a specific pos tag to an entity, the same can be achieved by including a property
pos
in the entity definition and assigning it the desired pos tag (e.g. 'NNP'
); the wink-pos-tagger
will automatically do the needful. For details please refer to learn()
api of wink-ner.
var tagger = require( 'wink-pos-tagger' );
var tag = tagger().tag;
tokens = tag( tokens );
console.log( tokens );
Documentation
Check out the named entity recognizer API documentation to learn more.
Need Help?
If you spot a bug and the same has not yet been reported, raise a new issue or consider fixing it and sending a pull request.
Copyright & License
wink-ner is copyright 2017-18 GRAYPE Systems Private Limited.
It is licensed under the under the terms of the GNU Affero General Public License as published by the Free
Software Foundation, version 3 of the License.