rasa.nlu.classifiers.sklearn_intent_classifier
SklearnIntentClassifier Objects
Intent classifier using the sklearn framework.
required_components
Components that should be included in the pipeline before this component.
get_default_config
The component's default config (see parent class for full docstring).
__init__
Construct a new intent classifier using the sklearn framework.
create
Creates a new untrained component (see parent class for full docstring).
required_packages
Any extra python dependencies required for this component to run.
transform_labels_str2num
Transforms a list of strings into numeric label representation.
Arguments:
labels
: List of labels to convert to numeric representation
transform_labels_num2str
Transforms a list of strings into numeric label representation.
Arguments:
y
: List of labels to convert to numeric representation
train
Train the intent classifier on a data set.
process
Return the most likely intent and its probability for a message.
predict_prob
Given a bow vector of an input text, predict the intent label.
Return probabilities for all labels.
Arguments:
X
: bow of input text
Returns:
vector of probabilities containing one entry for each label.
predict
Given a bow vector of an input text, predict most probable label.
Return only the most likely label.
Arguments:
X
: bow of input text
Returns:
tuple of first, the most probable label and second, its probability.
persist
Persist this model into the passed directory.
load
Loads trained component (see parent class for full docstring).