classifier.js
Version:
:robot: Natural language processing with Javascript
19 lines (18 loc) • 670 B
TypeScript
import { TokensList } from './tokensList';
import { TokenProps } from './tokensList';
export declare class Category {
name: string;
relatedCategories: Set<string>;
sentences: string[];
inferedTokens: TokensList;
private isUpdated;
constructor(name: string, tokens?: [string, TokenProps][]);
addSentence(sentence: string, relatedCategories: string[]): this;
private normalizeData;
getWords(input: string[] | string): string[];
private isARelatedCategory;
analize(categories: Category[]): this;
private resolveScore;
classify(sentence: string, categories: Category[]): number;
getTokens(): [string, TokenProps][];
}