notice
This is documentation for Rasa Open Source Documentation v2.0.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (2.3.x).
rasa.nlu.classifiers.diet_classifier
EntityTagSpec Objects
Specification of an entity tag present in the training data.
DIETClassifier Objects
DIET (Dual Intent and Entity Transformer) is a multi-task architecture for intent classification and entity recognition.
The architecture is based on a transformer which is shared for both tasks.
A sequence of entity labels is predicted through a Conditional Random Field (CRF)
tagging layer on top of the transformer output sequence corresponding to the
input sequence of tokens. The transformer output for the __CLS__
token and
intent labels are embedded into a single semantic vector space. We use the
dot-product loss to maximize the similarity with the target label and minimize
similarities with negative samples.
__init__
Declare instance variables with default values.
preprocess_train_data
Prepares data for training.
Performs sanity checks on training data, extracts encodings for labels.
train
Train the embedding intent classifier on a data set.
process
Return the most likely label and its similarity to the input.
persist
Persist this model into the passed directory.
Return the metadata necessary to load the model again.
load
Loads the trained model from the provided directory.