/// <reference types="node" />
import Stream from 'stream';
import * as Tp from 'thingpedia';
import { ParserClient } from '../../prediction/parserclient';
import { ParsedDialogue } from '../parsers';
interface SimulationDatabase {
    has(key: string): boolean;
    get(key: string): Array<{
        [key: string]: unknown;
    }> | undefined;
}
interface DialogueEvaluatorOptions {
    thingpediaClient: Tp.BaseClient | null;
    locale: string;
    targetLanguage: string;
    tokenized: boolean;
    database?: SimulationDatabase;
    debug?: boolean;
}
export interface ExampleEvaluationResult {
    turns: number;
    ok: number;
    ok_slot: number;
    ok_initial: number;
    ok_initial_slot: number;
    ok_partial: number;
    ok_partial_slot: number;
    ok_prefix: number;
    ok_prefix_slot: number;
    ok_progress: number;
    ok_progress_slot: number;
}
export declare type EvaluationResult = ExampleEvaluationResult & {
    total: number;
    turns: number;
    [key: string]: number;
};
declare class DialogueEvaluatorStream extends Stream.Transform {
    private _parser;
    private _tpClient;
    private _tokenizer;
    private _options;
    private _locale;
    private _debug;
    private _tokenized;
    private _database;
    private _cachedEntityMatches;
    private _minibatch;
    constructor(parser: ParserClient, options: DialogueEvaluatorOptions);
    private _preprocess;
    private _isWellKnownEntity;
    private _tokenizeSlot;
    private _resolveEntity;
    private _valueToSlot;
    private _extractSlots;
    private _checkTurn;
    private _evaluate;
    private _flushMinibatch;
    private _pushDialogue;
    _transform(dialog: ParsedDialogue, encoding: BufferEncoding, callback: (err: Error | null) => void): void;
    _flush(callback: (err: Error | null) => void): void;
}
declare const KEYS: Array<keyof ExampleEvaluationResult>;
declare class CollectDialogueStatistics extends Stream.Writable {
    private _buffer;
    constructor();
    _write(sample: EvaluationResult, encoding: BufferEncoding, callback: () => void): void;
    _final(callback: () => void): void;
    read(): Promise<EvaluationResult>;
}
export { KEYS, DialogueEvaluatorStream, CollectDialogueStatistics };
