notice
This is documentation for Rasa & Rasa Pro Documentation v2.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (3.x).
rasa.nlu.featurizers.dense_featurizer.convert_featurizer
ConveRTFeaturizer Objects
Featurizer using ConveRT model.
Loads the ConveRT(https://github.com/PolyAI-LDN/polyai-models#convert) model from TFHub and computes sentence and sequence level feature representations for dense featurizable attributes of each message object.
required_components
Components that should be included in the pipeline before this component.
required_packages
Packages needed to be installed.
__init__
Initializes ConveRTFeaturizer with the model and different encoding signatures.
Arguments:
component_config
- Configuration for the component.
train
Featurize all message attributes in the training data with the ConveRT model.
Arguments:
training_data
- Training data to be featurizedconfig
- Pipeline configuration**kwargs
- Any other arguments.
process
Featurize an incoming message with the ConveRT model.
Arguments:
message
- Message to be featurized**kwargs
- Any other arguments.
cache_key
Cache the component for future use.
Arguments:
component_meta
- configuration for the component.model_metadata
- configuration for the whole pipeline.Returns
- key of the cache for future retrievals.
provide_context
Store the model in pipeline context for future use.
tokenize
Tokenize the text using the ConveRT model.
ConveRT adds a special char in front of (some) words and splits words into sub-words. To ensure the entity start and end values matches the token values, reuse the tokens that are already assigned to the message. If individual tokens are split up into multiple tokens, add this information to the respected tokens.