2024-05-03 00:30:43 +02:00
|
|
|
from model.frame import Frame
|
|
|
|
from service.dialog_state_monitor import DialogStateMonitor
|
|
|
|
from service.dialog_policy import DialogPolicy
|
2024-05-03 00:35:50 +02:00
|
|
|
from service.natural_languag_understanding import NaturalLanguageUnderstanding
|
2024-04-19 21:22:02 +02:00
|
|
|
|
2024-05-03 00:35:50 +02:00
|
|
|
print("Natural language understanding, example:")
|
|
|
|
naturalLanguageUnderstanding = NaturalLanguageUnderstanding()
|
|
|
|
print(naturalLanguageUnderstanding.convertTextToFrame("Cześć, jak masz na imię?"))
|
2024-04-19 21:22:02 +02:00
|
|
|
|
|
|
|
# Example
|
2024-05-03 00:30:43 +02:00
|
|
|
print("Dialog state monitor, examples:")
|
2024-04-19 21:22:02 +02:00
|
|
|
monitor = DialogStateMonitor()
|
2024-05-03 00:30:43 +02:00
|
|
|
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)
|