this module is using for calculating the cosine similarity and vector space model using tfidf
npm install content-based-filteringjsconst text =
Content-based filtering methods are based on a description;const token = Tokenize(text);
/**
* output will be like here [
* 'content',
* 'based',
* 'filtering',
* 'are',
* 'based',
* 'on',
* 'description'
* ]
*
*/
`
$3
`js
/**
* Text value must a array of string
* or a value that returned from Tokenize function
*/
const text = [
'content',
'based',
'filtering',
'are',
'based',
'on',
'description'
]const token = Stopword(text);
/**
* output will be like here [
* 'content',
* 'based',
* 'filtering',
* 'based',
* 'description'
* ]
*
* /
`
$3
`js
/**
* Text value must a array of string
* or a value that returned from Stopword function
*/
const text = [
'content',
'based',
'filtering',
'are',
'based',
'on',
'description'
]const token = text.map((t: string) => Stemming(t));
/**
* output will be like here [
* 'content',
* 'base',
* 'filter',
* 'base',
* 'description'
* ]
*
* /
`
$3
Preprocessing is a function for preprocessing a text, preprocessing function will do tokenize, stopword removal, and stemming. `js/**
*
*/
`$3
TF-IDF is a function that will calculate the weight of the term. you can use the full of text without any preprocessing, or you can use the array of string. the string is a return from the preprocessing function`js/**
*
*/
``