Closed oscalarr closed 6 years ago
I think there are infinite deep learning structures we can build to classify intents. So instead of adding different classifiers to RASA, we must give user option to customize available classifiers i.e. adding hidden layers, drop out etc.
@omerarshad I don't think there is an easy way to abstract over all of these parameters (but maybe there is, e.g. a tensorflow model definition language?). Otherwise, a good solution is to provide a good initial setup (layers, dropout, ...) that works for most use cases allowing people with experience to change the model by subclassing the class.
It´s easy to extract the model to a function and reuse the rest of the code.
Model:
tf.reset_default_graph()
net = tflearn.input_data(shape=[None, len(self.train_x[0])]) net = tflearn.fully_connected(net, 32) net = tflearn.fully_connected(net, 32) net = tflearn.fully_connected(net, len(self.train_y[0]), activation='softmax') net = tflearn.regression(net) self.model = tflearn.DNN(net)
@tmbo, with this algorithm you can have a special intent (anythingelse) that is selected when the text doesn´t fit in one intent. Is it better to return this intent or return no intent?
I´m working in a keras version, is it ok?
@oscalarr thank you for making the effort to create a new classifier! I would recommend first creating an issue describing what you hope to achieve with it. In our experiments so far, replacing the SVM with a neural net doesn't improve intent classification performance, and only introduces a number of hyperparameters which have to be tuned. I'm excited that you are looking to contribute, but as there is a good chance we wouldn't merge this contribution, please create an issue where we can discuss it before implementing anything
@amn41, I agree with you that is important to have an issue to discuss, but sometimes is better to have some code to play with. Currently we have a hybrid chatbot (Q&As + some slots in Spanish) developed using Watson Conversation (now Watson Assistant). In our case we have some "delicate" answers so for us it is important to "control" the intent classification. We use the special intent anythingelse ("I don´t understand you") and a threshold to do it. It allows us to manage anythingelse and provide different suggestions depeding on the context. So, for our case the current intent classifiers don´t fit well.
I understand the need for better thresholds, but for a neural net to deliver that you will have to customise your loss function a bit. Please keep an eye on https://github.com/RasaHQ/rasa_nlu/pull/943 - aim to merge it soon and it probably already does what you want. It's explicitly a ranking model so the confidence should be more reliable
I have closed the issue because I´m testing the embedding classifier.
With the deep learning algorithm that the code use, adding an intent with the text "." improve the results and it allow you to cut using a 0.5 threshold.
I have developed a new classifier that uses a deep learning algorithm to extract intents.
Hi @tmbo, @omerarshad, please, could you review it?
922