///
import { SchemaRetriever } from 'thingtalk';
import * as Stream from 'stream';
export interface ParsedParaphrase {
id: string;
synthetic_id: string;
synthetic: string;
context?: string;
context_utterance?: string;
assistant_action?: string;
target_code: string;
paraphrase: string;
}
interface ParaphrasingParserOptions {
sentencesPerTask: number;
paraphrasesPerSentence: number;
contextual: boolean;
skipRejected: boolean;
}
export declare class ParaphrasingParser extends Stream.Transform {
private _sentencesPerTask;
private _paraphrasesPerSentence;
private _contextual;
private _id;
constructor(options: ParaphrasingParserOptions);
_transform(row: Record, encoding: BufferEncoding, callback: () => void): void;
_flush(callback: () => void): void;
}
export interface AccumulatedParaphrases {
synthetic_id: string;
synthetic: string;
target_code: string;
paraphrases: Array<{
id: string;
paraphrase: string;
}>;
}
export declare class ParaphrasingAccumulator extends Stream.Transform {
private _totalParaphrasesPerSentence;
private _synthetics;
private _buffers;
constructor(totalParaphrasesPerSentence: number);
_transform(row: ParsedParaphrase, encoding: BufferEncoding, callback: () => void): void;
_flush(callback: () => void): void;
}
interface ValidationParserOptions {
sentencesPerTask: number;
targetSize: number;
skipRejected: boolean;
}
export declare class ValidationParser extends Stream.Transform {
private _sentencesPerTask;
private _targetSize;
private _skipRejected;
constructor(options: ValidationParserOptions);
_transform(row: Record, encoding: BufferEncoding, callback: () => void): void;
_flush(callback: () => void): void;
}
interface ValidationCounterOptions {
targetNumVotes: number;
}
export interface ValidationCount {
id: string;
synthetic_id: string;
synthetic: string;
target_code: string;
paraphrase: string;
same_count: number;
diff_count: number;
}
export declare class ValidationCounter extends Stream.Transform {
private _targetNumVotes;
private _buffer;
constructor(options: ValidationCounterOptions);
_transform(row: ParsedParaphrase & {
vote: string;
}, encoding: BufferEncoding, callback: () => void): void;
_flush(callback: () => void): void;
}
interface ValidationRejecterOptions {
sentencesPerTask: number;
}
export declare class ValidationRejecter extends Stream.Transform {
private _sentencesPerTask;
constructor(options: ValidationRejecterOptions);
_transform(row: Record, encoding: BufferEncoding, callback: (err: Error | null, row: Record) => void): void;
_flush(callback: () => void): void;
}
interface ParaphrasingRejecterOptions {
locale: string;
timezone: string;
sentencesPerTask: number;
paraphrasesPerSentence: number;
contextual: boolean;
}
export declare class ParaphrasingRejecter extends Stream.Transform {
private _schemas;
private _langPack;
private _tokenizer;
private _locale;
private _timezone;
private _sentencesPerTask;
private _paraphrasesPerSentence;
private _contextual;
private _counter;
private _id;
constructor(schemaRetriever: SchemaRetriever, options: ParaphrasingRejecterOptions);
private _validate;
_doTransform(row: Record): Promise>;
_transform(row: Record, encoding: BufferEncoding, callback: (err: Error | null, row?: Record) => void): void;
_flush(callback: () => void): void;
}
export {};