/// import Stream from 'stream'; import * as Tp from 'thingpedia'; import { SchemaRetriever } from 'thingtalk'; import { ParserClient } from '../../prediction/parserclient'; import { ParsedDialogue } from '../parsers'; import { SimulationDatabase } from '../../dialogue-agent/simulator/types'; interface DialogueEvaluatorOptions { thingpediaClient: Tp.BaseClient; schemaRetriever?: SchemaRetriever; locale: string; timezone: string; targetLanguage: string; tokenized: boolean; database?: SimulationDatabase; oracle?: boolean; 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 _tokenizer; private _options; private _locale; private _timezone; private _debug; private _tokenized; private _slotExtractor; private _oracle; private _minibatch; constructor(parser: ParserClient, options: DialogueEvaluatorOptions); private _preprocess; 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; declare class CollectDialogueStatistics extends Stream.Writable { private _buffer; constructor(); _write(sample: EvaluationResult, encoding: BufferEncoding, callback: () => void): void; _final(callback: () => void): void; read(): Promise; } export { KEYS, DialogueEvaluatorStream, CollectDialogueStatistics };