chat-restaruacja/src/main.py

21 lines
789 B
Python
Raw Normal View History

from model.frame import Frame
from service.dialog_state_monitor import DialogStateMonitor
from service.dialog_policy import DialogPolicy
from service.natural_languag_understanding import NaturalLanguageUnderstanding
print("Natural language understanding, example:")
naturalLanguageUnderstanding = NaturalLanguageUnderstanding()
print(naturalLanguageUnderstanding.convertTextToFrame("Cześć, jak masz na imię?"))
# Example
print("Dialog state monitor, examples:")
monitor = DialogStateMonitor()
monitor.append(Frame('system', 'hello', []))
monitor.append(Frame('user', 'some_text', []))
print(monitor.get_all()[0].act)
print(monitor.get_last().act)
print("Dialog policy, next dialogue act:")
dialog_policy = DialogPolicy(monitor.get_all())
print(dialog_policy.next_dialogue_act().act)