notice

This is unreleased documentation for Rasa Open Source Documentation Master/Unreleased version.
For the latest released documentation, see the latest version (2.x).

Version: Master/Unreleased

rasa.nlu.classifiers.keyword_intent_classifier

KeywordIntentClassifierGraphComponent Objects

class KeywordIntentClassifierGraphComponent(GraphComponent, IntentClassifier2)

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) -> KeywordIntentClassifierGraphComponent

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]

Set 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, ,) -> KeywordIntentClassifierGraphComponent

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