FIX: Naming convention

This commit is contained in:
Damian Bregier 2021-04-26 15:56:03 +02:00
parent 2efe4b2d79
commit 41ef6bfded

View File

@ -9,7 +9,7 @@ class NLU:
#Turn text into frame
#return vector for further use
act = "(greetings()&request(name))"
act = "(hello()&request(name))"
vector = [[0],[1,0]]
return vector
@ -21,8 +21,8 @@ class DP:
self.arguments = arguments
def tacticChoice(self, frame_list):
act_vector = [0, 0]
return act_vector
actVector = [0, 0]
return actVector
#Dialogue State Tracker
class DST:
@ -30,29 +30,31 @@ class DST:
def __init__(self, acts, arguments):
self.acts = acts
self.arguments = arguments
self.frame_list= []
self.frameList= []
#store new act into frame
def store(self, frame):
self.frame_list.append(frame)
self.frameList.append(frame)
def transfer(self):
return self.frame_list
return self.frameList
#Natural Language Generator
class NLG:
def __init__(self, acts, arguments):
self.acts = acts
self.arguments = arguments
def vectorToText(self, act_vector):
if(act_vector == [0, 0]):
return "Cześć, mam na imię Mateusz"
return "Nie rozumiem Cię"
def vectorToText(self, actVector):
if(actVector == [0, 0]):
return "Witaj, nazywam się Mateusz."
else:
return "Przykro mi, nie zrozumiałem Cię"
class Run:
def __init__(self):
self.acts={
0: "greetings",
0: "hello",
1: "request",
}
self.arguments={
@ -64,7 +66,7 @@ class Run:
self.nlg = NLG(self.acts, self.arguments)
self.dst = DST(self.acts, self.arguments)
def process(self, command):
def inputProcessing(self, command):
act = self.nlu.analyze(command)
self.dst.store(act)
@ -76,7 +78,7 @@ class Run:
run = Run()
while(1):
message = input("Napisz coś: ")
print(run.process(message))
print(run.inputProcessing(message))