notice

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

Version: 2.x

rasa.core.training.story_conflict

StoryConflict Objects

class StoryConflict()

Represents a conflict between two or more stories.

Here, a conflict means that different actions are supposed to follow from the same dialogue state, which most policies cannot learn.

__init__

| __init__(sliced_states: List[State]) -> None

Creates a StoryConflict from a given state.

Arguments:

  • sliced_states - The (sliced) dialogue state at which the conflict occurs.

add_conflicting_action

| add_conflicting_action(action: Text, story_name: Text) -> None

Adds another action that follows from the same state.

Arguments:

  • action - Name of the action.
  • story_name - Name of the story where this action is chosen.

conflicting_actions

| @property
| conflicting_actions() -> List[Text]

List of conflicting actions.

Returns:

List of conflicting actions.

conflict_has_prior_events

| @property
| conflict_has_prior_events() -> bool

Checks if prior events exist.

Returns:

True if anything has happened before this conflict, otherwise False.

TrackerEventStateTuple Objects

class TrackerEventStateTuple(NamedTuple)

Holds a tracker, an event, and sliced states associated with those.

sliced_states_hash

| @property
| sliced_states_hash() -> int

Returns the hash of the sliced states.

find_story_conflicts

find_story_conflicts(trackers: List[TrackerWithCachedStates], domain: Domain, max_history: Optional[int] = None, nlu_config: Optional[RasaNLUModelConfig] = None) -> List[StoryConflict]

Generates StoryConflict objects, describing conflicts in the given trackers.

Arguments:

  • trackers - Trackers in which to search for conflicts.
  • domain - The domain.
  • max_history - The maximum history length to be taken into account.
  • nlu_config - NLU config.

Returns:

StoryConflict objects.