mockup #7
@ -1,9 +1,10 @@
|
|||||||
# Martyna
|
# Martyna
|
||||||
class DP:
|
class DP:
|
||||||
def __self__(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def getAct(self, slots):
|
def __init__(self, slots):
|
||||||
|
self.slots = slots
|
||||||
|
|
||||||
|
def getAct(slots):
|
||||||
# iterate over slots
|
# iterate over slots
|
||||||
# find empty
|
# find empty
|
||||||
# returns system act
|
# returns system act
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
# Adrian
|
# Adrian
|
||||||
class DST:
|
class DST:
|
||||||
def __self__(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
# is it the only one slot that we need?
|
|
||||||
slots = {'name': None}
|
|
||||||
|
|
||||||
def getDialogueState(self, userActs):
|
def getDialogueState(self, userActs):
|
||||||
# iterate over speech acts
|
# iterate over speech acts
|
||||||
|
@ -3,5 +3,5 @@ class NLG:
|
|||||||
def __self__(self):
|
def __self__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def getResponse(self, systemAct):
|
def getResponse(systemAct):
|
||||||
return "Witaj, nazywam się Cheddar.\n"
|
return "Witaj, nazywam się Nachos.\n"
|
@ -2,6 +2,7 @@ from jsgf import PublicRule, Grammar
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
class NLU:
|
class NLU:
|
||||||
|
|
||||||
def get_str_cleaned(str_dirty):
|
def get_str_cleaned(str_dirty):
|
||||||
punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\\\]^_`{|}~'
|
punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\\\]^_`{|}~'
|
||||||
new_str = str_dirty.lower()
|
new_str = str_dirty.lower()
|
||||||
@ -25,7 +26,3 @@ class NLU:
|
|||||||
return NLU.getDialogAct(matched[0])
|
return NLU.getDialogAct(matched[0])
|
||||||
else:
|
else:
|
||||||
return {'act': 'null', 'slots': []}
|
return {'act': 'null', 'slots': []}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print(nlu.nlu("Cześć, jak masz na imię?"))
|
|
@ -1,5 +1,19 @@
|
|||||||
from components.NLU import NLU
|
from components.NLU import NLU
|
||||||
from components.NLG import NLG
|
from components.NLG import NLG
|
||||||
|
|
||||||
|
slots = [
|
||||||
|
("title", None),
|
||||||
|
("date", None),
|
||||||
|
("time", None),
|
||||||
|
("quantity", None),
|
||||||
|
("location", None),
|
||||||
|
("seats", None),
|
||||||
|
("reservation_id", None),
|
||||||
|
("goal", None),
|
||||||
|
("area", None),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def generate_response(input):
|
def generate_response(input):
|
||||||
result = NLU.nlu(input)
|
result = NLU.nlu(input)
|
||||||
return result
|
return result
|
||||||
|
Loading…
Reference in New Issue
Block a user