Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

wink-eng-lite-web-model

winkjs155.2kMIT1.8.1TypeScript support: included

Wink's English Language Light Web Model for Web Browsers

NLP, Natural Language Processing, English, Browser, wink, winkjs, winkNLP, wink-nlp

readme

wink-eng-lite-web-model

winkNLP's English lite language model for Web Browsers

This is a pre-trained English language model for the winkjs NLP package — winkNLP. It is compatible with browserify — easily create a bundle that you can serve up to the web browser in a single <script> tag or even build a mobile apps. Its gzipped size is ~1MB.

It is an open-source language model, released under the MIT license.

It contains models for the following NLP tasks:

  1. Tokenization
  2. Token's Feature Extraction
  3. Sentence Boundary Detection
  4. Negation Handling
  5. POS tagging
  6. Automatic mapping of British spellings to American
  7. Named Entity Recognition
  8. Sentiment Analysis
  9. Custom Entities Definition
  10. Stemming using Porter Stemmer Algorithm V2
  11. Lemmatization
  12. Readability statistics computation

It is a derivative of wink-eng-lite-model and also supports Typescript.

Getting Started

Prerequisite

It requires Node.js version 16.0.0 or above. The compatible browsers are listed here.

Installation

The model must be installed along with the wink-nlp:

# Install wink-nlp
npm install wink-nlp --save
# Install wink-eng-lite-web-model
npm install wink-eng-lite-web-model --save

Example

We start by requiring the wink-nlp package and the wink-eng-lite-web-model. Then we instantiate wink-nlp using the language model:

// Load "wink-nlp" package.
const winkNLP = require('wink-nlp');
// Load english language model — light version.
const model = require('wink-eng-lite-web-model');
// Instantiate wink-nlp.
const nlp = winkNLP(model);

// Code for Hello World!
var text = 'Hello   World!';
var doc = nlp.readDoc(text);
console.log(doc.out());
// -> Hello   World!

Documentation

Learn how to use this model with winkNLP from the following resources:

  • Overview — introduction to winkNLP.
  • Concepts — everything you need to know to get started.
  • API Reference — explains usage of APIs with examples.

About model

The model supports following NLP tasks — tokenization, sentence boundary detection, negation handling, sentiment analysis, part-of-speech tagging, and named entity extraction.

Tokenization

While it is trained to process English language text, it can tokenize text containing other languages such as Hindi, French and German. Such tokens are tagged as X (foreign word) during pos tagging.

POS Tagging

The model follows the Universal POS tags standards. It delivers an accuracy of ~95% on a subset of WSJ corpus — this includes tokenization of raw text prior to pos tagging.

Named Entity Recognition (NER)

The model is trained to detect CARDINAL, DATE, DURATION, EMAIL, EMOJI, EMOTICON, HASHTAG, MENTION, MONEY, ORDINAL, PERCENT, TIME, and URL.

Sentiment Analysis

It delivers a f-score of ~84.5%, when validated using Amazon Product Review Sentiment Labelled Sentences Data Set at UCI Machine Learning Repository.

Storage Structure

The model is contained in the standard JSON format. Apart from the data, there is a tiny fraction of JS glue code, which is primarily used during model loading.

Need Help?

If you spot a bug and the same has not yet been reported, raise a new issue.

About wink

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.

The wink-eng-lite-web-model is copyright 2020-24 of GRAYPE Systems Private Limited.

It is licensed under the terms of the MIT License.

changelog

Squashed a bug

Version 1.8.1 November 30, 2024

🐛 Fixes

  • Resolve state inconsistency issue. ✅

⚙️ Updates

  • We have made some minor improvements in the model. 😎

Add support for more non regular space characters

Version 1.8.0 May 19, 2024

✨ Features

  • We've enhanced the model to process em/en, third/quarter, thin/hair, medium math space characters & regular/narrow non breaking space characters. 🚀 🛰️

Operational update

Version 1.7.1 May 06, 2024

⚙️ Updates

  • We have made some behind the scene updates in type definitions. 😎

Enable accented chars & word joiner char handling

Version 1.7.0 April 12, 2024

✨ Features

  • Accented characters now also include diacritical marks. 🙌
  • Token containing a word joiner is treated as a single token. ✅
  • Shape of token containing accented chars, diacritical marks & word joiner char(s) is now determined after removing them. 👏

Enable non-breaking space (U+00A0) handling

Version 1.6.0 April 03, 2024

✨ Features

  • We've upgraded the model to process non-breaking spaces in the same way as standard spaces. 🙌

Link github repo

Version 1.5.2 August 01, 2023

⚙️ Updates

  • Updated the missed package.json version. ❤️‍🩹

Link github repo

Version 1.5.1 August 01, 2023

⚙️ Updates

  • We have added link to the github repo in the package.json file. 🙌

Improved POS tagging a bit

Version 1.5.0 March 27, 2023

✨ Features

  • We have enhanced the model a little bit — POS tagging accuracy is now touching 95%. 🙌 🎉

Made it a little better

Version 1.4.3 August 20, 2022

⚙️ Updates

  • We have made some behind the scene updates. 😎

Squashed a bug

Version 1.4.2 August 07, 2022

🐛 Fixes

  • Added missing pre-processing of fractions for NER. ✅

Defined version prerequisite

Version 1.4.1 April 06, 2022

⚙️ Updates

  • We have added engines in package.json for Node.js >= 16 and link to compatible browser version in README. 😎 📔

Detects unsupported Node.js & Browsers and their versions

Version 1.4.0 March 24, 2022

✨ Features

  • While loading, it automatically detects unsupported Node.js & Browsers and their versions. 😎 🙌 😇

Making it more browser friendly

Version 1.3.3 February 08, 2022

⚙️ Updates

  • We have removed Node.js Buffer.from() API calls completely. ✅ 👏 🎉

Operational update

Version 1.3.2 November 18, 2021

⚙️ Updates

  • We have made some behind the scene updates. 😎

Fixed a bug

Version 1.3.1 November 18, 2021

🐛 Fixes

  • Squashed a typo bug in package.json in types field.

Adding Typescript support

Version 1.3.0 November 06, 2021

✨ Features

  • We have added support for Typescript. 🙌🎉

Allows creating multiple instances of winkNLP

Version 1.2.2 August 09, 2021

🐛 Fixes

  • Now create multiple instances of winkNLP using the model. 🔢

Squashed a bug

Version 1.2.1 July 15, 2021

🐛 Fixes

  • Rectified a buggy regex, which failed to parse relatively long numerals. 👏✅

Adding Readability Stats

Version 1.2.0 June 15, 2021

✨ Features

  • Determine the document's Flesch Reading Ease Score (FRES), Reading Time, Complex words, Sentiment Score and more with its.readabilityStats helper. 📚📊👏

Adding lemmatizer support

Version 1.1.0 May 22, 2021

✨ Features

  • Now use its.lemma helper to obtain lemma of words. 👏 🎉

#

⚙️ Updates

  • We have made some behind the scene updates to lexicon & pos model. 📔

Fixing custom entities meta model loading

Version 1.0.1 December 2, 2020

🐛 Fixes

  • Custom entities meta model loading was failing. It has been fixed now. ✅

Announcing the English lite language model for Web Browsers

Version 1.0.0 November 16, 2020

✨ Features

  • Happy to release version 1.0.0 for you! 💫👏
  • You can now build pure web browser or mobile NLP apps without requiring any server side deployment. 😇