rasa.nlu.training_data.entities_parser
EntityAttributes Objects
Attributes of an entity defined in markdown data.
find_entities_in_training_example
Extracts entities from an intent example.
Arguments:
example
- Intent example.
Returns:
Extracted entities.
extract_entity_attributes
Extract the entity attributes, i.e. type, value, etc., from the regex match.
Arguments:
match
- Regex match to extract the entity attributes from.
Returns:
EntityAttributes object.
extract_entity_attributes_from_dict
Extract entity attributes from dict format.
Arguments:
entity_text
- Original entity text.match
- Regex match.
Returns:
Extracted entity attributes.
get_validated_dict
Converts the provided json_str
to a valid dict containing the entity
attributes.
Users can specify entity roles, synonyms, groups for an entity in a dict, e.g. [LA]{"entity": "city", "role": "to", "value": "Los Angeles"}.
Arguments:
json_str
- The entity dict as string without "{}".
Raises:
ValidationError if validation of entity dict fails. JSONDecodeError if provided entity dict is not valid json.
Returns:
Deserialized and validated json_str
.
replace_entities
Replace special symbols related to the entities in the provided training example.
Arguments:
training_example
- Original training example with special symbols.
Returns:
String with removed special symbols.
parse_training_example
Extract entities and synonyms, and convert to plain text.