Skip to content

Commit

Permalink
added logging
Browse files Browse the repository at this point in the history
fixed issue with sentiment analysis
  • Loading branch information
tbass134 committed Oct 26, 2017
1 parent 8f33a21 commit 638b8a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
11 changes: 2 additions & 9 deletions WS-node/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// 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",
Expand All @@ -8,14 +8,7 @@
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/app.js",
"cwd": "${workspaceRoot}"
},
{
"type": "node",
"request": "attach",
"name": "Attach to Process",
"port": 5858
"program": "${workspaceFolder}/app.js"
}
]
}
14 changes: 7 additions & 7 deletions WS-node/lib/asrClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,20 @@ function AsrClient () {
})

socket.on('sentiment estimate', (msg) => {
//console.log('sentiment: ', msg)
let x = JSON.parse(msg)
let x = JSON.parse(msg)[0]
console.log('sentiment: ', x)
self.emit('sentiment', x)
})

socket.on('basic keywords event', (msg) => {
//console.log('kw: ', msg)
let x = JSON.parse(msg)
console.log('basic keywords event: ', x)
self.emit('keywords', x)
})

socket.on('nlp event', (msg) => {
//console.log('nlp: ', msg)
let x = JSON.parse(msg)
console.log('nlp: ', x)
self.emit('nlp', x)
})
''
Expand Down Expand Up @@ -131,12 +131,12 @@ function AsrClient () {
var object = new Object()
object.item = item.p
object.time = (tsinceEngineStarted -item.s)/1000.0
console.log("item", item);
// console.log("item", item);





console.log("latency", object);
self.emit('latency',object)

self.transcript.push(item)
Expand All @@ -148,7 +148,7 @@ function AsrClient () {
var text = ''
self.transcript.forEach((item, index, array) => {
text = text + ' ' + item.w
console.log("item.w " + item.w);
// console.log("item.w " + item.w);
if (item.w == "action" || item.w == "actions" ) {
newIndex = index
}
Expand Down

0 comments on commit 638b8a9

Please sign in to comment.