Product
Introducing Ruby Support in Socket
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
winkNLP is a JavaScript library for Natural Language Processing (NLP). Designed specifically to make development of NLP solutions easier and faster, winkNLP is optimized for the right balance of performance and accuracy. The package can handle large amount of raw text at speeds over 500,000 tokens/second. And with a test coverage of ~100%, winkNLP is a tool for building production grade systems with confidence.
It packs a rich feature set into a small foot print codebase of under 1500 lines:
Use npm install:
npm install wink-nlp --save
In order to use winkNLP after its installation, you also need to install a language model. The following command installs the latest version of default language model — the light weight English language model called wink-eng-lite-model.
node -e "require( 'wink-nlp/models/install' )"
Any required model can be installed by specifying its name as the last parameter in the above command. For example:
node -e "require( 'wink-nlp/models/install' )" wink-eng-lite-model
The "Hello World!" in winkNLP is given below. As the next step, we recommend a dive into winkNLP's concepts.
// Load wink-nlp package & helpers.
const winkNLP = require( 'wink-nlp' );
// Load "its" helper to extract item properties.
const its = require( 'wink-nlp/src/its.js' );
// Load "as" reducer helper to reduce a collection.
const as = require( 'wink-nlp/src/as.js' );
// Load english language model — light version.
const model = require( 'wink-eng-lite-model' );
// Instantiate winkNLP.
const nlp = winkNLP( model );
// NLP Code.
const text = 'Hello World🌎! How are you?';
const doc = nlp.readDoc( text );
console.log( doc.out() );
// -> Hello World🌎! How are you?
console.log( doc.sentences().out() );
// -> [ 'Hello World🌎!', 'How are you?' ]
console.log( doc.entities().out( its.detail ) );
// -> [ { value: '🌎', type: 'EMOJI' } ]
console.log( doc.tokens().out() );
// -> [ 'Hello', 'World', '🌎', '!', 'How', 'are', 'you', '?' ]
console.log( doc.tokens().out( its.type, as.freqTable ) );
// -> [ [ 'word', 5 ], [ 'punctuation', 2 ], [ 'emoji', 1 ] ]
Please ask at Stack Overflow or discuss it at Wink JS Gitter Lobby.
If you spot a bug and the same has not yet been reported, raise a new issue or consider fixing it and sending a PR.
Looking for a new feature, request it via a new issue or consider becoming a contributor.
Wink is a family of open source packages for Natural Language Processing, Machine Learning, and Statistical Analysis in NodeJS. The code is thoroughly documented for easy human comprehension and has a test coverage of ~100% for reliability to build production grade solutions.
Wink NLP is copyright 2017-20 GRAYPE Systems Private Limited.
It is licensed under the terms of the MIT License.
Version 0.4.0 August 9, 2020
FAQs
Developer friendly Natural Language Processing ✨
The npm package wink-nlp receives a total of 21,489 weekly downloads. As such, wink-nlp popularity was classified as popular.
We found that wink-nlp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.