still wip

This commit is contained in:
Anna Nowak 2021-06-07 08:20:21 +02:00
parent c9f0dfeb3a
commit f201155d1a
3 changed files with 17 additions and 13 deletions

View File

@ -1,9 +1,9 @@
import jsgf
#import jsgf
from Modules.NLG_module import NLG
from Modules.DP_module import DP
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
import random
@ -23,7 +23,7 @@ class Janet:
self.nlg = NLG()
self.dp = DP()
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()
def process(self, command):

View File

@ -1,5 +1,3 @@
import jsgf
from tabulate import tabulate
from flair.data import Sentence, Token
from flair.datasets import SentenceDataset
from flair.models import SequenceTagger

View File

@ -22,13 +22,19 @@ class NLG:
if(len(act) == 0):
return "Nie mam już nic do powiedzenia :("
for variable in act:
domain, intent = variable
domain, intent = act[0]
if (domain == "inform"):
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"])
elif(domain == "end_conversation"):
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)