MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / run

Function run

intent-classifier/training/raw_to_csv.js:54–73  ·  view source on GitHub ↗
(outPath)

Source from the content-addressed store, hash-verified

52}
53
54function run(outPath) {
55 const DATA_FILES = [
56 'train_AddToPlaylist_full.json',
57 'train_GetWeather_full.json',
58 'train_PlayMusic_full.json',
59 ];
60
61 const DATA_PATH = './data/raw/';
62
63 let allRecords = [];
64 DATA_FILES.forEach(fp => {
65 const fullPath = path.resolve(__dirname, path.join(DATA_PATH, fp));
66 const loaded = loadJSON(fullPath);
67 const parsed = parseRecords(loaded);
68 allRecords = allRecords.concat(parsed);
69 });
70
71 console.log(`Parsed ${allRecords.length} records`);
72 writeCSV(allRecords, outPath);
73}
74
75
76const parser = new argparse.ArgumentParser();

Callers 1

raw_to_csv.jsFile · 0.70

Calls 3

loadJSONFunction · 0.85
writeCSVFunction · 0.85
parseRecordsFunction · 0.70

Tested by

no test coverage detected