Zmiany z zajęc 18.05.2022
This commit is contained in:
parent
7a000b06b2
commit
40443cbfa6
@ -1,9 +1,24 @@
|
||||
class Dst:
|
||||
def __init__(self):
|
||||
self.messages = []
|
||||
self.checklist = {
|
||||
"from": None,
|
||||
"to": None,
|
||||
"time": None,
|
||||
"passangerCount": None,
|
||||
"discountedCount": None,
|
||||
"seatType": None,
|
||||
"wagonType": None
|
||||
}
|
||||
self.history = []
|
||||
|
||||
def store(self, message):
|
||||
self.messages.append(message)
|
||||
|
||||
def get_messages(self):
|
||||
return self.messages
|
||||
|
||||
def get_next_question(self):
|
||||
for key, value in self.checklist.items():
|
||||
if value == None:
|
||||
return key
|
||||
|
@ -39,6 +39,8 @@ class Nlu:
|
||||
if t in v['parameters']:
|
||||
param.append(t)
|
||||
|
||||
# TODO: Refactor
|
||||
|
||||
|
||||
return (act, param)
|
||||
|
||||
|
@ -10,3 +10,6 @@ if __name__ == "__main__":
|
||||
nlg_params = dp.Dp(*dp_params).identify()
|
||||
# print(nlg_params)
|
||||
print(f"{msg}\n{nlg.Nlg(nlg_params).response()}")
|
||||
|
||||
d = dst.Dst()
|
||||
print(d.get_next_question())
|
||||
|
Loading…
Reference in New Issue
Block a user