SystemyDialogowe/main.py
Łukasz Jędyk 8628e68e79 grammar nlu
2021-05-16 23:11:55 +02:00

25 lines
596 B
Python

from NaturalLanguageUnderstanding import NLU
from NaturalLanguageGeneration import NLG
from DialogueStateTracker import DST
from DialoguePolicy import DP
if __name__ == "__main__":
nlu = NLU()
dst = DST()
dp = DP()
nlg = NLG()
while(1):
user_input = input("Wpisz tekst: ")
user_frame = nlu.parse_user_input(user_input)
print(str(user_frame))
dst.addFrame(user_frame)
system_act = dp.chooseTactic(dst.getFrames())
text = nlg.toText(system_act)
print(text)
if system_act.isDialogFinished():
break