From b988907660dd0c0be8dfe1acb834d4d9848cab22 Mon Sep 17 00:00:00 2001 From: v-geberr Date: Wed, 11 Oct 2017 16:24:48 -0700 Subject: [PATCH 1/6] uses public app id now --- .../python/quickstart-call-endpoint-3-6.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/documentation-samples/endpoint-api-samples/python/quickstart-call-endpoint-3-6.py b/documentation-samples/endpoint-api-samples/python/quickstart-call-endpoint-3-6.py index 19d55f6..19d03b3 100644 --- a/documentation-samples/endpoint-api-samples/python/quickstart-call-endpoint-3-6.py +++ b/documentation-samples/endpoint-api-samples/python/quickstart-call-endpoint-3-6.py @@ -1,8 +1,6 @@ ########### Python 3.6 ############# import requests -appid = '' - headers = { # Request headers 'Ocp-Apim-Subscription-Key': 'YOUR-SUBSCRIPTION-KEY', @@ -19,7 +17,7 @@ params ={ } try: - r = requests.get('https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/' + appid,headers=headers, params=params) + r = requests.get('https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/60340f5f-99c1-4043-8ab9-c810ff16252d',headers=headers, params=params) print(r.json()) except Exception as e: From 11ed29345bc2c1ddac1dab88818cf9a0f3143540 Mon Sep 17 00:00:00 2001 From: v-geberr Date: Thu, 12 Oct 2017 09:45:39 -0700 Subject: [PATCH 2/6] [wip] iot-lights --- .vscode/launch.json | 14 + .../_parse.js | 95 ++++ .../_upload.js | 77 +++ .../error1.json | 24 + .../error2.json | 31 ++ .../example-files/iot-lights-utterances.json | 25 + .../index.js | 45 ++ .../iot-lights-utterances.json | 25 + .../media/export-app-data.png | Bin 0 -> 15830 bytes .../note.json | 46 ++ .../package-lock.json | 461 ++++++++++++++++++ .../package.json | 19 + .../readme.md | 181 +++++++ .../utterances.json | 26 + 14 files changed, 1069 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 examples/demo-Upload-utterances-from-iot-lights/_parse.js create mode 100644 examples/demo-Upload-utterances-from-iot-lights/_upload.js create mode 100644 examples/demo-Upload-utterances-from-iot-lights/error1.json create mode 100644 examples/demo-Upload-utterances-from-iot-lights/error2.json create mode 100644 examples/demo-Upload-utterances-from-iot-lights/example-files/iot-lights-utterances.json create mode 100644 examples/demo-Upload-utterances-from-iot-lights/index.js create mode 100644 examples/demo-Upload-utterances-from-iot-lights/iot-lights-utterances.json create mode 100644 examples/demo-Upload-utterances-from-iot-lights/media/export-app-data.png create mode 100644 examples/demo-Upload-utterances-from-iot-lights/note.json create mode 100644 examples/demo-Upload-utterances-from-iot-lights/package-lock.json create mode 100644 examples/demo-Upload-utterances-from-iot-lights/package.json create mode 100644 examples/demo-Upload-utterances-from-iot-lights/readme.md create mode 100644 examples/demo-Upload-utterances-from-iot-lights/utterances.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..a053d23 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Launch Program", + "program": "${file}" + } + ] +} \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/_parse.js b/examples/demo-Upload-utterances-from-iot-lights/_parse.js new file mode 100644 index 0000000..05151e5 --- /dev/null +++ b/examples/demo-Upload-utterances-from-iot-lights/_parse.js @@ -0,0 +1,95 @@ +// node 7.x +// built with streams for larger files + +const fse = require('fs-extra'); +const path = require('path'); +const lineReader = require('line-reader'); +const Promise = require('bluebird'); + + +// rewrite each items properties and values +function mapEntity(entities) { + + return entities.map(entity => { + + // create new properties + entity.entityName = entity.entity; + entity.startCharIndex = entity.startPos; + entity.endCharIndex = entity.endPos; + + // delete old properties + delete entity.startPos; + delete entity.endPos; + delete entity.entity; + + return entity; + + }); +} + +var utterance = function (i, item) { + + let json = { + "row": i, + "text": "", + "intentName": "", + "entityLabels": {} + }; + + if (!item) return json; + + try { + + json.intentName = item.intent; + json.text = item.text; + json.entityLabels = item.entities && item.entities.length ? mapEntity(item.entities) : []; + + return json; + + } catch (err) { + // do something with error + console.log("err " + err); + } + +}; + +// main function to call +// read stream line at a time +// conversion happens in precess.convert_utterance_map file +const convert = async (config) => { + + try{ + + var i = 0; + + // get inFile stream + inFileJSON = require(config.inFile); + + // create out file + var myOutFile = await fse.createWriteStream(config.outFile, 'utf-8'); + myOutFile.write('['); + + // read 1 line + inFileJSON.utterances.forEach( (item) => { + + // transform utterance from csv to json + jsonUtterance = utterance(++i, item); + + // write to out stream + if (i > 1) myOutFile.write(","); + myOutFile.write(JSON.stringify(jsonUtterance)); + + }); + + myOutFile.write(']'); + myOutFile.end(); + console.log("parse done"); + return config; + + }catch (err) { + return err; + } + +} + +module.exports = convert; \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/_upload.js b/examples/demo-Upload-utterances-from-iot-lights/_upload.js new file mode 100644 index 0000000..b90b0f2 --- /dev/null +++ b/examples/demo-Upload-utterances-from-iot-lights/_upload.js @@ -0,0 +1,77 @@ +// node 7.x +// uses async/await - promises + +var rp = require('request-promise'); +var fs = require('fs-extra'); +var path = require('path'); + + +// main function to call +var upload = async (config) => { + + try{ + // request options + config.options = { + uri: config.uri, + method: 'POST', + headers: { + 'Ocp-Apim-Subscription-Key': config.LUIS_subscriptionKey + }, + json: true + }; + + config.response = { + success: {}, + error: {} + }; + + return await getBatchFromFile(config) + .then(sendBatchToApi) + .then(response => { + console.log("upload done"); + return response; + }); + + } catch(err){ + return err; + } + +} +// get json from file - already formatted for this api +var getBatchFromFile = async (config) => { + try { + + var inFile = await fs.readFile(config.inFile, 'utf-8'); + + config.options.body = inFile; + config.response.success.getBatchFromFile = true; + + return config; + + } catch (err) { + console.log(err); + config.response.error.getBatchFromFile = err; + return config; + } +} +// send json as post.body to api +var sendBatchToApi = async (config) => { + try { + + uploadResponse = await rp.post(config.options); + writeFileResponse = await fs.writeFile(config.inFile.replace('.json','.upload.json'),JSON.stringify(uploadResponse), 'utf-8'); + + config.response.success.sendBatchToApi = {}; + config.response.success.sendBatchToApi.upload = uploadResponse; + config.response.success.sendBatchToApi.writeFile = writeFileResponse; + + return config; + } + catch (err) { + config.response.error.sendBatchToApi = err; + console.log(JSON.stringify(err)); + return err; + } +} + +module.exports = upload; \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/error1.json b/examples/demo-Upload-utterances-from-iot-lights/error1.json new file mode 100644 index 0000000..6f13fde --- /dev/null +++ b/examples/demo-Upload-utterances-from-iot-lights/error1.json @@ -0,0 +1,24 @@ +{ + "name": "StatusCodeError", + "statusCode": 401, + "message": "401 - {\"error\":{\"code\":\"Unauthorized\",\"message\":\"User does not own this application\"}}", + "error": {"er + ror":{"code":"Unauthorized","message":"User does not own this application"}},"options":{"uri":"https: //westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/60340f5 + f-99c1-4043-8ab9-c810ff16252d/versions/0.1/examples","method":"POST","headers":{"Ocp-Apim-Subscription-Key":"e237d6bc86cd4562bf67b09dff44d2e6"},"json":true,"simple": true, + "resolveWithFullResponse": false, + "transform2xxOnly": false + }, + "response": { + "statusCode": 401, + "body": { + "error": { + "code": "Unauthorized", + "message":"User does not own thi + s application"}},"headers":{"cache-control":"private","content-length":"105","content-type":"application/json; charset=utf-8","x-content-type-options":"nosniff","x- + frame-options":"SAMEORIGIN","x-powered-by":"ASP.NET","apim-request-id":"488339d1-8c12-4529-a9a1-a5516a3aea10","strict-transport-security":"max-age=31536000; include + SubDomains; preload","date":"Thu, + 12 Oct2017 16: 26: 58 GMT","connection":"close"},"request":{"uri":{"protocol":"https: ","slashes":true,"auth":null,"host":"westus.ap + i.cognitive.microsoft.com","port":443,"hostname":"westus.api.cognitive.microsoft.com","hash":null,"search":null,"query":null,"pathname":"/luis/api/v2.0/apps/60340f5 + f-99c1-4043-8ab9-c810ff16252d/versions/0.1/examples","path":"/luis/api/v2.0/apps/60340f5f-99c1-4043-8ab9-c810ff16252d/versions/0.1/examples","href":"https: //westus. + api.cognitive.microsoft.com/luis/api/v2.0/apps/60340f5f-99c1-4043-8ab9-c810ff16252d/versions/0.1/examples"},"method":"POST","headers":{"Ocp-Apim-Subscription-Key":" + e237d6bc86cd4562bf67b09dff44d2e6","accept":"application/json","content-length":0}}}} \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/error2.json b/examples/demo-Upload-utterances-from-iot-lights/error2.json new file mode 100644 index 0000000..1a8c344 --- /dev/null +++ b/examples/demo-Upload-utterances-from-iot-lights/error2.json @@ -0,0 +1,31 @@ +{ + "name": "StatusCodeError", + "statusCode": 400, + "message":"400 - {\"error\":{\"code\":\"BadArgument\",\"message\":\"Failed to parse example labeling objects. Parameter n + ame: exampleLabelObjects\"}}", + "error": { + "error": { + "code": "BadArgument", + "message": "Failed to parse example labeling objects. Parameter name: exampleLabelObjects" + } + },"op + tions":{"uri":"https: //westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/84d6601f-a1f0-456e-a894-be5e662a5a6b/versions/0.1/examples","method":"POST","headers":{ "Ocp-Apim-Subscription-Key": "e237d6bc86cd4562bf67b09dff44d2e6" +}, +"json": true, +"simple": true, +"resolveWithFullResponse": false, +"transform2xxOnly": false +}, +"response": {"sta + tusCode":400,"body":{"error":{"code":"BadArgument","message":"Failed to parse example labeling objects. Parameter name: exampleLabelObjects"}},"headers":{"cache-con + trol":"private","content-length":"147","content-type":"application/json; charset=utf-8","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-powered + -by":"ASP.NET","apim-request-id":"d2dc2163-03a7-403e-9ab5-0a37b97a9356","strict-transport-security":"max-age=31536000; includeSubDomains; preload","date":"Thu, +12 O + ct2017 16: 30: 30 GMT","connection":"close"},"request":{"uri":{"protocol":"https: ","slashes":true,"auth":null,"host":"westus.api.cognitive.microsoft.com","port":443, + "hostname": "westus.api.cognitive.microsoft.com", +"hash": null, +"search": null, +"query": null, +"pathname":"/luis/api/v2.0/apps/84d6601f-a1f0-456e-a894-be5e662a5a6b/versions + /0.1/examples","path":"/luis/api/v2.0/apps/84d6601f-a1f0-456e-a894-be5e662a5a6b/versions/0.1/examples","href":"https: //westus.api.cognitive.microsoft.com/luis/api/v 2.0/apps/84d6601f-a1f0-456e-a894-be5e662a5a6b/versions/0.1/examples"},"method":"POST","headers":{"Ocp-Apim-Subscription-Key":"e237d6bc86cd4562bf67b09dff44d2e6","acc + ept":"application/json","content-length":0}}}} \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/example-files/iot-lights-utterances.json b/examples/demo-Upload-utterances-from-iot-lights/example-files/iot-lights-utterances.json new file mode 100644 index 0000000..444129e --- /dev/null +++ b/examples/demo-Upload-utterances-from-iot-lights/example-files/iot-lights-utterances.json @@ -0,0 +1,25 @@ +{ + "utterances": [ + { + "text": "turn the lights off", + "intent": "TurnAllOff", + "entities": [] + }, + { + "text": "turn on floor lamp in green", + "intent": "TurnOn", + "entities": [ + { + "entity": "Light", + "startPos": 8, + "endPos": 12 + }, + { + "entity": "Color", + "startPos": 22, + "endPos": 26 + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/index.js b/examples/demo-Upload-utterances-from-iot-lights/index.js new file mode 100644 index 0000000..2dee7b0 --- /dev/null +++ b/examples/demo-Upload-utterances-from-iot-lights/index.js @@ -0,0 +1,45 @@ +var path = require('path'); + +const parse = require('./_parse'); +const upload = require('./_upload'); + +// TBD: CHANGE THESE VALUES +//const LUIS_subscriptionKey = "YOUR-SUBSCRIPTION-KEY"; +const LUIS_subscriptionKey = "e237d6bc86cd4562bf67b09dff44d2e6"; +const LUIS_appId = "84d6601f-a1f0-456e-a894-be5e662a5a6b"; +const LUIS_versionId = "0.1"; + +// NOTE: final output of upload api named utterances.upload.json +const iotFile= "./iot-lights-utterances.json"; +const uploadFile = "./utterances.json" + +/* upload configuration */ +var configUpload = { + LUIS_subscriptionKey: LUIS_subscriptionKey, + LUIS_appId: LUIS_appId, + LUIS_versionId: LUIS_versionId, + inFile: path.join(__dirname, uploadFile), + uri: "https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/{appId}/versions/{versionId}/examples".replace("{appId}", LUIS_appId).replace("{versionId}", LUIS_versionId) +}; + +/* parse configuration */ +var configParse = { + inFile: path.join(__dirname, iotFile), + outFile: path.join(__dirname, uploadFile) +}; + +var output = {}; + +parse(configParse) +.then(output => { + output.convert = output; + return upload(configUpload); +}).then(output => { + output.upload = output; + console.log("process done"); +}); + + +// single step - uncomment 1 line only +//parse(configParse); +//upload(configUpload) \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/iot-lights-utterances.json b/examples/demo-Upload-utterances-from-iot-lights/iot-lights-utterances.json new file mode 100644 index 0000000..444129e --- /dev/null +++ b/examples/demo-Upload-utterances-from-iot-lights/iot-lights-utterances.json @@ -0,0 +1,25 @@ +{ + "utterances": [ + { + "text": "turn the lights off", + "intent": "TurnAllOff", + "entities": [] + }, + { + "text": "turn on floor lamp in green", + "intent": "TurnOn", + "entities": [ + { + "entity": "Light", + "startPos": 8, + "endPos": 12 + }, + { + "entity": "Color", + "startPos": 22, + "endPos": 26 + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/media/export-app-data.png b/examples/demo-Upload-utterances-from-iot-lights/media/export-app-data.png new file mode 100644 index 0000000000000000000000000000000000000000..0c817740ff6194e5aa94fcbe9a3bccbe53f8e97e GIT binary patch literal 15830 zcmdtJXH-*N*EWi`w_?XzQKa7%K)L||sj&gll`0U30wGc(gchn56-1B(2wkN~mrkg* z5Fmkw2r&kN0tqG5gc?XV8=v!>@BPj>;~n37p64Co8|MdOv)9J=9w|4>ed+%OzL<$HT3EKYKLHCpn6A;k%F}ZrlHq3Q)81Wo35Vf_4s<&ErXgY&F z41QXsP;&V44OcqtsYRI0gt1NSV>$u5=SZXWRbe!l-S=FC%B%$}!38sHn& z2TT&4tsl*Nckjx%L&9#yzGe?oT`ITcf3U(O-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CMi3b!${KMO(Bz2{RbVPzH(-Wt-#~w?niy&G$z{AWhOYNX;6i(KK;sU3uqv2L>8!TiMsD#K^%{sRv#(OdH%;MDBXs5F?)0wIAO?iL)c^ zl%Xg;oZeBb-sA#kQu^25)U^78LZz>j$Dz(Ah6o`@Jz)JF`*Il`tp z0T1nN%RXAo9L!_)hb09}z7^9vxwT4YC;bY$ir>5#zsu(LIkIPuMG9fVlp+s8jt%>V zZrZpTSRBV_HA6u^enqsuObbmQCPj^&OM0#QVs~4eC$NfueV_l=3E+RHkpI7S=J>zd fW0V|wYsVF`U;Cvd!wkT50TV;Zs}+}TJ@`KWOK_pX literal 0 HcmV?d00001 diff --git a/examples/demo-Upload-utterances-from-iot-lights/note.json b/examples/demo-Upload-utterances-from-iot-lights/note.json new file mode 100644 index 0000000..77de535 --- /dev/null +++ b/examples/demo-Upload-utterances-from-iot-lights/note.json @@ -0,0 +1,46 @@ +{ + "name": "StatusCodeError", + "statusCode": 400, + "message":"400 - {\"error\":{\"code\":\"BadArgument\",\"message\":\"Failed to parse example labeling objects. Paramet + er name: exampleLabelObjects\"}}", + "error": { + "error": { + "code": "BadArgument","messag + e":"Failed to parse example labeling objects. Parameter name: exampleLabelObject + s"}},"options":{"uri":"https: //westus.api.cognitive.microsoft.com/luis/api/v2.0/ + apps/84d6601f-a1f0-456e-a894-be5e662a5a6b/versions/0.1/examples","method":"POST", + "headers": { + "Ocp-Apim-Subscription-Key": "e237d6bc86cd4562bf67b09dff44d2e6" + },"jso + n":true,"simple":true,"resolveWithFullResponse":false,"transform2xxOnly":false}, + "response": { + "statusCode": 400, + "body": { + "error": { + "code": "BadArgument", + "message":"Fa + iled to parse example labeling objects. Parameter name: exampleLabelObjects"}}," + headers":{"cache-control":"private","content-length":"147","content-type":"appli + cation/json; charset=utf-8","x-content-type-options":"nosniff","x-frame-options": "SAMEORIGIN", + "x-powered-by": "ASP.NET", + "apim-request-id":"7f81b045-cf25-4071-a02 + 2-371c9af89fa9","strict-transport-security":"max-age=31536000; includeSubDomains + ; preload","date":"Wed, + 11 Oct2017 15: 33: 04 GMT","connection":"close"},"request":{"uri":{"protocol":"https: ","slashes":true,"auth":null,"host":"westus.api.cogn + itive.microsoft.com","port":443,"hostname":"westus.api.cognitive.microsoft.com", + "hash": null, + "search": null, + "query": null, + "pathname":"/luis/api/v2.0/apps/84d6601f- + a1f0-456e-a894-be5e662a5a6b/versions/0.1/examples","path":"/luis/api/v2.0/apps/84d6601f-a1f0-456e-a894-be5e662a5a6b/versions/0.1/examples","href":"https: //westu + s.api.cognitive.microsoft.com/luis/api/v2.0/apps/84d6601f-a1f0-456e-a894-be5e662 + a5a6b/versions/0.1/examples"},"method":"POST","headers":{"Ocp-Apim-Subscription- + Key":"e237d6bc86cd4562bf67b09dff44d2e6","accept":"application/json","content-len + gth":0}}}} + + { + "row": 1, + "text": "go to paris", + "intentName": "BookFlight" + }, + \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/package-lock.json b/examples/demo-Upload-utterances-from-iot-lights/package-lock.json new file mode 100644 index 0000000..0c72ae6 --- /dev/null +++ b/examples/demo-Upload-utterances-from-iot-lights/package-lock.json @@ -0,0 +1,461 @@ +{ + "name": "demo-Upload-utterances-from-querylog", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ajv": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.2.3.tgz", + "integrity": "sha1-wG9Zh3jETGsWGrr+NGa4GtGBTtI=", + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "json-schema-traverse": "0.3.1", + "json-stable-stringify": "1.0.1" + } + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" + }, + "babyparse": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/babyparse/-/babyparse-0.4.6.tgz", + "integrity": "sha1-j/KbYtHmAMBlSv1jRX+X+iw26cE=" + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" + }, + "boom": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", + "requires": { + "hoek": "4.2.0" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "combined-stream": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "requires": { + "delayed-stream": "1.0.0" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "cryptiles": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", + "requires": { + "boom": "5.2.0" + }, + "dependencies": { + "boom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "requires": { + "hoek": "4.2.0" + } + } + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "1.0.0" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", + "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.1.tgz", + "integrity": "sha1-b7lPvXGIUwbXPRXMSX/kzE7NRL8=", + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.17" + } + }, + "fs-extra": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.2.tgz", + "integrity": "sha1-+RcExT0bRh+JNFKwwwfZmXZHq2s=", + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "4.0.0", + "universalify": "0.1.1" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "requires": { + "ajv": "5.2.3", + "har-schema": "2.0.0" + } + }, + "hawk": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", + "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "requires": { + "boom": "4.3.1", + "cryptiles": "3.1.2", + "hoek": "4.2.0", + "sntp": "2.0.2" + } + }, + "hoek": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", + "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==" + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "4.1.11" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "line-reader": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/line-reader/-/line-reader-0.4.0.tgz", + "integrity": "sha1-F+RIGNoKwzVnW6MAlU+U72cOZv0=" + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" + }, + "mime-db": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", + "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" + }, + "mime-types": { + "version": "2.1.17", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", + "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "requires": { + "mime-db": "1.30.0" + } + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + }, + "request": { + "version": "2.83.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", + "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", + "requires": { + "aws-sign2": "0.7.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.3.1", + "har-validator": "5.0.3", + "hawk": "6.0.2", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.17", + "oauth-sign": "0.8.2", + "performance-now": "2.1.0", + "qs": "6.5.1", + "safe-buffer": "5.1.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.6.0", + "uuid": "3.1.0" + } + }, + "request-promise": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.2.tgz", + "integrity": "sha1-0epG1lSm7k+O5qT+oQGMIpEZBLQ=", + "requires": { + "bluebird": "3.5.1", + "request-promise-core": "1.1.1", + "stealthy-require": "1.1.1", + "tough-cookie": "2.3.3" + } + }, + "request-promise-core": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", + "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", + "requires": { + "lodash": "4.17.4" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "sntp": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.0.2.tgz", + "integrity": "sha1-UGQRDwr4X3z9t9a2ekACjOUrSys=", + "requires": { + "hoek": "4.2.0" + } + }, + "sshpk": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + } + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" + }, + "tough-cookie": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "universalify": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", + "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=" + }, + "uuid": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", + "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + } + } + } +} diff --git a/examples/demo-Upload-utterances-from-iot-lights/package.json b/examples/demo-Upload-utterances-from-iot-lights/package.json new file mode 100644 index 0000000..063a339 --- /dev/null +++ b/examples/demo-Upload-utterances-from-iot-lights/package.json @@ -0,0 +1,19 @@ +{ + "name": "demo-Upload-utterances-from-querylog", + "version": "1.0.0", + "description": "Use Microsoft LUIS api to upload utterance examples from query log.", + "main": "index.js", + "scripts": { + "start": "node index.js" + }, + "author": "v-geberr", + "license": "ISC", + "dependencies": { + "babyparse": "^0.4.6", + "bluebird": "^3.5.1", + "fs-extra": "^4.0.2", + "line-reader": "^0.4.0", + "request": "^2.83.0", + "request-promise": "^4.2.2" + } +} diff --git a/examples/demo-Upload-utterances-from-iot-lights/readme.md b/examples/demo-Upload-utterances-from-iot-lights/readme.md new file mode 100644 index 0000000..55280ac --- /dev/null +++ b/examples/demo-Upload-utterances-from-iot-lights/readme.md @@ -0,0 +1,181 @@ +# Upload utterances from query log + +A sample nodeJs application to read a [LUIS](https://www.luis.ai) application's [query logs](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c36), parse labels, and [upload as a batch](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c09) . + +The application main file is the [index.js]('./index.js). This file contains the configuration settings and calls into the three files: + +- [_download.js](./_download.js) : download LUIS query logs +- [_parse.js](./_parse.js) : convert csv from query logs into json for upload +- [_upload.js](./_upload) : upload json to batch label api + +The application will create files associated with each step: + +- [utterances.csv](./example-files/utterances.csv) : query logs +- [utterances.json](./example-files/utterances.json) : batch labels +- [utterances.upload.json](./example-files/utterances.upload.json) : final response body from upload api + +If one or all of these files is missing, their was an error with the application. + +### Prerequisites +The minimum prerequisites to run this sample are: +* Latest Node.js with NPM. Download it from [here](https://nodejs.org/en/download/). +* A [trained](https://docs.microsoft.com/en-us/azure/cognitive-services/LUIS/train-test) and [published](https://docs.microsoft.com/en-us/azure/cognitive-services/LUIS/publishapp) LUIS Application. +* **[Recommended]** Visual Studio Code for IntelliSense and debugging, download it from [here](https://code.visualstudio.com/) for free. + +### Install +Install the nodeJS dependencies from NPM in the terminal/command line. + +```` +> npm install +```` + +### Change Configuration Settings +In order to use this application, you need to change the values in the index.js file to your own subscription key, app id, and version id. + +Open the index.js file, and change these values at the top of the file. + + +````JavaScript +// TBD: CHANGE THESE VALUES +const LUIS_subscriptionKey = ""; +const LUIS_appId = ""; +const LUIS_versionId = ""; +```` +### Run the application +Run the application from a terminal/command line with nodeJs. + +```` +> node index.js +```` +### Application progress +While the application is running, the terminal/command line will show progress. + +```` +> node index.js +download done +parse done +upload done +process done +```` + +### LUIS Apis used in this sample +This sample uses the [download query log](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c36) api as well as the [batch add labels](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c09) api. + +### Format of the JSON for the batch upload +The format of the JSON for the batch upload is noted in the [batch add labels](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c09) api. It is important to not that the format of the download for query logs is different both in content and format. + +If you export your application data from [luis.ai applications list](https://www.luis.ai/applications) with the **Export app data to JSON file**, you will need to change the JSON format to match the stated format for the batch upload. + +### Errors in output file of the application +The final response body from upload api is in the 'utterances.upload.json' file. This file will be an array of responses, one response for each item in the batch. + +Each item in the batch can succeed or fail independent of any other item, so it is important to check the response. + +#### Examples of correctly formatted items: + +````JavaScript +// successfully formated item + { + "row": 1, + "text": "go to paris", + "intentName": "BookFlight", + "entityLabels": [ + { + "entityName": "Location::LocationTo", + "startCharIndex": 6, + "endCharIndex": 10 + } + ] + } +```` + +#### An example of a successful item upload response: + +````JavaScript +// successfully uploaded item +{ + "value": { + "UtteranceText": "go to paris", + "ExampleId": -175128 + }, + "hasError": false +} +```` + +#### Examples of successful request with failed items : + +````JavaScript +// failed uploaded item - don't upload built-ins +{ + "value": null, + "hasError": true, + "error": { + "code": "FAILED", + "message": "ticket to seattle tomorrowtimezoneOffset=0. Error: The entity extractor builtin.number doesn't exist in the selected application" + } +} +```` + +````JavaScript +// failed uploaded item - missing intent +{ + "value": null, + "hasError": true, + "error": { + "code":"FAILED","message":"turn on the left light. Error: The intent classifier TurnOn does not exist in the selected application" + } +} +```` + +#### Examples of failed requests because of malformed items + +Batch upload items (or the whole batch) can result in parsing errors in the LUIS api. These errors are generally returned as HTTP 400 status errors instead of returning a successful response with an array of items, some of which failed. + +````JavaScript +// malformed item - entityLabels first array item is present but empty +// fix - should remove {} +{ + "row": 2, + "text": "ticket to paris", + "intentName": "BookFlight", + "entityLabels": [ + { + + } + ] +} + + +// Http Error 400 - + +```` + +````JavaScript +// malformed item - malformed JSON - no comma +// fix - add comma after every key:value pair +[ + { + "text": "Hello" + "intent": "Greetings" + }, + { + "text": "I want bread" + "intent": "Request" + } +] +```` + +````JavaScript +// malformed item - malformed JSON - extra comman at end of key:value pair +// fix - remove extra comma +[ + { + "text": "Hello", + "intent": "Greetings", + }, + { + "text": "I want bread", + "intent": "Request" + } +] +```` \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/utterances.json b/examples/demo-Upload-utterances-from-iot-lights/utterances.json new file mode 100644 index 0000000..853634a --- /dev/null +++ b/examples/demo-Upload-utterances-from-iot-lights/utterances.json @@ -0,0 +1,26 @@ +[ + { + "row": 1, + "text": "go to paris", + "intentName": "BookFlight", + "entityLabels": [ + { + "entityName": "Location::LocationTo", + "startCharIndex": 6, + "endCharIndex": 10 + } + ] + }, + { + "row": 2, + "text": "ticket to paris", + "intentName": "BookFlight", + "entityLabels": [ + { + "entityName": "Location::LocationTo", + "startCharIndex": 10, + "endCharIndex": 14 + } + ] + } +] \ No newline at end of file From b03a0b0b04b76fc68e567733311ab8f0e66aa7c9 Mon Sep 17 00:00:00 2001 From: v-geberr Date: Thu, 12 Oct 2017 09:50:53 -0700 Subject: [PATCH 3/6] cleanup --- .../demo-Upload-utterances-from-querylog/_parse.js | 2 -- .../demo-Upload-utterances-from-querylog/_upload.js | 8 +------- examples/demo-Upload-utterances-from-querylog/index.js | 10 +++++----- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/examples/demo-Upload-utterances-from-querylog/_parse.js b/examples/demo-Upload-utterances-from-querylog/_parse.js index 2c38e09..4b0ef74 100644 --- a/examples/demo-Upload-utterances-from-querylog/_parse.js +++ b/examples/demo-Upload-utterances-from-querylog/_parse.js @@ -99,8 +99,6 @@ const convert = async (config) => { // skip first line with headers if (i++ == 0) return; - //console.log(i); - // transform utterance from csv to json jsonUtterance = utterance((i - 1), line); diff --git a/examples/demo-Upload-utterances-from-querylog/_upload.js b/examples/demo-Upload-utterances-from-querylog/_upload.js index d55720c..e30ba98 100644 --- a/examples/demo-Upload-utterances-from-querylog/_upload.js +++ b/examples/demo-Upload-utterances-from-querylog/_upload.js @@ -24,7 +24,7 @@ var upload = async (config) => { success: {}, error: {} }; - //console.log("upload"); + return await getBatchFromFile(config) .then(sendBatchToApi) .then(response => { @@ -40,14 +40,9 @@ var upload = async (config) => { // get json from file - already formatted for this api var getBatchFromFile = async (config) => { try { - //console.log("getBatchFromFile"); - //console.log(config.inFile); var inFile = await fs.readFile(config.inFile, 'utf-8'); - - //console.log(inFile); config.options.body = JSON.parse(inFile); - //console.log(config.options.body); config.response.success.getBatchFromFile = true; return config; @@ -74,7 +69,6 @@ var sendBatchToApi = async (config) => { catch (err) { config.response.error.sendBatchToApi = err; console.log(JSON.stringify(err)); - //console.log("sendBatchToApi failed = " + err.response.statusCode + " " + err.response.statusMessage); return err; } } diff --git a/examples/demo-Upload-utterances-from-querylog/index.js b/examples/demo-Upload-utterances-from-querylog/index.js index c2229af..6b39c86 100644 --- a/examples/demo-Upload-utterances-from-querylog/index.js +++ b/examples/demo-Upload-utterances-from-querylog/index.js @@ -5,8 +5,8 @@ const parse = require('./_parse'); const upload = require('./_upload'); // TBD: CHANGE THESE VALUES -const LUIS_subscriptionKey = "e237d6bc86cd4562bf67b09dff44d2e6"; -const LUIS_appId = "84d6601f-a1f0-456e-a894-be5e662a5a6b"; +const LUIS_subscriptionKey = "YOUR_SUBSCRIPTION_KEY"; +const LUIS_appId = "YOUR_APP_ID"; const LUIS_versionId = "0.1"; // NOTE: final output of upload api named utterances.upload.json @@ -17,7 +17,7 @@ const uploadFile = "./utterances.json" var configDownload = { LUIS_subscriptionKey: LUIS_subscriptionKey, LUIS_appId: LUIS_appId, - outFile: path.join(__dirname, "./utterances.csv"), + outFile: path.join(__dirname, downloadFile), uri: "https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/{appId}/querylogs".replace("{appId}",LUIS_appId) }; @@ -32,8 +32,8 @@ var configUpload = { /* parse configuration */ var configParse = { - inFile: path.join(__dirname, "./utterances.csv"), - outFile: path.join(__dirname, "./utterances.json") + inFile: path.join(__dirname, downloadFile), + outFile: path.join(__dirname, uploadFile) }; var output = {}; From 704b2924760c11ce4fd68bdb5dbfa38b70bce5a3 Mon Sep 17 00:00:00 2001 From: v-geberr Date: Thu, 12 Oct 2017 11:18:42 -0700 Subject: [PATCH 4/6] iot fix --- .../_upload.js | 2 +- .../index.js | 8 ++--- .../iot-lights-utterances.json | 29 ++++++++++--------- .../utterances.json | 23 +++++++-------- .../utterances.upload.json | 16 ++++++++++ 5 files changed, 47 insertions(+), 31 deletions(-) create mode 100644 examples/demo-Upload-utterances-from-iot-lights/utterances.upload.json diff --git a/examples/demo-Upload-utterances-from-iot-lights/_upload.js b/examples/demo-Upload-utterances-from-iot-lights/_upload.js index b90b0f2..10994c2 100644 --- a/examples/demo-Upload-utterances-from-iot-lights/_upload.js +++ b/examples/demo-Upload-utterances-from-iot-lights/_upload.js @@ -43,7 +43,7 @@ var getBatchFromFile = async (config) => { var inFile = await fs.readFile(config.inFile, 'utf-8'); - config.options.body = inFile; + config.options.body = JSON.parse(inFile); config.response.success.getBatchFromFile = true; return config; diff --git a/examples/demo-Upload-utterances-from-iot-lights/index.js b/examples/demo-Upload-utterances-from-iot-lights/index.js index 2dee7b0..74367e5 100644 --- a/examples/demo-Upload-utterances-from-iot-lights/index.js +++ b/examples/demo-Upload-utterances-from-iot-lights/index.js @@ -6,7 +6,7 @@ const upload = require('./_upload'); // TBD: CHANGE THESE VALUES //const LUIS_subscriptionKey = "YOUR-SUBSCRIPTION-KEY"; const LUIS_subscriptionKey = "e237d6bc86cd4562bf67b09dff44d2e6"; -const LUIS_appId = "84d6601f-a1f0-456e-a894-be5e662a5a6b"; +const LUIS_appId = "066b2f55-20af-4ac5-8221-7536d7417d8c"; const LUIS_versionId = "0.1"; // NOTE: final output of upload api named utterances.upload.json @@ -29,7 +29,7 @@ var configParse = { }; var output = {}; - +/* parse(configParse) .then(output => { output.convert = output; @@ -38,8 +38,8 @@ parse(configParse) output.upload = output; console.log("process done"); }); - +*/ // single step - uncomment 1 line only //parse(configParse); -//upload(configUpload) \ No newline at end of file +upload(configUpload) \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/iot-lights-utterances.json b/examples/demo-Upload-utterances-from-iot-lights/iot-lights-utterances.json index 444129e..6082caf 100644 --- a/examples/demo-Upload-utterances-from-iot-lights/iot-lights-utterances.json +++ b/examples/demo-Upload-utterances-from-iot-lights/iot-lights-utterances.json @@ -1,23 +1,24 @@ { "utterances": [ { - "text": "turn the lights off", - "intent": "TurnAllOff", - "entities": [] + "text": "turn off staircase", + "intentName": "HomeAutomation.TurnOff", + "entityLabels": [ + { + "entityName": "HomeAutomation.Operation", + "startCharIndex": 5, + "endCharIndex": 7 + } + ] }, { - "text": "turn on floor lamp in green", - "intent": "TurnOn", - "entities": [ + "text": "turn on venice lamp", + "intentName": "HomeAutomation.TurnOn", + "entityLabels": [ { - "entity": "Light", - "startPos": 8, - "endPos": 12 - }, - { - "entity": "Color", - "startPos": 22, - "endPos": 26 + "entityName": "HomeAutomation.Operation", + "startCharIndex": 5, + "endCharIndex": 6 } ] } diff --git a/examples/demo-Upload-utterances-from-iot-lights/utterances.json b/examples/demo-Upload-utterances-from-iot-lights/utterances.json index 853634a..e79649f 100644 --- a/examples/demo-Upload-utterances-from-iot-lights/utterances.json +++ b/examples/demo-Upload-utterances-from-iot-lights/utterances.json @@ -1,25 +1,24 @@ [ { - "row": 1, - "text": "go to paris", - "intentName": "BookFlight", + + "text": "turn off staircase", + "intentName": "HomeAutomation.TurnOff", "entityLabels": [ { - "entityName": "Location::LocationTo", - "startCharIndex": 6, - "endCharIndex": 10 + "entityName": "HomeAutomation.Operation", + "startCharIndex": 5, + "endCharIndex": 7 } ] }, { - "row": 2, - "text": "ticket to paris", - "intentName": "BookFlight", + "text": "turn on venice lamp", + "intentName": "HomeAutomation.TurnOn", "entityLabels": [ { - "entityName": "Location::LocationTo", - "startCharIndex": 10, - "endCharIndex": 14 + "entityName": "HomeAutomation.Operation", + "startCharIndex": 5, + "endCharIndex": 6 } ] } diff --git a/examples/demo-Upload-utterances-from-iot-lights/utterances.upload.json b/examples/demo-Upload-utterances-from-iot-lights/utterances.upload.json new file mode 100644 index 0000000..7412f92 --- /dev/null +++ b/examples/demo-Upload-utterances-from-iot-lights/utterances.upload.json @@ -0,0 +1,16 @@ +[ + { + "value": { + "UtteranceText": "turn off staircase", + "ExampleId": -8225602 + }, + "hasError": false + }, + { + "value": { + "UtteranceText": "turn on venice lamp", + "ExampleId": -10996914 + }, + "hasError": false + } +] \ No newline at end of file From f3410fc13f489a9e16d2d7476f9d5518f90ac1fd Mon Sep 17 00:00:00 2001 From: v-geberr Date: Thu, 12 Oct 2017 11:57:30 -0700 Subject: [PATCH 5/6] submit for review --- examples/README.md | 6 +- .../_parse.js | 8 +- .../error1.json | 24 - .../error2.json | 31 -- .../index.js | 11 +- .../iot-lights-utterances.json | 26 - .../media/export-app-data.png | Bin 15830 -> 0 bytes .../note.json | 46 -- .../package-lock.json | 461 ------------------ .../package.json | 5 +- .../readme.md | 43 +- .../utterances.json | 25 - .../utterances.upload.json | 16 - 13 files changed, 40 insertions(+), 662 deletions(-) delete mode 100644 examples/demo-Upload-utterances-from-iot-lights/error1.json delete mode 100644 examples/demo-Upload-utterances-from-iot-lights/error2.json delete mode 100644 examples/demo-Upload-utterances-from-iot-lights/iot-lights-utterances.json delete mode 100644 examples/demo-Upload-utterances-from-iot-lights/media/export-app-data.png delete mode 100644 examples/demo-Upload-utterances-from-iot-lights/note.json delete mode 100644 examples/demo-Upload-utterances-from-iot-lights/package-lock.json delete mode 100644 examples/demo-Upload-utterances-from-iot-lights/utterances.json delete mode 100644 examples/demo-Upload-utterances-from-iot-lights/utterances.upload.json diff --git a/examples/README.md b/examples/README.md index 815b087..f8d6860 100644 --- a/examples/README.md +++ b/examples/README.md @@ -10,6 +10,10 @@ These samples provide LUIS apps to demonstrate scenarios. You can import the LUI [PhraseListDoc]: https://docs.microsoft.com/en-us/azure/cognitive-services/LUIS/add-features#phrase-list-features [LUIS]: https://www.luis.ai -* [Batch Upload Utterances Example][BatchUpload]: The batch upload utterances example demonstrates how to download the LUIS query log, parse the log into a batch of utterances, then upload the batch back to LUIS for testing and training purposes. +* [Batch Upload Utterances Example][BatchUpload]: The batch upload utterances example demonstrates how to download the LUIS query log, parse the log into a batch of utterances, then upload the batch back to LUIS for testing and training purposes. You must provide a LUIS subscription key and LUIS application id. [BatchUpload]: ./demo-Upload-utterances-from-querylog/readme.md + +* [Batch Upload IOT Lights Example][BatchIOTUpload]: The batch upload utterances example demonstrates how to use queries from other tools, parse the log into a batch of utterances, then upload the batch back to LUIS for testing and training purposes. You must provide a LUIS subscription key and LUIS application id. + + [BatchIOTUpload]: ./demo-Upload-utterances-from-iot-lights/readme.md diff --git a/examples/demo-Upload-utterances-from-iot-lights/_parse.js b/examples/demo-Upload-utterances-from-iot-lights/_parse.js index 05151e5..f0b4e31 100644 --- a/examples/demo-Upload-utterances-from-iot-lights/_parse.js +++ b/examples/demo-Upload-utterances-from-iot-lights/_parse.js @@ -62,17 +62,17 @@ const convert = async (config) => { var i = 0; - // get inFile stream - inFileJSON = require(config.inFile); + // get inFile json + inFileJSON = await fse.readFile(config.inFile, 'utf-8'); // create out file var myOutFile = await fse.createWriteStream(config.outFile, 'utf-8'); myOutFile.write('['); - // read 1 line + // read 1 utterance inFileJSON.utterances.forEach( (item) => { - // transform utterance from csv to json + // transform utterance from original json to LUIS batch json jsonUtterance = utterance(++i, item); // write to out stream diff --git a/examples/demo-Upload-utterances-from-iot-lights/error1.json b/examples/demo-Upload-utterances-from-iot-lights/error1.json deleted file mode 100644 index 6f13fde..0000000 --- a/examples/demo-Upload-utterances-from-iot-lights/error1.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "StatusCodeError", - "statusCode": 401, - "message": "401 - {\"error\":{\"code\":\"Unauthorized\",\"message\":\"User does not own this application\"}}", - "error": {"er - ror":{"code":"Unauthorized","message":"User does not own this application"}},"options":{"uri":"https: //westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/60340f5 - f-99c1-4043-8ab9-c810ff16252d/versions/0.1/examples","method":"POST","headers":{"Ocp-Apim-Subscription-Key":"e237d6bc86cd4562bf67b09dff44d2e6"},"json":true,"simple": true, - "resolveWithFullResponse": false, - "transform2xxOnly": false - }, - "response": { - "statusCode": 401, - "body": { - "error": { - "code": "Unauthorized", - "message":"User does not own thi - s application"}},"headers":{"cache-control":"private","content-length":"105","content-type":"application/json; charset=utf-8","x-content-type-options":"nosniff","x- - frame-options":"SAMEORIGIN","x-powered-by":"ASP.NET","apim-request-id":"488339d1-8c12-4529-a9a1-a5516a3aea10","strict-transport-security":"max-age=31536000; include - SubDomains; preload","date":"Thu, - 12 Oct2017 16: 26: 58 GMT","connection":"close"},"request":{"uri":{"protocol":"https: ","slashes":true,"auth":null,"host":"westus.ap - i.cognitive.microsoft.com","port":443,"hostname":"westus.api.cognitive.microsoft.com","hash":null,"search":null,"query":null,"pathname":"/luis/api/v2.0/apps/60340f5 - f-99c1-4043-8ab9-c810ff16252d/versions/0.1/examples","path":"/luis/api/v2.0/apps/60340f5f-99c1-4043-8ab9-c810ff16252d/versions/0.1/examples","href":"https: //westus. - api.cognitive.microsoft.com/luis/api/v2.0/apps/60340f5f-99c1-4043-8ab9-c810ff16252d/versions/0.1/examples"},"method":"POST","headers":{"Ocp-Apim-Subscription-Key":" - e237d6bc86cd4562bf67b09dff44d2e6","accept":"application/json","content-length":0}}}} \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/error2.json b/examples/demo-Upload-utterances-from-iot-lights/error2.json deleted file mode 100644 index 1a8c344..0000000 --- a/examples/demo-Upload-utterances-from-iot-lights/error2.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "StatusCodeError", - "statusCode": 400, - "message":"400 - {\"error\":{\"code\":\"BadArgument\",\"message\":\"Failed to parse example labeling objects. Parameter n - ame: exampleLabelObjects\"}}", - "error": { - "error": { - "code": "BadArgument", - "message": "Failed to parse example labeling objects. Parameter name: exampleLabelObjects" - } - },"op - tions":{"uri":"https: //westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/84d6601f-a1f0-456e-a894-be5e662a5a6b/versions/0.1/examples","method":"POST","headers":{ "Ocp-Apim-Subscription-Key": "e237d6bc86cd4562bf67b09dff44d2e6" -}, -"json": true, -"simple": true, -"resolveWithFullResponse": false, -"transform2xxOnly": false -}, -"response": {"sta - tusCode":400,"body":{"error":{"code":"BadArgument","message":"Failed to parse example labeling objects. Parameter name: exampleLabelObjects"}},"headers":{"cache-con - trol":"private","content-length":"147","content-type":"application/json; charset=utf-8","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-powered - -by":"ASP.NET","apim-request-id":"d2dc2163-03a7-403e-9ab5-0a37b97a9356","strict-transport-security":"max-age=31536000; includeSubDomains; preload","date":"Thu, -12 O - ct2017 16: 30: 30 GMT","connection":"close"},"request":{"uri":{"protocol":"https: ","slashes":true,"auth":null,"host":"westus.api.cognitive.microsoft.com","port":443, - "hostname": "westus.api.cognitive.microsoft.com", -"hash": null, -"search": null, -"query": null, -"pathname":"/luis/api/v2.0/apps/84d6601f-a1f0-456e-a894-be5e662a5a6b/versions - /0.1/examples","path":"/luis/api/v2.0/apps/84d6601f-a1f0-456e-a894-be5e662a5a6b/versions/0.1/examples","href":"https: //westus.api.cognitive.microsoft.com/luis/api/v 2.0/apps/84d6601f-a1f0-456e-a894-be5e662a5a6b/versions/0.1/examples"},"method":"POST","headers":{"Ocp-Apim-Subscription-Key":"e237d6bc86cd4562bf67b09dff44d2e6","acc - ept":"application/json","content-length":0}}}} \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/index.js b/examples/demo-Upload-utterances-from-iot-lights/index.js index 74367e5..f5f1284 100644 --- a/examples/demo-Upload-utterances-from-iot-lights/index.js +++ b/examples/demo-Upload-utterances-from-iot-lights/index.js @@ -4,9 +4,9 @@ const parse = require('./_parse'); const upload = require('./_upload'); // TBD: CHANGE THESE VALUES -//const LUIS_subscriptionKey = "YOUR-SUBSCRIPTION-KEY"; -const LUIS_subscriptionKey = "e237d6bc86cd4562bf67b09dff44d2e6"; -const LUIS_appId = "066b2f55-20af-4ac5-8221-7536d7417d8c"; +const LUIS_subscriptionKey = "YOUR_SUBSCRIPTION_KEY"; +const LUIS_appId = "YOUR_APP_ID"; + const LUIS_versionId = "0.1"; // NOTE: final output of upload api named utterances.upload.json @@ -29,7 +29,7 @@ var configParse = { }; var output = {}; -/* + parse(configParse) .then(output => { output.convert = output; @@ -38,8 +38,7 @@ parse(configParse) output.upload = output; console.log("process done"); }); -*/ // single step - uncomment 1 line only //parse(configParse); -upload(configUpload) \ No newline at end of file +//upload(configUpload) \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/iot-lights-utterances.json b/examples/demo-Upload-utterances-from-iot-lights/iot-lights-utterances.json deleted file mode 100644 index 6082caf..0000000 --- a/examples/demo-Upload-utterances-from-iot-lights/iot-lights-utterances.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "utterances": [ - { - "text": "turn off staircase", - "intentName": "HomeAutomation.TurnOff", - "entityLabels": [ - { - "entityName": "HomeAutomation.Operation", - "startCharIndex": 5, - "endCharIndex": 7 - } - ] - }, - { - "text": "turn on venice lamp", - "intentName": "HomeAutomation.TurnOn", - "entityLabels": [ - { - "entityName": "HomeAutomation.Operation", - "startCharIndex": 5, - "endCharIndex": 6 - } - ] - } - ] -} \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/media/export-app-data.png b/examples/demo-Upload-utterances-from-iot-lights/media/export-app-data.png deleted file mode 100644 index 0c817740ff6194e5aa94fcbe9a3bccbe53f8e97e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15830 zcmdtJXH-*N*EWi`w_?XzQKa7%K)L||sj&gll`0U30wGc(gchn56-1B(2wkN~mrkg* z5Fmkw2r&kN0tqG5gc?XV8=v!>@BPj>;~n37p64Co8|MdOv)9J=9w|4>ed+%OzL<$HT3EKYKLHCpn6A;k%F}ZrlHq3Q)81Wo35Vf_4s<&ErXgY&F z41QXsP;&V44OcqtsYRI0gt1NSV>$u5=SZXWRbe!l-S=FC%B%$}!38sHn& z2TT&4tsl*Nckjx%L&9#yzGe?oT`ITcf3U(O-I5c&tcLdDR(rFMb2tt>bdEGkT{Yu& z=4@=yMahv&Zm+osV4}d1BwhlzoE3=E1}@hHgaLyEUJ0B9Mk;V|$92*U0fBpeyu$7T zZg*V-2?CdWe^cBHoK#GTZIkP0LPR&cGQa(K)>4C<#A^k|g;*(%qpC0Yg?deTqC!qe zZM$mxtsFj5e%I>fyxchE>=lp}OG+&H_1B~!b9LZ-7lp>5q?n1&@le|jQd9XZs!}f_ zDipdF7Vb*Nt?LHnI)zTfR%5_r{LOE9fv2Rl4H+*Ggp;&7V-HS~f9Wy?G%MkbVJn`Z z3I~ZD3AwXTpqL2*oN4RJ@9z+oc*`YiSyezc@2C48y1AxC72Xl*I@nCpUWK5$pJvRL zY>ZR8uO-GWzG(@cxI6YW)5*}t)}(#9E%Z$v(9=cBaBGq=ns~*Q>Teey0&TU49rJ1S zi3UN#?ER$_y1w*~O=}d}(du)d^$~FfRTmUst()vSo3{s!vL}n2a%T}UMNXe*SnNrW zN_6n2E8bYKHs(GYv!k*LX)|wlRCiS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%&oUZJX7x;&% z32yY5`=cUCRbA(!FX@L3Dc0R*Pai|VQOke$7|GvwX)(8uzo}C&;QO#H!Tv+=gpY50 zjaB-_&kE;}3J+mqjow6~A!o3mrp>~UbKWsc`R z^IYU)mJH9vt7@3C0$X`Qwen2H!}7KbhW>z}EvOyt)V4LU_zISXUCo7V{=v{`${S@5 zm7U$qv^d6Td?y?FwhhS>tkF+|zB|}@kbbTxOngvNv3HFWb$24*JL~+$VQjB!MMG{Z zGBTr#I5-ow^F*XY9O{{mKrVc-GKGnisLDNtg@&x@$za z%|C!l7gW!dn!rTjUE#NQv8`LodDq32SXc#-IRX~27wN^i4|Jbp#Eax7JIHI%)7-&1 zslm>&;~h_4bPu}d5Eu*_6R!byFZ!1;2RIzIN1C6HU3~`KtTrtoW6WKY%DraY#LTim zp*N)iNx&A&#K$Wi?zG%~3tpHB<`R@{&$q8faNMN!mJw6yR0K-@q+s2Hox*OL#(wi* zHbnbJu}tO)h61N3YCMi3b!${KMO(Bz2{RbVPzH(-Wt-#~w?niy&G$z{AWhOYNX;6i(KK;sU3uqv2L>8!TiMsD#K^%{sRv#(OdH%;MDBXs5F?)0wIAO?iL)c^ zl%Xg;oZeBb-sA#kQu^25)U^78LZz>j$Dz(Ah6o`@Jz)JF`*Il`tp z0T1nN%RXAo9L!_)hb09}z7^9vxwT4YC;bY$ir>5#zsu(LIkIPuMG9fVlp+s8jt%>V zZrZpTSRBV_HA6u^enqsuObbmQCPj^&OM0#QVs~4eC$NfueV_l=3E+RHkpI7S=J>zd fW0V|wYsVF`U;Cvd!wkT50TV;Zs}+}TJ@`KWOK_pX diff --git a/examples/demo-Upload-utterances-from-iot-lights/note.json b/examples/demo-Upload-utterances-from-iot-lights/note.json deleted file mode 100644 index 77de535..0000000 --- a/examples/demo-Upload-utterances-from-iot-lights/note.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "StatusCodeError", - "statusCode": 400, - "message":"400 - {\"error\":{\"code\":\"BadArgument\",\"message\":\"Failed to parse example labeling objects. Paramet - er name: exampleLabelObjects\"}}", - "error": { - "error": { - "code": "BadArgument","messag - e":"Failed to parse example labeling objects. Parameter name: exampleLabelObject - s"}},"options":{"uri":"https: //westus.api.cognitive.microsoft.com/luis/api/v2.0/ - apps/84d6601f-a1f0-456e-a894-be5e662a5a6b/versions/0.1/examples","method":"POST", - "headers": { - "Ocp-Apim-Subscription-Key": "e237d6bc86cd4562bf67b09dff44d2e6" - },"jso - n":true,"simple":true,"resolveWithFullResponse":false,"transform2xxOnly":false}, - "response": { - "statusCode": 400, - "body": { - "error": { - "code": "BadArgument", - "message":"Fa - iled to parse example labeling objects. Parameter name: exampleLabelObjects"}}," - headers":{"cache-control":"private","content-length":"147","content-type":"appli - cation/json; charset=utf-8","x-content-type-options":"nosniff","x-frame-options": "SAMEORIGIN", - "x-powered-by": "ASP.NET", - "apim-request-id":"7f81b045-cf25-4071-a02 - 2-371c9af89fa9","strict-transport-security":"max-age=31536000; includeSubDomains - ; preload","date":"Wed, - 11 Oct2017 15: 33: 04 GMT","connection":"close"},"request":{"uri":{"protocol":"https: ","slashes":true,"auth":null,"host":"westus.api.cogn - itive.microsoft.com","port":443,"hostname":"westus.api.cognitive.microsoft.com", - "hash": null, - "search": null, - "query": null, - "pathname":"/luis/api/v2.0/apps/84d6601f- - a1f0-456e-a894-be5e662a5a6b/versions/0.1/examples","path":"/luis/api/v2.0/apps/84d6601f-a1f0-456e-a894-be5e662a5a6b/versions/0.1/examples","href":"https: //westu - s.api.cognitive.microsoft.com/luis/api/v2.0/apps/84d6601f-a1f0-456e-a894-be5e662 - a5a6b/versions/0.1/examples"},"method":"POST","headers":{"Ocp-Apim-Subscription- - Key":"e237d6bc86cd4562bf67b09dff44d2e6","accept":"application/json","content-len - gth":0}}}} - - { - "row": 1, - "text": "go to paris", - "intentName": "BookFlight" - }, - \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/package-lock.json b/examples/demo-Upload-utterances-from-iot-lights/package-lock.json deleted file mode 100644 index 0c72ae6..0000000 --- a/examples/demo-Upload-utterances-from-iot-lights/package-lock.json +++ /dev/null @@ -1,461 +0,0 @@ -{ - "name": "demo-Upload-utterances-from-querylog", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "ajv": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.2.3.tgz", - "integrity": "sha1-wG9Zh3jETGsWGrr+NGa4GtGBTtI=", - "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.0.0", - "json-schema-traverse": "0.3.1", - "json-stable-stringify": "1.0.1" - } - }, - "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" - }, - "babyparse": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/babyparse/-/babyparse-0.4.6.tgz", - "integrity": "sha1-j/KbYtHmAMBlSv1jRX+X+iw26cE=" - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "bluebird": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", - "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" - }, - "boom": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", - "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", - "requires": { - "hoek": "4.2.0" - } - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" - }, - "combined-stream": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", - "requires": { - "delayed-stream": "1.0.0" - } - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "cryptiles": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", - "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", - "requires": { - "boom": "5.2.0" - }, - "dependencies": { - "boom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", - "requires": { - "hoek": "4.2.0" - } - } - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "1.0.0" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-deep-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", - "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=" - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.1.tgz", - "integrity": "sha1-b7lPvXGIUwbXPRXMSX/kzE7NRL8=", - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.17" - } - }, - "fs-extra": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.2.tgz", - "integrity": "sha1-+RcExT0bRh+JNFKwwwfZmXZHq2s=", - "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "4.0.0", - "universalify": "0.1.1" - } - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", - "requires": { - "ajv": "5.2.3", - "har-schema": "2.0.0" - } - }, - "hawk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", - "requires": { - "boom": "4.3.1", - "cryptiles": "3.1.2", - "hoek": "4.2.0", - "sntp": "2.0.2" - } - }, - "hoek": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", - "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==" - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.13.1" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" - }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "requires": { - "jsonify": "0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "requires": { - "graceful-fs": "4.1.11" - } - }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "line-reader": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/line-reader/-/line-reader-0.4.0.tgz", - "integrity": "sha1-F+RIGNoKwzVnW6MAlU+U72cOZv0=" - }, - "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" - }, - "mime-db": { - "version": "1.30.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", - "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" - }, - "mime-types": { - "version": "2.1.17", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", - "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", - "requires": { - "mime-db": "1.30.0" - } - }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - }, - "qs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" - }, - "request": { - "version": "2.83.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", - "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", - "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.3.1", - "har-validator": "5.0.3", - "hawk": "6.0.2", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.17", - "oauth-sign": "0.8.2", - "performance-now": "2.1.0", - "qs": "6.5.1", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.3", - "tunnel-agent": "0.6.0", - "uuid": "3.1.0" - } - }, - "request-promise": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.2.tgz", - "integrity": "sha1-0epG1lSm7k+O5qT+oQGMIpEZBLQ=", - "requires": { - "bluebird": "3.5.1", - "request-promise-core": "1.1.1", - "stealthy-require": "1.1.1", - "tough-cookie": "2.3.3" - } - }, - "request-promise-core": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", - "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", - "requires": { - "lodash": "4.17.4" - } - }, - "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" - }, - "sntp": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.0.2.tgz", - "integrity": "sha1-UGQRDwr4X3z9t9a2ekACjOUrSys=", - "requires": { - "hoek": "4.2.0" - } - }, - "sshpk": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", - "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - } - }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" - }, - "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" - }, - "tough-cookie": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", - "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", - "requires": { - "punycode": "1.4.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "5.1.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "optional": true - }, - "universalify": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", - "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=" - }, - "uuid": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "1.3.0" - } - } - } -} diff --git a/examples/demo-Upload-utterances-from-iot-lights/package.json b/examples/demo-Upload-utterances-from-iot-lights/package.json index 063a339..db833c7 100644 --- a/examples/demo-Upload-utterances-from-iot-lights/package.json +++ b/examples/demo-Upload-utterances-from-iot-lights/package.json @@ -1,7 +1,7 @@ { - "name": "demo-Upload-utterances-from-querylog", + "name": "demo-Upload-utterances-from-iot-lights", "version": "1.0.0", - "description": "Use Microsoft LUIS api to upload utterance examples from query log.", + "description": "Use Microsoft LUIS api to upload utterance examples from IOT Lights.", "main": "index.js", "scripts": { "start": "node index.js" @@ -9,7 +9,6 @@ "author": "v-geberr", "license": "ISC", "dependencies": { - "babyparse": "^0.4.6", "bluebird": "^3.5.1", "fs-extra": "^4.0.2", "line-reader": "^0.4.0", diff --git a/examples/demo-Upload-utterances-from-iot-lights/readme.md b/examples/demo-Upload-utterances-from-iot-lights/readme.md index 55280ac..b9e6d55 100644 --- a/examples/demo-Upload-utterances-from-iot-lights/readme.md +++ b/examples/demo-Upload-utterances-from-iot-lights/readme.md @@ -1,16 +1,18 @@ -# Upload utterances from query log +# Upload utterances from IOT Lights -A sample nodeJs application to read a [LUIS](https://www.luis.ai) application's [query logs](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c36), parse labels, and [upload as a batch](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c09) . +A sample nodeJs application to use queries from a hypothetical IOT application. This application parses the IOT queries into the acceptable LUIS query format, and [uploads as a batch](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c09). -The application main file is the [index.js]('./index.js). This file contains the configuration settings and calls into the three files: +The application main file is the [index.js]('./index.js). This file contains the configuration settings and calls into the three files: -- [_download.js](./_download.js) : download LUIS query logs - [_parse.js](./_parse.js) : convert csv from query logs into json for upload - [_upload.js](./_upload) : upload json to batch label api +The application assumes the IOT queries are in a JSON file format. An example is found at: + +- [./example-files/iot-lights-utterances.json](./example-files/iot-lights-utterances.json) : convert json from IOT logs into json for upload + The application will create files associated with each step: -- [utterances.csv](./example-files/utterances.csv) : query logs - [utterances.json](./example-files/utterances.json) : batch labels - [utterances.upload.json](./example-files/utterances.upload.json) : final response body from upload api @@ -23,26 +25,25 @@ The minimum prerequisites to run this sample are: * **[Recommended]** Visual Studio Code for IntelliSense and debugging, download it from [here](https://code.visualstudio.com/) for free. ### Install -Install the nodeJS dependencies from NPM in the terminal/command line. +Install the Node.js dependencies from NPM in the terminal/command line. ```` > npm install ```` ### Change Configuration Settings -In order to use this application, you need to change the values in the index.js file to your own subscription key, app id, and version id. +In order to use this application, you need to change the values in the index.js file to your own subscription key, app ID, and version ID. Open the index.js file, and change these values at the top of the file. - ````JavaScript // TBD: CHANGE THESE VALUES -const LUIS_subscriptionKey = ""; -const LUIS_appId = ""; -const LUIS_versionId = ""; +const LUIS_subscriptionKey = "YOUR_SUBSCRIPTION_KEY"; +const LUIS_appId = "YOUR_APP_ID"; +const LUIS_versionId = "0.1"; ```` ### Run the application -Run the application from a terminal/command line with nodeJs. +Run the application from a terminal/command line with Node.js. ```` > node index.js @@ -59,17 +60,21 @@ process done ```` ### LUIS Apis used in this sample -This sample uses the [download query log](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c36) api as well as the [batch add labels](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c09) api. +This sample uses the [batch add labels](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c09) api. ### Format of the JSON for the batch upload -The format of the JSON for the batch upload is noted in the [batch add labels](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c09) api. It is important to not that the format of the download for query logs is different both in content and format. +The format of the JSON for the batch upload is noted in the [batch add labels](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c09) api. -If you export your application data from [luis.ai applications list](https://www.luis.ai/applications) with the **Export app data to JSON file**, you will need to change the JSON format to match the stated format for the batch upload. +### Use your own private apps +If you incorrectly use an app ID that you do not have permission to upload to, such as any public apps, you will recieve an error. + +### Intent And Entities are not created if NOT found +Any intent or entity uploaded that is not found in your LUIS app will cause an error. It is important that all intents and entities used in the batch already exist in the app. ### Errors in output file of the application -The final response body from upload api is in the 'utterances.upload.json' file. This file will be an array of responses, one response for each item in the batch. +The final response body from upload api is in the 'utterances.upload.json' file. This file will be an array of responses, one response for each item in the batch. -Each item in the batch can succeed or fail independent of any other item, so it is important to check the response. +Each item in the batch can succeed or fail independent of any other item, so it is important to check the response. #### Examples of correctly formatted items: @@ -127,9 +132,9 @@ Each item in the batch can succeed or fail independent of any other item, so it } ```` -#### Examples of failed requests because of malformed items +#### Examples of failed requests because of malformed items -Batch upload items (or the whole batch) can result in parsing errors in the LUIS api. These errors are generally returned as HTTP 400 status errors instead of returning a successful response with an array of items, some of which failed. +Batch upload items (or the whole batch) can result in parsing errors in the LUIS api. These errors are generally returned as HTTP 400 status errors instead of returning a successful response with an array of items, some of which failed. ````JavaScript // malformed item - entityLabels first array item is present but empty diff --git a/examples/demo-Upload-utterances-from-iot-lights/utterances.json b/examples/demo-Upload-utterances-from-iot-lights/utterances.json deleted file mode 100644 index e79649f..0000000 --- a/examples/demo-Upload-utterances-from-iot-lights/utterances.json +++ /dev/null @@ -1,25 +0,0 @@ -[ - { - - "text": "turn off staircase", - "intentName": "HomeAutomation.TurnOff", - "entityLabels": [ - { - "entityName": "HomeAutomation.Operation", - "startCharIndex": 5, - "endCharIndex": 7 - } - ] - }, - { - "text": "turn on venice lamp", - "intentName": "HomeAutomation.TurnOn", - "entityLabels": [ - { - "entityName": "HomeAutomation.Operation", - "startCharIndex": 5, - "endCharIndex": 6 - } - ] - } -] \ No newline at end of file diff --git a/examples/demo-Upload-utterances-from-iot-lights/utterances.upload.json b/examples/demo-Upload-utterances-from-iot-lights/utterances.upload.json deleted file mode 100644 index 7412f92..0000000 --- a/examples/demo-Upload-utterances-from-iot-lights/utterances.upload.json +++ /dev/null @@ -1,16 +0,0 @@ -[ - { - "value": { - "UtteranceText": "turn off staircase", - "ExampleId": -8225602 - }, - "hasError": false - }, - { - "value": { - "UtteranceText": "turn on venice lamp", - "ExampleId": -10996914 - }, - "hasError": false - } -] \ No newline at end of file From f6cf1ca8861544f9616bcc9881b78967df8ac8a4 Mon Sep 17 00:00:00 2001 From: v-geberr Date: Thu, 12 Oct 2017 12:04:40 -0700 Subject: [PATCH 6/6] add intent/entity must exist, fix ID and Node.js --- .../demo-Upload-utterances-from-querylog/readme.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/demo-Upload-utterances-from-querylog/readme.md b/examples/demo-Upload-utterances-from-querylog/readme.md index 55280ac..a814a6c 100644 --- a/examples/demo-Upload-utterances-from-querylog/readme.md +++ b/examples/demo-Upload-utterances-from-querylog/readme.md @@ -23,14 +23,14 @@ The minimum prerequisites to run this sample are: * **[Recommended]** Visual Studio Code for IntelliSense and debugging, download it from [here](https://code.visualstudio.com/) for free. ### Install -Install the nodeJS dependencies from NPM in the terminal/command line. +Install the Node.js dependencies from NPM in the terminal/command line. ```` > npm install ```` ### Change Configuration Settings -In order to use this application, you need to change the values in the index.js file to your own subscription key, app id, and version id. +In order to use this application, you need to change the values in the index.js file to your own subscription key, app ID, and version ID. Open the index.js file, and change these values at the top of the file. @@ -42,7 +42,7 @@ const LUIS_appId = ""; const LUIS_versionId = ""; ```` ### Run the application -Run the application from a terminal/command line with nodeJs. +Run the application from a terminal/command line with Node.js. ```` > node index.js @@ -66,6 +66,12 @@ The format of the JSON for the batch upload is noted in the [batch add labels](h If you export your application data from [luis.ai applications list](https://www.luis.ai/applications) with the **Export app data to JSON file**, you will need to change the JSON format to match the stated format for the batch upload. +### Use your own private apps +If you incorrectly use an app ID that you do not have permission to upload to, such as any public apps, you will recieve an error. + +### Intent And Entities are not created if NOT found +Any intent or entity uploaded that is not found in your LUIS app will cause an error. It is important that all intents and entities used in the batch already exist in the app. + ### Errors in output file of the application The final response body from upload api is in the 'utterances.upload.json' file. This file will be an array of responses, one response for each item in the batch.