NaiveBayesTextClassifier#definePrepTasks

Parsed documentation:
View on GitHub
/**
* Defines the text preparation `tasks` to transform raw incoming
* text into tokens required during
* [`learn()`](#learn), [`evaluate()`](#evaluate) and [`predict()`](#predict) operations.
* The `tasks` should be an array of functions;
* using these function a simple pipeline is built to serially transform the
* input to the output.
*
* @method NaiveBayesTextClassifier#definePrepTasks
* @param {function[]} tasks the first function
* in this array must accept a string as input and the last function must
* return tokens i.e. array of strings. Please refer to example.
* @return {number} The number of functions in `task` array.
* @example
* // Load wink NLP utilities
* var nlp = require( 'wink-nlp-utils' );
* // Define the text preparation tasks.
* myClassifier.definePrepTasks( [
*   // Simple tokenizer to convert input text in to tokens
*   nlp.string.tokenize0,
*   // Removes stop words from the input tokens
*   nlp.tokens.removeWords,
*   // Stems each token into its base form
*   nlp.tokens.stem
* ] );
* // -> 3
* @throws Error if `tasks` is not an array of functions.
*/
No suggestions.
Please help! Open an issue on GitHub if this assessment is incorrect.