Testy skadnikow i ilosci
This commit is contained in:
parent
05876dbd24
commit
9c528afc6c
@ -45,7 +45,7 @@ class DialogStateMonitor:
|
|||||||
was_system_act_processed=False,
|
was_system_act_processed=False,
|
||||||
constants=constants,
|
constants=constants,
|
||||||
history=[],
|
history=[],
|
||||||
system_history=[]
|
system_history=[],
|
||||||
)
|
)
|
||||||
self.state = copy.deepcopy(self.__initial_state)
|
self.state = copy.deepcopy(self.__initial_state)
|
||||||
|
|
||||||
@ -146,27 +146,22 @@ class DialogStateMonitor:
|
|||||||
self.state['total_cost'] += self.state['constants'][slot.name][value]['price']
|
self.state['total_cost'] += self.state['constants'][slot.name][value]['price']
|
||||||
if slot.name == "pizza":
|
if slot.name == "pizza":
|
||||||
if new_order.get("pizza"):
|
if new_order.get("pizza"):
|
||||||
new_order[slot.name].append({"name": value, "quantity": 1, "ingredient": [], "neg/ingredient": []})
|
new_order[slot.name].append({"name": value, "ingredient": [], "ingredient/neg": []})
|
||||||
else:
|
else:
|
||||||
new_order[slot.name] = [{"name": value, "quantity": 1, "ingredient": [], "neg/ingredient": []}]
|
new_order[slot.name] = [{"name": value, "ingredient": [], "ingredient/neg": []}]
|
||||||
elif slot.name == "drink":
|
elif slot.name == "drink":
|
||||||
if new_order.get("drink"):
|
if new_order.get("drink"):
|
||||||
new_order[slot.name].append({"drink": value, "quantity": 1})
|
new_order[slot.name].append({"drink": value})
|
||||||
else:
|
else:
|
||||||
new_order[slot.name] = [{"drink": value, "quantity": 1}]
|
new_order[slot.name] = [{"drink": value}]
|
||||||
|
|
||||||
elif slot.name in ["ingredient", "neg/ingredient"]:
|
elif slot.name in ["ingredient", "neg/ingredient"]:
|
||||||
|
if len(self.state['belief_state']['order']) != 0:
|
||||||
last_order = self.state['belief_state']['order'][-1]
|
last_order = self.state['belief_state']['order'][-1]
|
||||||
if last_order["name"] == "pizza":
|
if last_order["name"] == "pizza":
|
||||||
last_order[slot.name].append(value)
|
last_order[slot.name].append(value)
|
||||||
elif last_order["name"] == "drink":
|
elif last_order["name"] == "drink":
|
||||||
last_order[slot.name].append(value)
|
last_order[slot.name].append(value)
|
||||||
elif slot.name == "quantity":
|
|
||||||
last_order = self.state['belief_state']['order'][-1]
|
|
||||||
if last_order["name"] == "pizza":
|
|
||||||
last_order[slot.name] = value
|
|
||||||
elif last_order["name"] == "drink":
|
|
||||||
last_order[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)
|
||||||
|
Loading…
Reference in New Issue
Block a user