Testy skadnikow i ilosci
This commit is contained in:
parent
73b9e52d31
commit
bf309fb6fe
@ -146,15 +146,26 @@ class DialogStateMonitor:
|
||||
self.state['total_cost'] += self.state['constants'][slot.name][value]['price']
|
||||
if slot.name == "pizza":
|
||||
if new_order.get("pizza"):
|
||||
new_order[slot.name].append(value)
|
||||
new_order[slot.name].append({"name": value, "quantity": 1, "ingredient": [], "neg/ingredient": []})
|
||||
else:
|
||||
new_order[slot.name] = [value]
|
||||
new_order[slot.name] = [{"name": value, "quantity": 1, "ingredient": [], "neg/ingredient": []}]
|
||||
elif slot.name == "drink":
|
||||
if new_order.get("drink"):
|
||||
new_order[slot.name].append(value)
|
||||
new_order[slot.name].append({"drink": value, "quantity": 1})
|
||||
else:
|
||||
new_order[slot.name] = [value]
|
||||
|
||||
new_order[slot.name] = [{"drink": value, "quantity": 1}]
|
||||
|
||||
elif slot.name in ["ingredient", "neg/ingredient"]:
|
||||
last_order = self.state['belief_state']['order'][-1]
|
||||
if last_order["name"] == "pizza":
|
||||
last_order[slot.name].append(value)
|
||||
elif last_order["name"] == "drink":
|
||||
last_order[slot.name].append(value)
|
||||
elif slot.name == "quantity":
|
||||
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:
|
||||
self.state['belief_state']['order'].append(new_order)
|
||||
|
Loading…
Reference in New Issue
Block a user