How to get Watson Assistant to capture multiple entities in context variables - ibm-watson

I'm trying to create a Watson chatbot and I'm running into this issue.
I'm making chatbot that's helping people find organizations that provide food, shelter, drug treatment, etc.
I have a dialog node that asks the user what service they're looking for and storing it as a $service context variable.
This works well if the user says something like "I want food" as "food" gets stored into $service.
But say for instance a user says something like "I want food and drug treatment." I want Watson to then be able to store both of these variables as context variables.
How do I do that?

Its quite simple.
Just use
"service":<?#entityname.values?>
It will store all the input value of this entity in service array.

Related

how to store likes data in flutter

I'm developing an app in which I need to show come "coupons" I get from the API. I also have a "liked coupons" page where I need to show the ones the user has liked. I'm facing 2 problems here:
1- I don't know how to store likes, should I implement a local database for everything or should I ask our back-end team to save the liked/not liked state on the server?
2- I have a model class for coupons, and I have a coupon_list widget which is a horizontal listview.builder(). the problem is that some coupons are being showed in 2 or 3 different lists and I need them to all turn to liked when user likes an instance from a single list. how can I do that? (I want to do something like working with pointers in c++, passing the ACTUAL variable instead of it's value so it changes globally)
I would like to suggest you to store it in server as well. (Ask to your back-end team to add parameter) So that if user logout or sign in from different device "liked coupons" data will be available in all cases.
And for 2) multiple coupon entry you have to manage it via unique id. Like every coupon has its unique series no / pattern num. So you can put condition on that. i.e. Add "unique_no" to liked_list from all available list of coupon
Solution
Use Shared Preferences! This is something like a database on the device you are currently running. So if the user makes a like you can save that on their device!
To add Shared Preferences to your app look this video
Hope it helps!

append a piece of text to user's input before determining it's intent by Watson assistant engine

I want to append a piece of text to user's input before determining it's intent by Watson assistant engine
for example:
set context variable $subject = "VPN"
user input : "I want to set it up"
add context variable to the input so it becomes :
"I want to set it up $subject" ------> "I want to set it up VPN"
then after doing that watson determines which intent this input belongs to
PS: it doesn't have to be a context variable, I can append some static text
I recommend to split this problem up into intent and entities.
What is the desired action, the intent? Set something up.
What is the object / subject involved, the entity? A VPN, a computer.
That way your chatbot is more flexible and can be extended later on.
If you are already talking about VPN in a dialog, you may branch into a VPN-specific set of dialog nodes.

Extract key content from a conversation response

I'm trying to understand the best approach to extract key content during a conversation. I'll use a simple travel interaction example:
I've created a conversation that supports travel activities, and after greeting the user they are asked how can I be of help?
The user responds: I have a flight to Las Vegas today and I need to make a change to my reservation.
Defining the proper Intents and Entities we conclude they want to change a reservation. I want to understand how can I identify, and extract from the response key words like "Las Vegas" and "Today"?
Is there an approach using Watson APIs or do I need to write custom code to dissect the response based on the matching Intents and Entities?
As an example I'd like to confirm to the user: I understand you have a flight to Las Vegas today and would like to make changes to that reservation. Is that right?
Appreciate any advice you can share.
It sounds like you need a place/destination/airport entity, for places like Las Vegas, and an entity for days. You can then use conditions in your dialog flow based on which entity value was matched, for example #place:(Las Vegas). Or you can just repeat the matched entity back to the user in the response, for example I understand you have a flight to #place.
Have a look at the Dialog reference documentation for more information on using entities.
Also, if it helps, there are some examples of day entities in the conversation-starter project entities.csv file on GitHub, and I'm tempted to add an entity for airport codes there if I get a chance.

Drupal Replacement Pattern for Entity Reference

I have a Profile Type attached to a user. In there I have a Entity Reference Field of Program Manager. I have Live Events(content-type) that people can register for. I set up a Rule to Email the Program Manager every time someone registers.
My problem is I am trying to pull information from the Profile based on the the entity reference for the Program Manager.
I have the field printing out by using this pattern...
[registration:entity:field_program_manager]
However when I try to pull the first name, email of phone I can not get it to show up.
Does anyone have any ideas to share?
Many Thanks!
Okay so I was trying to solve for sending the email to the Author of the page but was having issues. So I created a new fields hoping it would be easier. In trying to solve for this I solved the original issue.
To print the Author of a node to an email through Rules actions us this.
[registration:entity:author]
So for first name it would be:
[registration:entity:author:profile-main:field_first_name]
Hope it helps someone else.
If you're using entityform instead of a node and referencing the default user info (not the 'Main Profile' profile type), then you want to use something like
[entityform:field-staff-entity-ref:field-work-email]
In this case, 'field-staff-entity-ref' is the entity reference field in the entityform and 'field-work-email' is the field in the user's account settings.

Is this the right db design for the most flexible and modular CMS with user management in CakePHP?

I would like to ask you guys if you could review my database design. I think it is quite self-explanatory, but to be absolutely clear:
My goal is to make an application which has a super flexible user management (which is why the groups are in tree-form and the groups and users have a habtm relationship) and a super modular way to build pages (which is why the pages consist of widget-blocks).
The reason I made users and profiles separate is because the users table will not change and is only needed for authentication and authorization. However, the profiles table will change according to the wishes of the client. So it might not have a signature, but an avatar field instead. Or maybe it will be completely empty / not exist at all.
A widget could be anything, it could be a poll, it could be a piece of content, it could be a navigation, it could be a collection of comments, whatever.
The reason I chose to make subdomains, locales and layouts separate tables instead of just putting the names into pages is because I want to limit the options that are available to the client. Just because I have a three-columns.ctp in my layouts folder doesn't necessarily mean I want the client to be able to choose it.
Same goes for the widgets. And besides limiting choice, not every plugin, controller and action in my plugins-folder is a widget, so I need a table to clarify which are.
A block is a widget on a page which sits in a container (e.g. the right column in a 3 column layout) at a particular position which is decided by the index (lower index means higher).
So that's my explanation, what do you guys think? Is this as good as it can be? Or do you have (a) suggestion(s) to make it even more flexible and modular.
[edit] Oh and to be clear, the widgets will of course have their own tables to store the information they need to store.
Well, I think that everything is great except "profiles".
When you try to get data from a logged user:
$this->Auth->user();
I don't think that you will get data about "profiles" so you will have to find profile by $this->Auth->user('id') etc. I think that you should merge "profiles" and "users" tables into "users" table.
So when you want to save, let's say, "signature" you should just put it in $this->request->data; and call $this->User->save($this->request->data); and the signature will be updated.
EDIT:
You can leave it the way it is but, to get other data than user, you will have to put:
$id = $this->Auth->user('id');
$current_user = $this->User->findById($id);

Resources