Test
This commit is contained in:
parent
35a19cc5c0
commit
3fb60acd4f
@ -34,12 +34,12 @@ class DialogStateMonitor:
|
||||
},
|
||||
total_cost=0,
|
||||
stages=[
|
||||
{'completed': False, 'name': 'collect_food', "confirmed": False},
|
||||
# {'completed': False, 'name': 'more_food', "confirmed": False},
|
||||
{'completed': False, 'name': 'collect_drinks', "confirmed": False},
|
||||
# {'completed': False, 'name': 'more_drinks', "confirmed": False},
|
||||
{'completed': False, 'name': 'collect_address', "confirmed": False},
|
||||
{'completed': False, 'name': 'collect_phone', "confirmed": False},
|
||||
{'completed': False, 'name': 'collect_food'},
|
||||
{'completed': False, 'name': 'more_food'},
|
||||
{'completed': False, 'name': 'collect_drinks'},
|
||||
{'completed': False, 'name': 'more_drinks'},
|
||||
{'completed': False, 'name': 'collect_address'},
|
||||
{'completed': False, 'name': 'collect_phone'},
|
||||
],
|
||||
was_previous_order_invalid=False,
|
||||
was_system_act_processed=False,
|
||||
@ -125,7 +125,7 @@ class DialogStateMonitor:
|
||||
if frame.source != 'user':
|
||||
return
|
||||
if frame.act == 'inform/order':
|
||||
new_order = dict()
|
||||
new_order = list()
|
||||
for slot in frame.slots:
|
||||
value = normalize(slot.value)
|
||||
slot = self.slot_augmentation(slot, value)
|
||||
@ -133,7 +133,6 @@ class DialogStateMonitor:
|
||||
continue
|
||||
if not self.value_valid(slot.name, value):
|
||||
continue
|
||||
|
||||
stage_name = self.get_current_active_stage()['name']
|
||||
is_collect_food = (slot.name == 'pizza' and stage_name == 'collect_food')
|
||||
is_collect_drinks = (slot.name == 'drink' and stage_name == 'collect_drinks')
|
||||
@ -143,7 +142,7 @@ class DialogStateMonitor:
|
||||
return
|
||||
self.state['was_previous_order_invalid'] = False
|
||||
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:
|
||||
self.state['belief_state']['order'].append(new_order)
|
||||
self.complete_stage_if_valid('collect_food')
|
||||
|
@ -158,7 +158,7 @@ templates = {
|
||||
"Jaki adres dostawy?"
|
||||
],
|
||||
"bye_and_thanks": [
|
||||
"Dziękujemy za zamówienie. Do zobaczenia!",
|
||||
"Dziękujęmy, przekazaliśmy zamówienie do realizacji. Do zobaczenia!",
|
||||
],
|
||||
"request/phone": [
|
||||
"Podaj proszę numer telefonu do kontaktu dla kuriera."
|
||||
|
Loading…
Reference in New Issue
Block a user