-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
49 lines (42 loc) · 1.27 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
export interface IEntity {
entity: string;
start: number;
end: number;
score: number;
}
export interface IIntent {
intent: string;
score: number;
}
declare class TotalWordFeatureExtractor {
constructor(feFilePath?: string);
numberDimensions: Array<any>;
getFeatureVector(text: string): any;
}
declare class TextCategorizer {
constructor(filePath: string, feFilePath?: string);
classify(tokens: string[], featureExtractor?: TotalWordFeatureExtractor): IIntent[];
saveToDisk(path: string, pureModel?: boolean): boolean;
}
declare class TextCategorizerTrainer {
constructor(feFilePath?: string);
add(tokens: string[], label: string): void;
train(): TextCategorizer;;
numThreads: number;
}
declare class NamedEntityExtractor {
constructor(filePath?: string, feFilePath?: string);
extractEntities(tokens: string[], featureExtractor?: TotalWordFeatureExtractor): IEntity[];
saveToDisk(path: string, pureModel?: boolean): boolean;
getPossibleTags(): string[];
}
declare class NerTrainingInstance {
constructor(tokens: string[]);
addEntity(start: number, length: number, entity: string): void;
}
declare class NerTrainer {
constructor(feFilePath?: string);
add(instance: NerTrainingInstance): void;
train(): NamedEntityExtractor;
numThreads: number;
}