From 41ef6bfded5a51b8e424f75031d58d48fff04f4d Mon Sep 17 00:00:00 2001 From: Damian Bregier Date: Mon, 26 Apr 2021 15:56:03 +0200 Subject: [PATCH] FIX: Naming convention --- Modules.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Modules.py b/Modules.py index 62b9307..8b1bf21 100644 --- a/Modules.py +++ b/Modules.py @@ -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))