From 031fdff7576a4ac4515054ee3ef5d3448f4b6f58 Mon Sep 17 00:00:00 2001 From: s459312 Date: Thu, 15 Jun 2023 19:50:31 +0200 Subject: [PATCH] fix and start interaction --- system3.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/system3.py b/system3.py index 702f2c4..928c5fc 100644 --- a/system3.py +++ b/system3.py @@ -102,7 +102,7 @@ class NLU: def __init__(self): pass - def extract_acts_and_slots(text): + def extract_acts_and_slots(self, text): doc = nlp(text) acts = [] @@ -131,14 +131,14 @@ class NLU: return acts - def find_product_type(product): + def find_product_type(self, product): for product_type, products in product_type_rules.items(): if product in products: return product_type, product return None, None -text = "Cześć, chciałbym kupić mleko, sok oraz chleb" +text = "Cześć, chciałbym kupić mleko, płatki oraz owoce" nlu = NLU() acts = nlu.extract_acts_and_slots(text) for act in acts: @@ -149,7 +149,7 @@ for act in acts: dst = DialogStateTracker() -text = "Cześć, chciałbym kupić mleko, sok oraz chleb" +text = "Cześć, chciałbym kupić mleko, płatki oraz owoce" acts = nlu.extract_acts_and_slots(text) @@ -159,4 +159,6 @@ dst.update_state(acts) dialog_state = dst.get_state() print("Dialog State:") -print(dialog_state) \ No newline at end of file +print(dialog_state) +dm = DialogManager(nlu ,dst) +dm.start_dialog() \ No newline at end of file