const data =["twinkle twinkle little star","How I wonder what you are","up above the world so high","like a diamond in the sky",];// Clean the textconst cleaner =newTextCleaner({
lowercase:true,
stripHtml:true,
stripNewlines:true,
normalizeWhiteSpaces:true,});
x = cleaner.clean(x);// Tokenize the textconst tokenizer =newSplitTokenizer();
tokenizer.fit(x);const x_tokens = tokenizer.transform(x);// Vectorize the tokensconst vectorizer =newCountVectorizer(tokenizer.vocabulary.size);const x_vec = vectorizer.transform(x_tokens,"f32");// Apply Tf-Idf transformationconst transformer =newTfIdfTransformer();console.log(transformer.fit(x_vec).transform(x_vec));