notice

This is unreleased documentation for Rasa Open Source Documentation Master/Unreleased version.
For the latest released documentation, see the latest version (2.8.x).

Version: Master/Unreleased

rasa.graph_components.adders.nlu_prediction_to_history_adder

NLUPredictionToHistoryAdder Objects

class NLUPredictionToHistoryAdder(GraphComponent)

Adds NLU predictions to DialogueStateTracker.

create

@classmethod
def create(cls, config: Dict[Text, Any], model_storage: ModelStorage, resource: Resource, execution_context: ExecutionContext) -> NLUPredictionToHistoryAdder

Creates component (see parent class for full docstring).

add

def add(predictions: List[Message], tracker: DialogueStateTracker, domain: Domain, original_message: UserMessage) -> DialogueStateTracker

Adds NLU predictions to the tracker.

Arguments:

  • predictions - A list of NLU predictions wrapped as Messages
  • tracker - The tracker the predictions should be attached to
  • domain - The domain of the model.
  • original_message - An original message from the user with extra metadata to annotate the predictions (e.g. channel)

Returns:

The original tracker updated with events created from the predictions