Dodanie modulu taktyki dialogu
This commit is contained in:
parent
abe4577dd6
commit
a8bf975f12
@ -1,4 +1,6 @@
|
|||||||
|
from slot import Slot
|
||||||
|
|
||||||
class Frame:
|
class Frame:
|
||||||
def __init__(self, source: str, text: str):
|
def __init__(self, act: str, slots: list[Slot]):
|
||||||
self.source = source
|
self.slots = slots
|
||||||
self.text = text
|
self.act = act
|
||||||
|
4
src/model/slot.py
Normal file
4
src/model/slot.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
class Slot:
|
||||||
|
def __init__(self, name, value=None):
|
||||||
|
self.name = name
|
||||||
|
self.value = value
|
12
src/service/dialog_policy.py
Normal file
12
src/service/dialog_policy.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
from model.frame import Frame
|
||||||
|
from model.dialogue_act import DialogueAct
|
||||||
|
|
||||||
|
class DialogPolicy:
|
||||||
|
def __init__(self, frames: list[Frame]) -> None:
|
||||||
|
self.frames = frames
|
||||||
|
|
||||||
|
def next_dialogue_act(self) -> Frame:
|
||||||
|
if self.frames[-1].act == "welcomemsg":
|
||||||
|
return Frame("welcomemsg", [])
|
||||||
|
else:
|
||||||
|
return Frame("canthelp", [])
|
Loading…
Reference in New Issue
Block a user