Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/vectorizer/src/text/mod.ts>CountVectorizer

Machine Learning utilities for TypeScript
Latest
class CountVectorizer
import { CountVectorizer } from "https://deno.land/x/vectorizer@v0.7.5/src/text/mod.ts";

Convert tokens into vectors based on term frequency

Constructors

new
CountVectorizer(vocabSize: number)

Properties

vocabSize: number

Methods

transform<T extends DataType>(tokens: number[][], dType: T): Matrix<T>

Convert a document (string | array of strings) into vectors.