simple_intent_classifier#
- class besser.bot.nlp.intent_classifier.simple_intent_classifier.SimpleIntentClassifier(nlp_engine, state)[source]#
Bases:
IntentClassifier
A Simple Intent Classifier.
It works using a simple Keras Neural Network (the prediction model) for text classification.
- Parameters:
- _model#
The intent classifier language model
- Type:
See also
- __intent_label_mapping#
A mapping of the intent labels and their corresponding intents.
- __total_labels_training_sentences#
The label (identifying the intent) of all training sentences.
- __total_training_sentences#
All the processed training sentences of all intents of the intent classifier’s state.
- __total_training_sequences#
All the training sequences of all intents of the intent classifier’s state.
- _abc_impl = <_abc._abc_data object>#
- predict(message)[source]#
Predict the intent of a given message.
Instead of returning only the intent with the highest likelihood, return all predictions. Predictions include not only the intent scores but other information extracted from the message.
- Parameters:
message (str) – the message to predict the intent
- Returns:
the list of predictions made by the intent classifier.
- Return type: