diff --git a/core/data/en/resolvers/affirmation_denial.json b/core/data/en/resolvers/affirmation_denial.json index 9a7203c37..ea8d89c1b 100644 --- a/core/data/en/resolvers/affirmation_denial.json +++ b/core/data/en/resolvers/affirmation_denial.json @@ -21,8 +21,7 @@ "That's right", "That works", "Go ahead", - "Why not", - "I do" + "Why not" ], "value": true }, diff --git a/scripts/train.js b/scripts/train.js index 49c9e054b..2b86a7033 100644 --- a/scripts/train.js +++ b/scripts/train.js @@ -64,6 +64,8 @@ export default () => new Promise(async (resolve, reject) => { const intentName = intentKeys[j] const intentObj = resolverIntents[intentName] + nlp.assignDomain(lang, intentName, 'system') + for (let k = 0; k < intentObj.utterance_samples.length; k += 1) { nlp.addDocument(lang, intentObj.utterance_samples[k], intentName) } diff --git a/server/src/core/brain.js b/server/src/core/brain.js index 929302252..73368957d 100644 --- a/server/src/core/brain.js +++ b/server/src/core/brain.js @@ -165,6 +165,10 @@ class Brain { const nextAction = action.next_action ? actions[action.next_action] : null if (actionType === 'logic') { + /** + * "Logic" action skill execution + */ + // Ensure the process is empty (to be able to execute other processes outside of Brain) if (Object.keys(this.process).length === 0) { /** @@ -335,6 +339,10 @@ class Brain { // Reset the child process this.process = { } } else { + /** + * "Dialog" action skill execution + */ + const nluFilePath = path.join( process.cwd(), 'skills', obj.classification.domain, obj.classification.skill, 'nlu', `${this._lang}.json` ) @@ -369,9 +377,9 @@ class Brain { */ if (utteranceHasEntities && answer.indexOf('{{') !== -1) { obj.entities.forEach((entityObj) => { - answer = string.pnr(answer, { [`{{ ${entityObj.entity} }}`]: entityObj.option }) + answer = string.pnr(answer, { [`{{ ${entityObj.entity} }}`]: entityObj.resolution.value }) - // Find matches and map deeper data from the NLU file + // Find matches and map deeper data from the NLU file (global/custom entities) const matches = answer.match(/{{.+?}}/g) matches?.forEach((match) => { diff --git a/skills/leon/introduction/nlu/en.json b/skills/leon/introduction/nlu/en.json index 8834671ff..141a8b24c 100644 --- a/skills/leon/introduction/nlu/en.json +++ b/skills/leon/introduction/nlu/en.json @@ -28,7 +28,7 @@ "name": "date" }, "questions": [ - "What's your birth date?" + "What's your birth date {{ person }}?" ] } ], diff --git a/skills/leon/partner_assistant/nlu/en.json b/skills/leon/partner_assistant/nlu/en.json index fa16abee7..6349a7020 100644 --- a/skills/leon/partner_assistant/nlu/en.json +++ b/skills/leon/partner_assistant/nlu/en.json @@ -22,7 +22,7 @@ "partner_assistant": { "options": { "Alexa": { - "synonyms": ["alexa"], + "synonyms": ["Alexa"], "data": { "thought": [ "Alexa is very kind and Amazon is teaching it many things. It was born in November 2014.", @@ -31,7 +31,7 @@ } }, "Cortana": { - "synonyms": ["cortana"], + "synonyms": ["Cortana"], "data": { "thought": [ "Cortana is thoughtful and Microsoft is improving her day after day. She was born in April 2014.", @@ -40,7 +40,7 @@ } }, "Siri": { - "synonyms": ["siri"], + "synonyms": ["Siri"], "data": { "thought": [ "I consider Siri as a leader, it has a lot of experience and Apple is constantly improving it. It was born in October 2011.", @@ -49,7 +49,7 @@ } }, "Google Assistant": { - "synonyms": ["google assistant"], + "synonyms": ["Google Assistant"], "data": { "thought": [ "Google Assistant is smart and Google is doing a great job with it. It was born in May 2016.",