Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Commit

Permalink
Merge pull request #717 from RasaHQ/fallback_listen
Browse files Browse the repository at this point in the history
predict action listen after fallback
  • Loading branch information
akelad committed Jul 10, 2018
2 parents 2be3e4b + 2ebb4fb commit e3709b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rasa_core/policies/fallback.py
Expand Up @@ -93,7 +93,12 @@ def predict_action_probabilities(self, tracker, domain):
# to not override standard behaviour
nlu_confidence = nlu_data["intent"].get("confidence", 1.0)

if self.should_fallback(nlu_confidence, tracker.latest_action_name):
# if the last action was fallback, we should always predict
# action listen after
if tracker.latest_action_name == self.fallback_action_name:
idx = domain.index_for_action('action_listen')
score = 1.1
elif self.should_fallback(nlu_confidence, tracker.latest_action_name):
logger.debug("NLU confidence {} is lower "
"than NLU threshold {}. "
"Predicting fallback action: {}"
Expand Down

0 comments on commit e3709b0

Please sign in to comment.