This commit is contained in:
s495727 2024-06-13 15:39:50 +02:00
parent 35a19cc5c0
commit 3fb60acd4f
2 changed files with 9 additions and 10 deletions

View File

@ -34,12 +34,12 @@ class DialogStateMonitor:
}, },
total_cost=0, total_cost=0,
stages=[ stages=[
{'completed': False, 'name': 'collect_food', "confirmed": False}, {'completed': False, 'name': 'collect_food'},
# {'completed': False, 'name': 'more_food', "confirmed": False}, {'completed': False, 'name': 'more_food'},
{'completed': False, 'name': 'collect_drinks', "confirmed": False}, {'completed': False, 'name': 'collect_drinks'},
# {'completed': False, 'name': 'more_drinks', "confirmed": False}, {'completed': False, 'name': 'more_drinks'},
{'completed': False, 'name': 'collect_address', "confirmed": False}, {'completed': False, 'name': 'collect_address'},
{'completed': False, 'name': 'collect_phone', "confirmed": False}, {'completed': False, 'name': 'collect_phone'},
], ],
was_previous_order_invalid=False, was_previous_order_invalid=False,
was_system_act_processed=False, was_system_act_processed=False,
@ -125,7 +125,7 @@ class DialogStateMonitor:
if frame.source != 'user': if frame.source != 'user':
return return
if frame.act == 'inform/order': if frame.act == 'inform/order':
new_order = dict() new_order = list()
for slot in frame.slots: for slot in frame.slots:
value = normalize(slot.value) value = normalize(slot.value)
slot = self.slot_augmentation(slot, value) slot = self.slot_augmentation(slot, value)
@ -133,7 +133,6 @@ class DialogStateMonitor:
continue continue
if not self.value_valid(slot.name, value): if not self.value_valid(slot.name, value):
continue continue
stage_name = self.get_current_active_stage()['name'] stage_name = self.get_current_active_stage()['name']
is_collect_food = (slot.name == 'pizza' and stage_name == 'collect_food') is_collect_food = (slot.name == 'pizza' and stage_name == 'collect_food')
is_collect_drinks = (slot.name == 'drink' and stage_name == 'collect_drinks') is_collect_drinks = (slot.name == 'drink' and stage_name == 'collect_drinks')
@ -143,7 +142,7 @@ class DialogStateMonitor:
return return
self.state['was_previous_order_invalid'] = False self.state['was_previous_order_invalid'] = False
self.state['total_cost'] += self.state['constants'][slot.name][value]['price'] self.state['total_cost'] += self.state['constants'][slot.name][value]['price']
new_order[slot.name] = value new_order.append((slot.name, value))
if len(new_order) > 0: if len(new_order) > 0:
self.state['belief_state']['order'].append(new_order) self.state['belief_state']['order'].append(new_order)
self.complete_stage_if_valid('collect_food') self.complete_stage_if_valid('collect_food')

View File

@ -158,7 +158,7 @@ templates = {
"Jaki adres dostawy?" "Jaki adres dostawy?"
], ],
"bye_and_thanks": [ "bye_and_thanks": [
"Dziękujemy za zamówienie. Do zobaczenia!", "Dziękujęmy, przekazaliśmy zamówienie do realizacji. Do zobaczenia!",
], ],
"request/phone": [ "request/phone": [
"Podaj proszę numer telefonu do kontaktu dla kuriera." "Podaj proszę numer telefonu do kontaktu dla kuriera."