add non-pivot-acts

This commit is contained in:
karoel2 2022-06-08 12:28:33 +02:00
parent e4e5b5b98f
commit 7733c5c91a

View File

@ -14,6 +14,9 @@ dialogue_state = {
def monitor_stanu_dialogowego(frame): def monitor_stanu_dialogowego(frame):
not_pivot_acts = ['time',
'repo',
'howmany']
global dialogue_state global dialogue_state
# Some frames can reset the dialogue state, like saying hello. # Some frames can reset the dialogue state, like saying hello.
@ -24,10 +27,10 @@ def monitor_stanu_dialogowego(frame):
return dialogue_state return dialogue_state
reset_state_if_needed(frame, dialogue_state) reset_state_if_needed(frame, dialogue_state)
if frame['act'] not in not_pivot_acts:
dialogue_state['current_context'] = frame['act'] dialogue_state['current_context'] = frame['act']
append_or_merge_frame(frame, dialogue_state) append_or_merge_frame(frame, dialogue_state)
return dialogue_state return dialogue_state
@ -46,7 +49,7 @@ def update_facts_if_needed(slot):
if slot[1] is None or slot[1] == '': if slot[1] is None or slot[1] == '':
return return
if slot[0] == 'repo': if slot[0] == 'repo':
dialogue_state['facts']['repo'] = slot[1] dialogue_state['facts']['repo'] = slot[1]
elif slot[0] == 'time': elif slot[0] == 'time':
@ -83,4 +86,3 @@ def reset_state_if_needed(frame, dialogue_state):
dialogue_state['topics'] = [] dialogue_state['topics'] = []
dialogue_state['counter'] = 0 dialogue_state['counter'] = 0
# should we reset 'facts' aswell? # should we reset 'facts' aswell?