Restart act
This commit is contained in:
parent
db6e02e547
commit
dfc964d63a
@ -117,7 +117,12 @@ class DST(dst.DST):
|
||||
|
||||
elif act == 'request':
|
||||
pass
|
||||
|
||||
elif act == 'restart':
|
||||
self.state["belief_state"] = default_state()["belief_state"]
|
||||
self.state["booked"] = {}
|
||||
self.state["request_state"] = []
|
||||
self.state["terminated"] = False
|
||||
self.state["history"] = []
|
||||
return self.state
|
||||
|
||||
|
||||
@ -149,6 +154,9 @@ class DP():
|
||||
self.state['terminated'] = True
|
||||
# potwierdz i zakoncz, podsumuj zamowienie
|
||||
|
||||
elif self.state['user_action'][-1] == 'restart':
|
||||
system_action = 'welcomemsg'
|
||||
# zachowaj sie jak na poczatku rozmowy
|
||||
else:
|
||||
system_action = 'inform'
|
||||
# poinformuj o wybranych slotach z "request_state"
|
||||
@ -222,4 +230,26 @@ if __name__ == "__main__":
|
||||
response = model("Dobrze, nie mogę się już doczekać.")
|
||||
assert response == "bye"
|
||||
|
||||
print()
|
||||
print("----Testowanie restartu-------")
|
||||
|
||||
model = Model()
|
||||
response = model("Siema, w czym możesz mi pomóc?")
|
||||
assert response == "welcomemsg"
|
||||
response = model("Interesują mnie dania kuchni włoskiej oraz meksykanskiej.")
|
||||
assert response == "offer"
|
||||
response = model("Chciałbym zjesc tatara")
|
||||
assert response == "inform"
|
||||
response = model("uniwersytetu poznanskiego 4 61-614 poznan")
|
||||
assert response == "inform"
|
||||
response = model("od nowa")
|
||||
assert response == "welcomemsg"
|
||||
response = model("Interesują mnie dania kuchni włoskiej oraz meksykanskiej.")
|
||||
assert response == "offer"
|
||||
response = model("Chciałbym zjesc tatara")
|
||||
assert response == "inform"
|
||||
response = model("uniwersytetu poznanskiego 4 61-614 poznan")
|
||||
assert response == "inform"
|
||||
response = model("Zapłacę kartą przy odbiorze")
|
||||
assert response == "inform"
|
||||
response = model("Dobrze, nie mogę się już doczekać.")
|
||||
assert response == "bye"
|
Loading…
Reference in New Issue
Block a user