winkNLP Documents

A winkNLP document object is a collection of items (sentences, entities, tokens...) and various methods.

// import the winkNLP library and a language model first import winkNLP from 'https://cdn.skypack.dev/wink-nlp'; import winkModel from 'https://cdn.skypack.dev/wink-eng-lite-web-model'; const nlp = winkNLP(winkModel);
The readDoc method transforms text into a winkNLP document. The out method returns a string on an item and an array of strings on a collection. The each method lets you iterate over each item in a collection.