rasa/core/policies/memoization.py
def _back_to_the_future_again(tracker):
        """Send Marty to the past to get
            the new featurization for the future"""

        idx_of_first_action = None
        idx_of_second_action = None

        # we need to find second executed action
        for e_i, event in enumerate(tracker.applied_events()):
            # find second ActionExecuted
            if isinstance(event, ActionExecuted):
                if idx_of_first_action is None:
                    idx_of_first_action = e_i
                else:
                    idx_of_second_action = e_i
                    break

        if idx_of_second_action is None:
            return None
        # make second ActionExecuted the first one
        events = tracker.applied_events()[idx_of_second_action:]
        if not events:
            return None

        mcfly_tracker = tracker.init_copy()
        for e in events:
            mcfly_tracker.update(e)

        return mcfly_tracker
Send Marty to the past to get
            the new featurization for the future
Send Marty to the past to get
the new featurization for the future
Send Marty to the past to get the new featurization for the future
def _back_to_the_future_again(tracker):
        idx_of_first_action = None
        idx_of_second_action = None
        for e_i, event in enumerate(tracker.applied_events()):
            if isinstance(event, ActionExecuted):
                if idx_of_first_action is None:
                    idx_of_first_action = e_i
                else:
                    idx_of_second_action = e_i
                    break
        if idx_of_second_action is None:
            return None
        events = tracker.applied_events()[idx_of_second_action:]
        if not events:
            return None
        mcfly_tracker = tracker.init_copy()
        for e in events:
            mcfly_tracker.update(e)
        return mcfly_tracker
def _back_to_the_future_again ( tracker ) : idx_of_first_action = None idx_of_second_action = None for e_i , event in enumerate ( tracker . applied_events ( ) ) : if isinstance ( event , ActionExecuted ) : if idx_of_first_action is None : idx_of_first_action = e_i else : idx_of_second_action = e_i break if idx_of_second_action is None : return None events = tracker . applied_events ( ) [ idx_of_second_action : ] if not events : return None mcfly_tracker = tracker . init_copy ( ) for e in events : mcfly_tracker . update ( e ) return mcfly_tracker
Send Marty to the past to get
the new featurization for the future
Send Marty to the past to get the new featurization for the future
"""Send Marty to the past to get
            the new featurization for the future""" # we need to find second executed action # find second ActionExecuted # make second ActionExecuted the first one
tracker