natural icon indicating copy to clipboard operation
natural copied to clipboard

Use of context values in the classifier

Open msolefonte opened this issue 5 years ago • 0 comments

I am new to this tool so I do not know if this has been asked before (have not found it in the issues), but I would like to know if there is any way to use context values in the Classifier. This means that the results can vary according to some values.

Let's say I have these relations: "My favorite animal is the dog" -> context = [animals] and "My favorite song is the Yellow Submarine" -> context = [songs].

Then I ask "Which one is yours?", which would result in different values depending of the value of context. This one looks like a poor example because "Which one is yours?" can be checked always and context can be read inside of the function, but sometimes it is not possible.

Basically, what I am asking is to know if it possible to train the classifier to embrace/reject some context values. This could be an example:

myClassifier.addDocument('which one is yours?', contextRequired = ['colors'], your_favorite_color);
myClassifier.addDocument('which one is yours?', contextRequired = ['animals'], your_favorite_animal);

This should also be used in negative ways:

myClassifier.addDocument('good morning', contextRejected = ['already_greeted'], good_morning);
myClassifier.addDocument('good morning', contextRequired= ['already_greeted'], you_are_so_repetitive);

Not my best examples but I hope you can understand me. It is completely based on the Contexts of Dialogflow: https://cloud.google.com/dialogflow/docs/contexts-overview

msolefonte avatar Aug 17 '20 21:08 msolefonte