///
import { EventEmitter } from 'events';
import { LuisApiClientConfig, LuisApi } from './luis-api-client';
import { Luis as LuisModel } from '@telefonica/language-model-converter/lib/luis-model';
export interface UpdateEvent {
create: number;
delete: number;
}
export declare type PredictionStats = Map;
export interface PredictionError {
text: string;
tokenizedText?: string[];
intent: string;
intentPredictions?: LuisApi.IntentPrediction[];
ambiguousPredictedIntent?: boolean;
entities?: (LuisApi.EntityLabelExampleGET | LuisApi.EntityLabelExamplePOST)[];
predictedEntities?: LuisApi.EntityLabelExamplePOST[];
}
export interface PredictionResult {
stats: PredictionStats;
errors: PredictionError[];
}
export interface LuisTrainerConfig {
luisApiClientConfig: LuisApiClientConfig;
}
export declare class LuisTrainer extends EventEmitter {
private readonly luisApiClient;
constructor(config: LuisTrainerConfig);
export(appVersion: string): Promise;
update(appVersion: string, model: LuisModel.Model, region?: string, isStaging?: boolean): Promise;
checkPredictions(appVersion: string): Promise;
testExamples(examples: LuisModel.Utterance[], luisSchemaVersion: string): Promise;
private static wrapError(error, message);
private checkCulture(appVersion, culture);
private updateIntents(appVersion, intents);
private updateEntities(appVersion, entities);
private updatePhraseLists(appVersion, modelPhraseLists);
private updateExamples(appVersion, modelExamples, luisSchemaVersion);
private train(appVersion);
private publish(appVersion, region?, isStaging?);
private static splitSentenceByTokens(sentence);
private static tokenizeSentence(sentence);
private static findEntity(sentence, startPos, endPos, luisSchemaVersion);
}