intent_classifier_configuration#
- class besser.bot.nlp.intent_classifier.intent_classifier_configuration.IntentClassifierConfiguration[source]#
Bases:
ABCThe Intent Classifier Configuration abstract class.
This configuration is assigned to a state, allowing the customization of its intent classifier.
This class serves as a template to implement intent classifier configurations for the different Intent Classifiers.
- _abc_impl = <_abc._abc_data object>#
- class besser.bot.nlp.intent_classifier.intent_classifier_configuration.LLMIntentClassifierConfiguration(llm_name, parameters={}, use_intent_descriptions=True, use_training_sentences=True, use_entity_descriptions=True, use_entity_synonyms=True)[source]#
Bases:
IntentClassifierConfigurationThe LLM Intent Classifier Configuration class.
It allows the customization of a
LLMIntentClassifier.- Parameters:
llm_name (str) – the name of the LLM to be used (must be created in the bot)
parameters (dict) – the LLM parameters (this will vary depending on the suite and the LLM)
use_intent_descriptions (bool) – whether to include the intent descriptions in the LLM prompt
use_training_sentences (bool) – whether to include the intent training sentences in the LLM prompt
use_entity_descriptions (bool) – whether to include the entity descriptions in the LLM prompt
use_entity_synonyms (bool) – whether to include the entity value’s synonyms in the LLM prompt
- use_training_sentences#
whether to include the intent training sentences in the LLM prompt
- Type:
- _abc_impl = <_abc._abc_data object>#
- class besser.bot.nlp.intent_classifier.intent_classifier_configuration.SimpleIntentClassifierConfiguration(num_words=1000, num_epochs=300, embedding_dim=128, input_max_num_tokens=15, discard_oov_sentences=True, check_exact_prediction_match=True, activation_last_layer='sigmoid', activation_hidden_layers='tanh', lr=0.001)[source]#
Bases:
IntentClassifierConfigurationThe Simple Intent Classifier Configuration class.
It allows the customization of a
SimpleIntentClassifier.- Parameters:
num_words (int) – Max num of words to keep in the index of words
num_epochs (int) – Number of epochs to be run during training
embedding_dim (int) – Number of embedding dimensions to be used when embedding the words
input_max_num_tokens (int) – Max length for the vector representing a sentence
discard_oov_sentences (bool) – whether to automatically assign zero probabilities to sentences with all tokens being oov ones or not
check_exact_prediction_match (bool) – Whether to check for exact match between the sentence to predict and one of the training sentences or not
activation_last_layer (str) – The activation function of the last layer
activation_hidden_layers (str) – The activation function of the hidden layers
lr (float) – Learning rate for the optimizer
- discard_oov_sentences#
whether to automatically assign zero probabilities to sentences with all tokens being oov ones or not
- Type:
- check_exact_prediction_match#
Whether to check for exact match between the sentence to predict and one of the training sentences or not
- Type:
The activation function of the hidden layers
- Type:
- _abc_impl = <_abc._abc_data object>#