rasa.nlu.extractors.extractor
EntityTagSpec Objects
Specification of an entity tag present in the training data.
EntityExtractorMixin Objects
Provides functionality for components that do entity extraction.
Inheriting from this class will add utility functions for entity extraction. Entity extraction is the process of identifying and extracting entities like a person's name, or a location from a message.
name
Returns the name of the class.
add_extractor_name
Adds this extractor's name to a list of entities.
Arguments:
entities
- the extracted entities.
Returns:
the modified entities.
add_processor_name
Adds this extractor's name to the list of processors for this entity.
Arguments:
entity
- the extracted entity and its metadata.
Returns:
the modified entity.
filter_irrelevant_entities
Only return dimensions the user configured.
filter_trainable_entities
Filters out untrainable entity annotations.
Creates a copy of entity_examples in which entities that have
extractor
set to something other than
self.name (e.g. 'CRFEntityExtractor') are removed.
convert_predictions_into_entities
Convert predictions into entities.
Arguments:
text
- The text message.tokens
- Message tokens without CLS token.tags
- Predicted tags.split_entities_config
- config for handling splitting a list of entitiesconfidences
- Confidences of predicted tags.
Returns:
Entities.
get_tag_for
Get the value of the given tag name from the list of tags.
Arguments:
tags
- Mapping of tag name to list of tags;tag_name
- The tag name of interest.idx
- The index position of the tag.
Returns:
The tag value.
check_correct_entity_annotations
Check if entities are correctly annotated in the training data.
If the start and end values of an entity do not match any start and end values of the respected token, we define an entity as misaligned and log a warning.
Arguments:
training_data
- The training data.