rasa.nlu.extractors.regex_entity_extractor
RegexEntityExtractor Objects
Extracts entities via lookup tables and regexes defined in the training data.
get_default_config
The component's default config (see parent class for full docstring).
create
Creates a new GraphComponent
.
Arguments:
config
- This config overrides thedefault_config
.model_storage
- Storage which graph components can use to persist and load themselves.resource
- Resource locator for this component which can be used to persist and load itself from themodel_storage
.execution_context
- Information about the current graph run. Unused.Returns
- An instantiatedGraphComponent
.
__init__
Creates a new instance.
Arguments:
config
- The configuration.model_storage
- Storage which graph components can use to persist and load themselves.resource
- Resource locator for this component which can be used to persist and load itself from themodel_storage
.patterns
- a list of patterns
train
Extract patterns from the training data.
Arguments:
training_data
- the training data
process
Extracts entities from messages and appends them to the attribute.
If no patterns where found during training, then the given messages will not
be modified. In particular, if no ENTITIES
attribute exists yet, then
it will not be created.
If no pattern can be found in the given message, then no entities will be
added to any existing list of entities. However, if no ENTITIES
attribute
exists yet, then an ENTITIES
attribute will be created.
Returns:
the given list of messages that have been modified
load
Loads trained component (see parent class for full docstring).
persist
Persist this model.