06-ZDIAUI0-Systemy-dialogow.../nlg.py

18 lines
830 B
Python
Raw Normal View History

2023-05-05 00:07:47 +02:00
from SystemActType import SystemActType
from UserActType import UserActType
class NLG:
def generate_response(self, state, last_user_act, last_system_act, slots, system_act):
if state == UserActType['order']:
if system_act.act == SystemActType['request']:
if system_act.slot == 'kind':
return "Jaką pizzę chcesz zamówić?"
elif system_act.slot == 'size':
return 'Jakiego rozmiaru chcesz pizzę?'
elif system_act.slot == 'plates':
return 'Dla ilu osób ma to być?'
elif last_user_act == UserActType['hello']:
return "Dzień dobry, w czym mogę pomóc?"
else:
return "Przepraszam. Zdanie nie jest mi zrozumiałe. Spróbuj je sformułować w inny sposób."