notice

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

Version: Master/Unreleased

rasa.core.policies.ted_policy

TEDPolicy Objects

class TEDPolicy(Policy)

Transformer Embedding Dialogue (TED) Policy is described in https://arxiv.org/abs/1910.00486. This policy has a pre-defined architecture, which comprises the following steps:

- concatenate user input (user intent and entities), previous system actions,
slots and active forms for each time step into an input vector to
pre-transformer embedding layer;
- feed it to transformer;
- apply a dense layer to the output of the transformer to get embeddings of a
dialogue for each time step;
- apply a dense layer to create embeddings for system actions for each time
step;
- calculate the similarity between the dialogue embedding and embedded system
actions. This step is based on the StarSpace
(https://arxiv.org/abs/1709.03856) idea.

__init__

| __init__(featurizer: Optional[TrackerFeaturizer] = None, priority: int = DEFAULT_POLICY_PRIORITY, max_history: Optional[int] = None, model: Optional[RasaModel] = None, zero_state_features: Optional[Dict[Text, List["Features"]]] = None, **kwargs: Any, ,) -> None

Declare instance variables with default values.

train

| train(training_trackers: List[TrackerWithCachedStates], domain: Domain, interpreter: NaturalLanguageInterpreter, **kwargs: Any, ,) -> None

Train the policy on given training trackers.

predict_action_probabilities

| predict_action_probabilities(tracker: DialogueStateTracker, domain: Domain, interpreter: NaturalLanguageInterpreter, **kwargs: Any, ,) -> List[float]

Predict the next action the bot should take. Return the list of probabilities for the next actions.

persist

| persist(path: Union[Text, Path]) -> None

Persists the policy to a storage.

load

| @classmethod
| load(cls, path: Union[Text, Path]) -> "TEDPolicy"

Loads a policy from the storage. Needs to load its featurizer