SystemyDialogowe/main.py
Łukasz Jędyk f343ebec98 fix DST bugs
2021-05-31 14:53:20 +02:00

36 lines
1.1 KiB
Python

from SystemActType import SystemActType
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(dst)
nlg = NLG()
while(1):
user_input = input("Wpisz tekst: ")
user_frame = nlu.parse_user_input(user_input)
print('------ rozpoznany user frame ------')
print(user_frame)
dst.user_update(user_frame)
state, last_user_act, last_system_act = dst.get_dialogue_state()
slots = dst.get_dialogue_slots()
system_act = dp.chooseTactic()
print('------ stan ------')
print(state, last_user_act, last_system_act)
print('------ przechowywane sloty ------')
print(slots)
print('------ wybrana akcja systemu ------')
print(system_act)
print('-----------------------------------')
print('-----------------------------------')
#text = nlg.toText(system_act)
if system_act.getActType() == SystemActType.BYE:
break