/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @oncall memory_lab */ interface TfidfVectorizerProps { rawDocuments: string[]; maxDF?: number; } export declare class TfidfVectorizer { rawDocuments: string[]; vocabulary: Record; documentFrequency: Record; maxDF: number; documents: Record[]; tfidfs: Record[]; constructor({ rawDocuments, maxDF }: TfidfVectorizerProps); computeTfidfs(): Record[]; tokenize(text: string): string[]; buildVocabulary(tokenizedDocuments: string[][]): Record; processDocuments(tokenizedDocuments: string[][]): void; limit(): void; /** * Smooth idf weights by adding 1 to document frequencies (DF), as if an extra * document was seen containing every term in the collection exactly once. * This prevents zero divisions. * */ smooth(): void; buildTfidfs(): Record[]; tf(vocabIdx: string, document: Record): number; idf(vocabIdx: string): number; } export {}; //# sourceMappingURL=TfidfVectorizer.d.ts.map