From 7733c5c91a4b8f1908999ac000718bf8df697ca6 Mon Sep 17 00:00:00 2001 From: karoel2 Date: Wed, 8 Jun 2022 12:28:33 +0200 Subject: [PATCH] add non-pivot-acts --- system_mockup/monitor_stanu_dialogowego.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/system_mockup/monitor_stanu_dialogowego.py b/system_mockup/monitor_stanu_dialogowego.py index 4612a80..ea00473 100644 --- a/system_mockup/monitor_stanu_dialogowego.py +++ b/system_mockup/monitor_stanu_dialogowego.py @@ -14,6 +14,9 @@ dialogue_state = { def monitor_stanu_dialogowego(frame): + not_pivot_acts = ['time', + 'repo', + 'howmany'] global dialogue_state # Some frames can reset the dialogue state, like saying hello. @@ -24,10 +27,10 @@ def monitor_stanu_dialogowego(frame): return dialogue_state reset_state_if_needed(frame, dialogue_state) - - dialogue_state['current_context'] = frame['act'] + if frame['act'] not in not_pivot_acts: + dialogue_state['current_context'] = frame['act'] append_or_merge_frame(frame, dialogue_state) - + return dialogue_state @@ -46,7 +49,7 @@ def update_facts_if_needed(slot): if slot[1] is None or slot[1] == '': return - + if slot[0] == 'repo': dialogue_state['facts']['repo'] = slot[1] elif slot[0] == 'time': @@ -83,4 +86,3 @@ def reset_state_if_needed(frame, dialogue_state): dialogue_state['topics'] = [] dialogue_state['counter'] = 0 # should we reset 'facts' aswell? -