Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick question about scrubbing/synonyms #77

Open
ghost opened this issue Jan 22, 2018 · 1 comment
Open

Quick question about scrubbing/synonyms #77

ghost opened this issue Jan 22, 2018 · 1 comment
Assignees

Comments

@ghost
Copy link

ghost commented Jan 22, 2018

Hi there; I'm new to Lex, having from from the Alexa world, and really impressed with this repo.
Learning a lot from your code, but I have a question:

At https://github.com/terrenjpeterson/caloriecounter/blob/master/src/lambda.js#L198, you "scrub the restaurant name to get it to a standard".

Is there any particular advantage of doing it this way, over using synonyms?

With the synonym functionality, you can specify multiple synonyms for a slot value in your chatbot. The synonyms specified are resolved to the corresponding slot values. For example, if the slot value is “comedy”, with “funny” and “humorous” specified as synonyms, then user input of “funny” will now be resolved to “comedy”. You can optimize your business logic to implement code for just the slot value instead of entire set of synonyms. In addition, the chatbot automatically resolves minor variants of the slot value to the original value without the user having to explicitly specify the synonym. For example, if “pineapple” is one of the slot values and the user value is “pineapples” then the slot is resolved to the value “pineapple”.

Over in the Alexa world, when anything is updated (even synonyms) the whole skill has to go through a laborious and often random re-approval process, so people often do lambda-side stuff like you've done, to keep it away from the front-end checking.

But (as far as I understand it) that's not needed with Lex? It's quite possible (almost certain!) that I've completely mis-understood something here, so if anyone can set me straight I'd be grateful. Thanks!

@terrenjpeterson
Copy link
Owner

Good idea. It would be great to simplify the code and have this be embedded into the model vs. the functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant