From 1528307ac6141328f375c61766f3c36b413d6101 Mon Sep 17 00:00:00 2001 From: Adrian Charkiewicz Date: Tue, 19 Apr 2022 02:10:28 +0200 Subject: [PATCH] DST --- data/.~lock.dialog-16-03-01.tsv# | 1 - data/.~lock.dialog-16-05-01.tsv# | 1 - data/.~lock.dialog-16-07-01.tsv# | 1 - data/.~lock.dialog-16-11-01.tsv# | 1 - data/.~lock.dialog-16-15-01.tsv# | 1 - data/.~lock.dialog-16-17-01.tsv# | 1 - data/.~lock.dialog-16-19-01.tsv# | 1 - data/.~lock.dialog-17-04-02.tsv# | 1 + data/.~lock.dialog-17-04-04.tsv# | 1 - data/dialog-18-11-01.tsv | 6 +++--- src/components/DST.py | 21 +++++++++++++++++---- src/components/NLU.py | 3 ++- 12 files changed, 23 insertions(+), 16 deletions(-) delete mode 100644 data/.~lock.dialog-16-03-01.tsv# delete mode 100644 data/.~lock.dialog-16-05-01.tsv# delete mode 100644 data/.~lock.dialog-16-07-01.tsv# delete mode 100644 data/.~lock.dialog-16-11-01.tsv# delete mode 100644 data/.~lock.dialog-16-15-01.tsv# delete mode 100644 data/.~lock.dialog-16-17-01.tsv# delete mode 100644 data/.~lock.dialog-16-19-01.tsv# create mode 100644 data/.~lock.dialog-17-04-02.tsv# delete mode 100644 data/.~lock.dialog-17-04-04.tsv# diff --git a/data/.~lock.dialog-16-03-01.tsv# b/data/.~lock.dialog-16-03-01.tsv# deleted file mode 100644 index 737f967..0000000 --- a/data/.~lock.dialog-16-03-01.tsv# +++ /dev/null @@ -1 +0,0 @@ -,DESKTOP-QF2J2E3/riraa,DESKTOP-QF2J2E3,12.04.2022 12:56,file:///C:/Users/riraa/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/data/.~lock.dialog-16-05-01.tsv# b/data/.~lock.dialog-16-05-01.tsv# deleted file mode 100644 index 737f967..0000000 --- a/data/.~lock.dialog-16-05-01.tsv# +++ /dev/null @@ -1 +0,0 @@ -,DESKTOP-QF2J2E3/riraa,DESKTOP-QF2J2E3,12.04.2022 12:56,file:///C:/Users/riraa/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/data/.~lock.dialog-16-07-01.tsv# b/data/.~lock.dialog-16-07-01.tsv# deleted file mode 100644 index 737f967..0000000 --- a/data/.~lock.dialog-16-07-01.tsv# +++ /dev/null @@ -1 +0,0 @@ -,DESKTOP-QF2J2E3/riraa,DESKTOP-QF2J2E3,12.04.2022 12:56,file:///C:/Users/riraa/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/data/.~lock.dialog-16-11-01.tsv# b/data/.~lock.dialog-16-11-01.tsv# deleted file mode 100644 index 737f967..0000000 --- a/data/.~lock.dialog-16-11-01.tsv# +++ /dev/null @@ -1 +0,0 @@ -,DESKTOP-QF2J2E3/riraa,DESKTOP-QF2J2E3,12.04.2022 12:56,file:///C:/Users/riraa/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/data/.~lock.dialog-16-15-01.tsv# b/data/.~lock.dialog-16-15-01.tsv# deleted file mode 100644 index 737f967..0000000 --- a/data/.~lock.dialog-16-15-01.tsv# +++ /dev/null @@ -1 +0,0 @@ -,DESKTOP-QF2J2E3/riraa,DESKTOP-QF2J2E3,12.04.2022 12:56,file:///C:/Users/riraa/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/data/.~lock.dialog-16-17-01.tsv# b/data/.~lock.dialog-16-17-01.tsv# deleted file mode 100644 index 737f967..0000000 --- a/data/.~lock.dialog-16-17-01.tsv# +++ /dev/null @@ -1 +0,0 @@ -,DESKTOP-QF2J2E3/riraa,DESKTOP-QF2J2E3,12.04.2022 12:56,file:///C:/Users/riraa/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/data/.~lock.dialog-16-19-01.tsv# b/data/.~lock.dialog-16-19-01.tsv# deleted file mode 100644 index 737f967..0000000 --- a/data/.~lock.dialog-16-19-01.tsv# +++ /dev/null @@ -1 +0,0 @@ -,DESKTOP-QF2J2E3/riraa,DESKTOP-QF2J2E3,12.04.2022 12:56,file:///C:/Users/riraa/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/data/.~lock.dialog-17-04-02.tsv# b/data/.~lock.dialog-17-04-02.tsv# new file mode 100644 index 0000000..39fbc12 --- /dev/null +++ b/data/.~lock.dialog-17-04-02.tsv# @@ -0,0 +1 @@ +,DESKTOP-QF2J2E3/riraa,DESKTOP-QF2J2E3,19.04.2022 01:25,file:///C:/Users/riraa/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/data/.~lock.dialog-17-04-04.tsv# b/data/.~lock.dialog-17-04-04.tsv# deleted file mode 100644 index c2d516f..0000000 --- a/data/.~lock.dialog-17-04-04.tsv# +++ /dev/null @@ -1 +0,0 @@ -,DESKTOP-QF2J2E3/riraa,DESKTOP-QF2J2E3,12.04.2022 22:32,file:///C:/Users/riraa/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/data/dialog-18-11-01.tsv b/data/dialog-18-11-01.tsv index 23279f4..b2b0f21 100644 --- a/data/dialog-18-11-01.tsv +++ b/data/dialog-18-11-01.tsv @@ -17,10 +17,10 @@ system Jaki termin cię interesuje? request(date) user 22.03.2022 inform(date=2022-03-22) system Wybrana data jest z przeszłości. Proszę o podanie poprawnego terminu. repeat() user Jutro, po godzinie 16:00 inform(date=2022-03-24) -system Dostępne godziny to: 17:45, 20:30. select(time) +system Dostępne godziny to: 17:45, 20:30. select(time) user Jaki jutro jest dzień tygodnia? request(date) system Jutro jest czwartek, 24.03.2022. inform(date=2022-03-24) -user To poproszę o rezerwację na 17L45 null() +user To poproszę o rezerwację na 17L45 null() system Proszę o powtórzenie terminu rezerwacji. repeat() user 17:45 inform(time=17:45) system Gdzie chciałbyś usiąść? request(area) @@ -29,4 +29,4 @@ system Zostało ci przydzielone miejsce L8. Numer twojej rezerwacji to 35263. in user W jakiej części rzędu znajduje się to miejsce? request(area) system Miejsce L8 znajduje się w środkowej części przedostatniego rzędu. inform(area=[back, middle]) user Dziękuję thankyou() -system Dziękujemy za skorzystanie z usług systemu kinowego Nachos. Miłego dnia. bye() \ No newline at end of file +system Dziękujemy za skorzystanie z usług systemu kinowego Nachos. Miłego dnia. bye() diff --git a/src/components/DST.py b/src/components/DST.py index b47e985..2a662b1 100644 --- a/src/components/DST.py +++ b/src/components/DST.py @@ -1,10 +1,23 @@ # Adrian class DST: - def __self__(): + def __self__(self): pass - def getDialogueState(userActs): + # is it the only one slot that we need? + slots = {'name': None} + + def getDialogueState(self, userActs): # iterate over speech acts - # fill slots + + for k, v in userActs['inform'].items(): + if k == 'name': + self.slots['name'] = v + print(self.slots) + # returns all slots - pass \ No newline at end of file + pass + + +dst = DST() +userActs = {'inform': {'name': 'edyta', 'age': 18}, 'reqmore': {'date', 'time'}} +dst.getDialogueState(userActs) diff --git a/src/components/NLU.py b/src/components/NLU.py index dd8774f..de7cb49 100644 --- a/src/components/NLU.py +++ b/src/components/NLU.py @@ -23,4 +23,5 @@ class NLU: # returns user speech act - return \ No newline at end of file + return # wyobrażam sobie to jako słownik list krotek UwU {inform:[('name','edyta'), ('age','18')], reqmore:[date,time]} + #słownik słowników???? {inform:{'name':'edyta', 'age':18}, reqmore:{'date','time'}} albo słownik słowników/zbiorów bardziej pasuje \ No newline at end of file