- Notifications
You must be signed in to change notification settings - Fork11
NLP Functions for amplifying negations, managing elisions, creating ngrams, stems, phonetic codes to tokens and more.
License
winkjs/wink-nlp-utils
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
NLP Functions for amplifying negations, managing elisions, creating ngrams, stems, phonetic codes to tokens and more.
Prepare raw text for Natural Language Processing (NLP) usingwink-nlp-utils. It offers a set ofAPIs to work onstrings such as names, sentences, paragraphs andtokens represented as an array of strings/words. They perform the required pre-processing for many ML tasks such assemantic search, andclassification.
| Werecommend usingwinkNLP for core natural language processing tasks. Itperforms Tokenization, Sentence Boundary Detection, and Named Entity Recognition at ablazing fast speeds. It supports all yourtext processing needs starting from Sentiment Analysis, POS Tagging, Lemmatization, Stemming, Stop Word Removal, Negation Handling, Bigrams to Frequency Table Creation and more. WinkNLP features user-friendly declarative APIs forIteration,Filtering, andText Visualization, andruns on web browsers. |
Usenpm to install:
npm install wink-nlp-utils --saveThewink-nlp-utils provides over36 utility functions for Natural Language Processing tasks. Some representative examples are extracting person's name from a string, compose training corpus for a chat bot, sentence boundary detection, tokenization and stop words removal:
// Load wink-nlp-utilsvarnlp=require('wink-nlp-utils');// Extract person's name from a string:varname=nlp.string.extractPersonsName('Dr. Sarah Connor M. Tech., PhD. - AI');console.log(name);// -> 'Sarah Connor'// Compose all possible sentences from a string:varstr='[I] [am having|have] [a] [problem|question]';console.log(nlp.string.composeCorpus(str));// -> [ 'I am having a problem',// -> 'I am having a question',// -> 'I have a problem',// -> 'I have a question' ]// Sentence Boundary Detection.varpara='AI Inc. is focussing on AI. I work for AI Inc. My mail is r2d2@yahoo.com';console.log(nlp.string.sentences(para));// -> [ 'AI Inc. is focussing on AI.',// 'I work for AI Inc.',// 'My mail is r2d2@yahoo.com' ]// Tokenize a sentence.vars='For details on wink, check out http://winkjs.org/ URL!';console.log(nlp.string.tokenize(s,true));// -> [ { value: 'For', tag: 'word' },// { value: 'details', tag: 'word' },// { value: 'on', tag: 'word' },// { value: 'wink', tag: 'word' },// { value: ',', tag: 'punctuation' },// { value: 'check', tag: 'word' },// { value: 'out', tag: 'word' },// { value: 'http://winkjs.org/', tag: 'url' },// { value: 'URL', tag: 'word' },// { value: '!', tag: 'punctuation' } ]// Remove stop words:vart=nlp.tokens.removeWords(['mary','had','a','little','lamb']);console.log(t);// -> [ 'mary', 'little', 'lamb' ]
Tryexperimenting with these examples on Runkit in the browser.
Check out thewink NLP utilities API documentation to learn more.
If you spot a bug and the same has not yet been reported, raise a newissue or consider fixing it and sending a pull request.
Wink is a family of open source packages forStatistical Analysis,Natural Language Processing andMachine Learning in NodeJS. The code isthoroughly documented for easy human comprehension and has atest coverage of ~100% for reliability to build production grade solutions.
wink-nlp-utils is copyright 2017-22GRAYPE Systems Private Limited.
It is licensed under the terms of the MIT License.
About
NLP Functions for amplifying negations, managing elisions, creating ngrams, stems, phonetic codes to tokens and more.
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.
