2021-04-26 00:29:07 +02:00
|
|
|
from NaturalLanguageUnderstanding import NLU
|
2021-04-26 09:57:03 +02:00
|
|
|
from NaturalLanguageGeneration import NLG
|
2021-04-26 00:29:07 +02:00
|
|
|
from DialogueStateTracker import DST
|
|
|
|
from DialoguePolicy import DP
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
|
|
|
nlu = NLU()
|
|
|
|
dst = DST()
|
|
|
|
dp = DP()
|
2021-04-26 09:57:03 +02:00
|
|
|
nlg = NLG()
|
|
|
|
|
|
|
|
while(1):
|
|
|
|
user_input = input("Wpisz tekst: ")
|
2021-04-26 00:29:07 +02:00
|
|
|
|
2021-05-16 16:56:37 +02:00
|
|
|
user_frame = nlu.parse_user_input(user_input)
|
2021-04-26 09:57:03 +02:00
|
|
|
dst.addFrame(user_frame)
|
|
|
|
system_act = dp.chooseTactic(dst.getFrames())
|
|
|
|
text = nlg.toText(system_act)
|
2021-04-26 00:29:07 +02:00
|
|
|
|
2021-04-26 09:57:03 +02:00
|
|
|
print(text)
|
2021-04-26 15:13:52 +02:00
|
|
|
if system_act.isDialogFinished():
|
2021-04-26 09:57:03 +02:00
|
|
|
break
|