notice

This is unreleased documentation for Rasa Documentation Main/Unreleased version.
For the latest released documentation, see the latest version (3.x).

Version: Main/Unreleased

rasa.nlu.classifiers.keyword_intent_classifier

KeywordIntentClassifier Objects

@DefaultV1Recipe.register(
DefaultV1Recipe.ComponentType.INTENT_CLASSIFIER, is_trainable=True
)
class KeywordIntentClassifier(GraphComponent, IntentClassifier)

Intent classifier using simple keyword matching.

The classifier takes a list of keywords and associated intents as an input. An input sentence is checked for the keywords and the intent is returned.

get_default_config

@staticmethod
def get_default_config() -> Dict[Text, Any]

The component's default config (see parent class for full docstring).

__init__

def __init__(config: Dict[Text, Any],
model_storage: ModelStorage,
resource: Resource,
execution_context: ExecutionContext,
intent_keyword_map: Optional[Dict] = None) -> None

Creates classifier.

create

@classmethod
def create(cls, config: Dict[Text, Any], model_storage: ModelStorage,
resource: Resource,
execution_context: ExecutionContext) -> KeywordIntentClassifier

Creates a new untrained component (see parent class for full docstring).

train

def train(training_data: TrainingData) -> Resource

Trains the intent classifier on a data set.

process

def process(messages: List[Message]) -> List[Message]

Sets the message intent and add it to the output if it exists.

persist

def persist() -> None

Persist this model into the passed directory.

load

@classmethod
def load(cls, config: Dict[Text, Any], model_storage: ModelStorage,
resource: Resource, execution_context: ExecutionContext,
**kwargs: Any) -> KeywordIntentClassifier

Loads trained component (see parent class for full docstring).