Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const outputdir = path.resolve(jobdir, 'output');
const tpClient = new AdminThingpediaClient(task.language);
const schemas = new ThingTalk.SchemaRetriever(tpClient, null, true);
const parser = new LocalParserClient(outputdir, task.language);
await parser.start();
const output = fs.createReadStream(path.resolve(datadir, 'eval.tsv'))
.setEncoding('utf8')
.pipe(byline())
.pipe(new Genie.DatasetParser({
contextual: task.modelInfo.contextual,
preserveId: true,
parseMultiplePrograms: true
}))
.pipe(new Genie.SentenceEvaluatorStream(parser, schemas, true /* tokenized */, argv.debug))
.pipe(new Genie.CollectSentenceStatistics());
const result = await output.read();
await task.setMetrics(result);
await Promise.all([
parser.stop(),
TokenizerService.tearDown(),
AbstractFS.removeTemporary(jobdir)
]);
};