still wip
This commit is contained in:
parent
c9f0dfeb3a
commit
f201155d1a
@ -1,9 +1,9 @@
|
|||||||
import jsgf
|
#import jsgf
|
||||||
|
|
||||||
from Modules.NLG_module import NLG
|
from Modules.NLG_module import NLG
|
||||||
from Modules.DP_module import DP
|
from Modules.DP_module import DP
|
||||||
from Modules.DST_module import Rules_DST
|
from Modules.DST_module import Rules_DST
|
||||||
from Modules.Book_NLU_module import Book_NLU
|
# from Modules.Book_NLU_module import Book_NLU
|
||||||
from Modules.ML_NLU_module import ML_NLU
|
from Modules.ML_NLU_module import ML_NLU
|
||||||
|
|
||||||
import random
|
import random
|
||||||
@ -23,7 +23,7 @@ class Janet:
|
|||||||
self.nlg = NLG()
|
self.nlg = NLG()
|
||||||
self.dp = DP()
|
self.dp = DP()
|
||||||
self.dst = Rules_DST()
|
self.dst = Rules_DST()
|
||||||
self.nlu = Book_NLU(jsgf.parse_grammar_file('book.jsgf'))
|
#self.nlu = Book_NLU(jsgf.parse_grammar_file('book.jsgf'))
|
||||||
self.nlu_v2 = ML_NLU()
|
self.nlu_v2 = ML_NLU()
|
||||||
|
|
||||||
def process(self, command):
|
def process(self, command):
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import jsgf
|
|
||||||
from tabulate import tabulate
|
|
||||||
from flair.data import Sentence, Token
|
from flair.data import Sentence, Token
|
||||||
from flair.datasets import SentenceDataset
|
from flair.datasets import SentenceDataset
|
||||||
from flair.models import SequenceTagger
|
from flair.models import SequenceTagger
|
||||||
|
@ -22,13 +22,19 @@ class NLG:
|
|||||||
if(len(act) == 0):
|
if(len(act) == 0):
|
||||||
return "Nie mam już nic do powiedzenia :("
|
return "Nie mam już nic do powiedzenia :("
|
||||||
|
|
||||||
for variable in act:
|
domain, intent = act[0]
|
||||||
domain, intent = variable
|
|
||||||
|
|
||||||
if (domain == "inform"):
|
if (domain == "inform"):
|
||||||
return "test"
|
return "test"
|
||||||
if(domain == "greeting"):
|
|
||||||
return random.choice(["Cześć, mam na imię Janet", "Hej, jestem Janet. W czym mogę pomóc?", "Dzień dobry, nazywam się Janet"])
|
if(domain == "greeting"):
|
||||||
|
return random.choice(["Cześć, mam na imię Janet", "Hej, jestem Janet. W czym mogę pomóc?", "Dzień dobry, nazywam się Janet"])
|
||||||
|
|
||||||
|
if(domain == "end_conversation"):
|
||||||
|
return random.choice(["Dziękujemy za skorzystanie z naszych usług!", "Do widzenia!", "Do zobaczenia!"])
|
||||||
|
|
||||||
|
if(domain == "appointment"):
|
||||||
|
if(intent == "book_appointent"):
|
||||||
|
answer = "Zarezerwowano wizytę"
|
||||||
|
print(variable)
|
||||||
|
|
||||||
elif(domain == "end_conversation"):
|
|
||||||
return random.choice(["Dziękujemy za skorzystanie z naszych usług!", "Do widzenia!", "Do zobaczenia!"])
|
|
||||||
|
Loading…
Reference in New Issue
Block a user