This is documentation for Rasa Open Source Documentation v2.0.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (2.3.x).

Version: 2.0.x


HFTransformersNLP Objects

class HFTransformersNLP(Component)

Utility Component for interfacing between Transformers library and Rasa OS.

The transformers( library is used to load pre-trained language models like BERT, GPT-2, etc. The component also tokenizes and featurizes dense featurizable attributes of each message.


| train(training_data: TrainingData, config: Optional[RasaNLUModelConfig] = None, **kwargs: Any, ,) -> None

Compute tokens and dense features for each message in training data.


  • training_data - NLU training data to be tokenized and featurized
  • config - NLU pipeline config consisting of all components.


| process(message: Message, **kwargs: Any) -> None

Process an incoming message by computing its tokens and dense features.


  • message - Incoming message object