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):
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?