rasa/core/training/generator.py
def _remove_duplicate_trackers(self,
                                   trackers: List[TrackerWithCachedStates]
                                   ) -> TrackersTuple:
        """Removes trackers that create equal featurizations
            for current story step.

        From multiple trackers that create equal featurizations
        we only need to keep one. Because as we continue processing
        events and story steps, all trackers that created the
        same featurization once will do so in the future (as we
        feed the same events to all trackers)."""

        step_hashed_featurizations = set()

        # collected trackers that created different featurizations
        unique_trackers = []  # for current step
        end_trackers = []  # for all steps

        for tracker in trackers:
            states = tuple(tracker.past_states(self.domain))
            hashed = hash(states)

            # only continue with trackers that created a
            # hashed_featurization we haven't observed
            if hashed not in step_hashed_featurizations:
                if self.config.unique_last_num_states:
                    last_states = states[-self.config.unique_last_num_states:]
                    last_hashed = hash(last_states)

                    if last_hashed not in step_hashed_featurizations:
                        step_hashed_featurizations.add(last_hashed)
                        unique_trackers.append(tracker)
                    elif (len(states) > len(last_states) and
                          hashed not in self.hashed_featurizations):
                        self.hashed_featurizations.add(hashed)
                        end_trackers.append(tracker)
                else:
                    unique_trackers.append(tracker)

                step_hashed_featurizations.add(hashed)

        return unique_trackers, end_trackers
Removes trackers that create equal featurizations
            for current story step.

        From multiple trackers that create equal featurizations
        we only need to keep one. Because as we continue processing
        events and story steps, all trackers that created the
        same featurization once will do so in the future (as we
        feed the same events to all trackers).
Removes trackers that create equal featurizations
for current story step.

From multiple trackers that create equal featurizations
we only need to keep one. Because as we continue processing
events and story steps, all trackers that created the
same featurization once will do so in the future (as we
feed the same events to all trackers).
Removes trackers that create equal featurizations for current story step . From multiple trackers that create equal featurizations we only need to keep one . Because as we continue processing events and story steps all trackers that created the same featurization once will do so in the future ( as we feed the same events to all trackers ) .
def _remove_duplicate_trackers(self,
                                   trackers: List[TrackerWithCachedStates]
                                   ) -> TrackersTuple:
        step_hashed_featurizations = set()
        unique_trackers = []  
        end_trackers = []  
        for tracker in trackers:
            states = tuple(tracker.past_states(self.domain))
            hashed = hash(states)
            if hashed not in step_hashed_featurizations:
                if self.config.unique_last_num_states:
                    last_states = states[-self.config.unique_last_num_states:]
                    last_hashed = hash(last_states)
                    if last_hashed not in step_hashed_featurizations:
                        step_hashed_featurizations.add(last_hashed)
                        unique_trackers.append(tracker)
                    elif (len(states) > len(last_states) and
                          hashed not in self.hashed_featurizations):
                        self.hashed_featurizations.add(hashed)
                        end_trackers.append(tracker)
                else:
                    unique_trackers.append(tracker)
                step_hashed_featurizations.add(hashed)
        return unique_trackers, end_trackers
def _remove_duplicate_trackers ( self , trackers : List [ TrackerWithCachedStates ] ) -> TrackersTuple : step_hashed_featurizations = set ( ) unique_trackers = [ ] end_trackers = [ ] for tracker in trackers : states = tuple ( tracker . past_states ( self . domain ) ) hashed = hash ( states ) if hashed not in step_hashed_featurizations : if self . config . unique_last_num_states : last_states = states [ - self . config . unique_last_num_states : ] last_hashed = hash ( last_states ) if last_hashed not in step_hashed_featurizations : step_hashed_featurizations . add ( last_hashed ) unique_trackers . append ( tracker ) elif ( len ( states ) > len ( last_states ) and hashed not in self . hashed_featurizations ) : self . hashed_featurizations . add ( hashed ) end_trackers . append ( tracker ) else : unique_trackers . append ( tracker ) step_hashed_featurizations . add ( hashed ) return unique_trackers , end_trackers
Removes trackers that create equal featurizations
for current story step.
Removes trackers that create equal featurizations for current story step .
"""Removes trackers that create equal featurizations
            for current story step.

        From multiple trackers that create equal featurizations
        we only need to keep one. Because as we continue processing
        events and story steps, all trackers that created the
        same featurization once will do so in the future (as we
        feed the same events to all trackers).""" # collected trackers that created different featurizations # for current step # for all steps # only continue with trackers that created a # hashed_featurization we haven't observed
self
trackers
List[TrackerWithCachedStates]