From ede9b13a0b8c32483545d36433c35dcd92dd7c60 Mon Sep 17 00:00:00 2001 From: s444417 Date: Sun, 13 Mar 2022 11:08:52 +0100 Subject: [PATCH 1/6] add condition --- .idea/.gitignore | 3 ++ .idea/Systemy dialogowe.iml | 8 +++++ .idea/inspectionProfiles/Project_Default.xml | 31 +++++++++++++++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++++ .idea/misc.xml | 4 +++ .idea/modules.xml | 8 +++++ .idea/vcs.xml | 6 ++++ cheddar.py | 16 ++++++++-- eliza.py | 2 ++ 9 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/Systemy dialogowe.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 eliza.py diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/Systemy dialogowe.iml b/.idea/Systemy dialogowe.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/Systemy dialogowe.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..ae5a833 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,31 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d1e22ec --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..c30d6aa --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/cheddar.py b/cheddar.py index 7e970ca..a4b332c 100644 --- a/cheddar.py +++ b/cheddar.py @@ -7,7 +7,6 @@ reflections = { "bylem": "byles", "bylam": "bylas", "ja": "ty", - "jestem": "jestes", "chcialbym": "chcialbys", "chcialabym": "chcialabys", "mam": "masz", @@ -21,7 +20,6 @@ reflections = { "masz": "mam", "bedziesz": "bede", "twoj": "moj", - "twoja": "moja", "twoim": "moim", "twojego": "mojego", "ty": "ja", @@ -100,6 +98,20 @@ pairs = ( "Jesli %1, to co jeszcze musi byc prawda?", ), ), + ( + r"quit", ( + "Do uslyszenia", + "Czesc" + ), + ), + ( + r"(.*)", + ( + "Zmienmy na chwile temat, powiedz mi o swojej rodzinie", + "%1?", + "Dlaczego tak mowisz?", + ), + ), ) cheddar = Chat(pairs, reflections) diff --git a/eliza.py b/eliza.py new file mode 100644 index 0000000..b032d50 --- /dev/null +++ b/eliza.py @@ -0,0 +1,2 @@ +from nltk.chat import eliza +eliza.demo() \ No newline at end of file -- 2.20.1 From 9f8dd8792b1c7de883bd39f6f65f9912a99687fb Mon Sep 17 00:00:00 2001 From: s444417 Date: Sun, 13 Mar 2022 13:40:06 +0100 Subject: [PATCH 2/6] remove .idea file --- .gitignore | 1 + .idea/.gitignore | 3 -- .idea/Systemy dialogowe.iml | 8 ----- .idea/inspectionProfiles/Project_Default.xml | 31 ------------------- .../inspectionProfiles/profiles_settings.xml | 6 ---- .idea/misc.xml | 4 --- .idea/modules.xml | 8 ----- .idea/vcs.xml | 6 ---- 8 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/Systemy dialogowe.iml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.gitignore b/.gitignore index 93d2055..d973327 100644 --- a/.gitignore +++ b/.gitignore @@ -211,3 +211,4 @@ fabric.properties # Android studio 3.1+ serialized cache file .idea/caches/build_file_checksums.ser +.idea \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/Systemy dialogowe.iml b/.idea/Systemy dialogowe.iml deleted file mode 100644 index d0876a7..0000000 --- a/.idea/Systemy dialogowe.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index ae5a833..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index d1e22ec..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index c30d6aa..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file -- 2.20.1 From 8f26e101423472d7b14784224604dd2e64b78faf Mon Sep 17 00:00:00 2001 From: s444417 Date: Wed, 16 Mar 2022 12:33:09 +0100 Subject: [PATCH 3/6] diaglogue branch --- lab/02-analiza-wymagan.ipynb | 122 ++++++++++++++++++++++++++++ tasks/zad2/requirements-analysis.md | 37 +++++++++ 2 files changed, 159 insertions(+) create mode 100644 lab/02-analiza-wymagan.ipynb create mode 100644 tasks/zad2/requirements-analysis.md diff --git a/lab/02-analiza-wymagan.ipynb b/lab/02-analiza-wymagan.ipynb new file mode 100644 index 0000000..9518d54 --- /dev/null +++ b/lab/02-analiza-wymagan.ipynb @@ -0,0 +1,122 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "collapsed": false + }, + "source": [ + "![Logo 1](https://git.wmi.amu.edu.pl/AITech/Szablon/raw/branch/master/Logotyp_AITech1.jpg)\n", + "
\n", + "

Systemy Dialogowe

\n", + "

2. Analiza wymaga\u0144 [laboratoria]

\n", + "

Marek Kubis (2021)

\n", + "
\n", + "\n", + "![Logo 2](https://git.wmi.amu.edu.pl/AITech/Szablon/raw/branch/master/Logotyp_AITech2.jpg)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Analiza Wymaga\u0144\n", + "===============\n", + "\n", + "Projektowanie system\u00f3w dialogowych\n", + "----------------------------------\n", + "\n", + "Projektowanie systemu dialogowego jest procesem [zorientowanym na u\u017cytkownika](https://en.wikipedia.org/wiki/User-centered_design) (por. Jurafsky and Martin, 2020; Gould and Lewis, 1985), kt\u00f3ry wymaga:\n", + "\n", + " 1. Analizy tego kim jest docelowy u\u017cytkownik systemu i na czym polegaj\u0105 zadania (cele), kt\u00f3re chce on zrealizowa\u0107.\n", + "\n", + " 2. Budowy symulator\u00f3w i prototyp\u00f3w.\n", + "\n", + " 3. Przyrostowego rozwoju i testowania z udzia\u0142em u\u017cytkownik\u00f3w.\n", + "\n", + "Punktami 2 i 3 zajmiemy si\u0119 na kolejnych zaj\u0119ciach. Tematem dzisiejszych zaj\u0119\u0107 jest punkt 1.\n", + "\n", + "Zadania\n", + "-------\n", + " 1. Wybra\u0107 temat projektu.\n", + "\n", + " 2. Zidentyfikowa\u0107 podstawowe zadania (cele), kt\u00f3re u\u017cytkownik chce zrealizowa\u0107 korzystaj\u0105c z systemu.\n", + "\n", + " 3. Dla ka\u017cdego zidentyfikowanego zadania napisa\u0107 przyk\u0142adowy dialog, w toku kt\u00f3rego system zrealizuje cel u\u017cytkownika.\n", + "\n", + " 4. Dialogi zapisa\u0107 w dokumencie `requirements-analysis.md` i umie\u015bci\u0107 w katalogu g\u0142\u00f3wnym ga\u0142\u0119zi\n", + " `master` repozytorium projektowego. Dokument prosz\u0119 przygotowa\u0107 korzystaj\u0105c z\n", + " [szablonu](requirements-analysis.md).\n", + "\n", + "Przyk\u0142adowe tematy projekt\u00f3w\n", + "----------------------------\n", + "\n", + " - System przyjmowania zam\u00f3wie\u0144 w restauracji\n", + "\n", + " - System rezerwacji pokoi hotelowych\n", + "\n", + " - System rezerwacji wizyt u lekarza\n", + "\n", + " - System sprzeda\u017cy bilet\u00f3w kinowych\n", + "\n", + " - System sprzeda\u017cy bilet\u00f3w kolejowych\n", + "\n", + " - System obs\u0142ugi wypo\u017cycze\u0144 w bibliotece\n", + "\n", + " - Asystent zarz\u0105dzaj\u0105cy kalendarzem spotka\u0144\n", + "\n", + " - Asystent wykonuj\u0105cy podstawowe czynno\u015bci w systemie operacyjnym" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Metody pozyskiwania danych do budowy system\u00f3w dialogowych\n", + "---------------------------------------------------------\n", + " 1. Eksperymenty typu Czarnoksi\u0119\u017cnik z Oz (temat naszych nast\u0119pnych zaj\u0119\u0107).\n", + "\n", + " 2. Zapisy rozm\u00f3w z operatorami infolinii (RODO!).\n", + "\n", + " 3. Dokumenty typu FAQ.\n", + "\n", + " 3. Dialogi z innych, zbli\u017conych dziedzin.\n", + "\n", + " 4. Dane dialogowe og\u00f3lnego przeznaczenia:\n", + "\n", + " - napisy filmowe: [OpenSubtitles](https://opus.nlpl.eu/OpenSubtitles-v2018.php)\n", + "\n", + " - logi z IRCa: [Ubuntu Dialogue Corpus](https://github.com/rkadlec/ubuntu-ranking-dataset-creator)\n", + "\n", + " - dyskusje na twitterze.\n", + "\n", + "Literatura\n", + "----------\n", + " 1. Dan Jurafsky and James H. Martin, *Speech and Language Processing*, 3rd ed. draft,\n", + "\tch. 24, Chatbots and Dialogue Systems,\n", + " https://web.stanford.edu/~jurafsky/slp3/24.pdf,\n", + " data dost\u0119pu: 14 lutego 2021.\n", + "\n", + " 2. Gould, J. D. and Lewis, C. (1985). Designing for usability:\n", + " Key principles and what designers think. CACM 28(3), 300\u2013311.\n", + " http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.84.8860&rep=rep1&type=pdf,\n", + " data dost\u0119pu: 21 lutego 2021." + ] + } + ], + "metadata": { + "jupytext": { + "cell_metadata_filter": "-all", + "main_language": "python", + "notebook_metadata_filter": "-all" + }, + "author": "Marek Kubis", + "email": "mkubis@amu.edu.pl", + "lang": "pl", + "subtitle": "2.Analiza wymaga\u0144[laboratoria]", + "title": "Systemy Dialogowe", + "year": "2021" + }, + "nbformat": 4, + "nbformat_minor": 4 +} \ No newline at end of file diff --git a/tasks/zad2/requirements-analysis.md b/tasks/zad2/requirements-analysis.md new file mode 100644 index 0000000..a851adb --- /dev/null +++ b/tasks/zad2/requirements-analysis.md @@ -0,0 +1,37 @@ +Tytuł Projektu +============== + +Zadanie 1: Anulowanie rezerwacji +-------------------------------- + +*system:* Witamy w systemie rezerwacji pokoi hotelowych. + +*user:* Dzień dobry, chciałbym anulować rezerwację. + +*system:* Proszę podać numer rezerwacji. + +*user:* 1234567890 + +*system:* Rezerwacja nr 1234567890 pokoju jednoosobowego w dniach 21.04-23.04. Proszę podać hasło. + +*user:* 3333 + +*system:* Rezerwacja została anulowana. + +Zadanie 2: Nazwa zadania 2 +-------------------------- + +*system:* ... + +*user:* ... + +*system:* ... + +Zadanie 3: Nazwa zadania 3 +-------------------------- + +*system:* ... + +*user:* ... + +*system:* ... -- 2.20.1 From 1f1f04312907ba2841cb92f07f88621b9009120b Mon Sep 17 00:00:00 2001 From: s444417 Date: Wed, 16 Mar 2022 13:12:30 +0100 Subject: [PATCH 4/6] requirements --- tasks/zad2/requirements-analysis.md | 87 +++++++++++++++++++++++------ 1 file changed, 69 insertions(+), 18 deletions(-) diff --git a/tasks/zad2/requirements-analysis.md b/tasks/zad2/requirements-analysis.md index a851adb..e5c52df 100644 --- a/tasks/zad2/requirements-analysis.md +++ b/tasks/zad2/requirements-analysis.md @@ -1,37 +1,88 @@ -Tytuł Projektu +Nachos dialogue system ============== -Zadanie 1: Anulowanie rezerwacji +Zadanie 1: Dokonanie rezerwacji -------------------------------- -*system:* Witamy w systemie rezerwacji pokoi hotelowych. +*system:* Witamy w systemie kinowym Nachos, jak mogę Ci pomóc? + +*user:* Dzień dobry, chciałbym dokonać rezerwacji + +*system:* Jaki film Cię interesuje? + +*user:* Alicja w Krainie Czarów? + +*system:* Film nie znajduje się w repertuarze, podaj inny tytuł. + +*user:* Batman + +*system:* Jaki termin Cię interesuje? + +*user:* Dzisiaj, popołudniu? + +*system:* Dostępne godziny to: 13:30, 15:20, 17:45 + +*user:* 15:20 + +*system:* Ile potrzebujesz biletów? + +*user:* 2 + +*system:* Gdzie chciałbyś usiąść? + +*user:* Z tyłu, na środku + +*system:* Zostały Ci przydzielone miejsca H16, H16, numer Twojej rezerwacji to 123431. + + +Zadanie 2: Anulowanie rezerwacji +-------------------------------- + +*system:* Witamy w systemie kinowym Nachos. *user:* Dzień dobry, chciałbym anulować rezerwację. *system:* Proszę podać numer rezerwacji. -*user:* 1234567890 +*user:* 123431 -*system:* Rezerwacja nr 1234567890 pokoju jednoosobowego w dniach 21.04-23.04. Proszę podać hasło. +*system:* Rezerwacja nr 123431 w dniu 16.03 na godzinę 15:20 zostałą anulowana. -*user:* 3333 +*user:* Dziękuję <3 -*system:* Rezerwacja została anulowana. +Zadanie 3: Podawanie aktualnego repertuaru +-------------------------- -Zadanie 2: Nazwa zadania 2 +*system:* Witamy w systemie kinowym Nachos. + +*user:* ... + +*system:* ... + +Zadanie 4: Zmiana terminu rezerwacji +-------------------------- + +*system:* Witamy w systemie kinowym Nachos. + +*user:* ... + +*system:* ... + +Zadanie 5: Podanie oferty gastronomicznej +-------------------------- + +*system:* Witamy w systemie kinowym Nachos. + +*user:* ... + +*system:* ... + + +Zadanie 6: Pytanie o dostępne metody płatności -------------------------- *system:* ... *user:* ... -*system:* ... - -Zadanie 3: Nazwa zadania 3 --------------------------- - -*system:* ... - -*user:* ... - -*system:* ... +*system:* ... \ No newline at end of file -- 2.20.1 From a9630b97109a3f1f3d1105d75a3716d40f2271fa Mon Sep 17 00:00:00 2001 From: Adrian Charkiewicz Date: Fri, 18 Mar 2022 01:21:56 +0100 Subject: [PATCH 5/6] 1 new use-case, dialogue in use-cases 3 through 6 --- tasks/zad2/requirements-analysis.md | 56 +++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/tasks/zad2/requirements-analysis.md b/tasks/zad2/requirements-analysis.md index e5c52df..78511e3 100644 --- a/tasks/zad2/requirements-analysis.md +++ b/tasks/zad2/requirements-analysis.md @@ -32,7 +32,7 @@ Zadanie 1: Dokonanie rezerwacji *user:* Z tyłu, na środku -*system:* Zostały Ci przydzielone miejsca H16, H16, numer Twojej rezerwacji to 123431. +*system:* Zostały Ci przydzielone miejsca H15, H16, numer Twojej rezerwacji to 123431. Zadanie 2: Anulowanie rezerwacji @@ -55,34 +55,70 @@ Zadanie 3: Podawanie aktualnego repertuaru *system:* Witamy w systemie kinowym Nachos. -*user:* ... +*user:* Chciałbym dowiedzieć się, co jest teraz grane. -*system:* ... +*system:* Obecnie w repertuarze znajdują się: Batman, To nie wypanda, Inni ludzie, Ambulans, Uncharted, Ups 2, Nasze magiczne Encanto. Zadanie 4: Zmiana terminu rezerwacji -------------------------- *system:* Witamy w systemie kinowym Nachos. -*user:* ... +*user:* Chciałbym zmienić termin rezerwacji + +*system:* Proszę o podanie numeru rezerwacji. + +*user:* 123431 + +*system:* Proszę podać nowy termin rezerwacji. + +*user:* środa 18:30 + +*system:* Zmiana została dokonana. -*system:* ... Zadanie 5: Podanie oferty gastronomicznej -------------------------- *system:* Witamy w systemie kinowym Nachos. -*user:* ... +*user:* Co można zakupić w barze? -*system:* ... +*system:* W barze dostępne są obecnie: zestaw z solonym, słodkim lub maślany popcornem, wraz z colą/fantą/sprite lub zestaw *Nachosów* z wybranym dipem. Zadanie 6: Pytanie o dostępne metody płatności -------------------------- -*system:* ... +*system:* Witamy w systemie kinowym Nachos. + +*user:* Czy można płacić kartą? + +*system:* Możliwymi metodami płatności przy kasie są: gotówka, karta płatnicza, kod BLIK, przelew bankowy. Na stronie zakupu można dokonać kodem blikem, przelewem bankowym a także PayU. + + + +Zadanie 6: Pytanie o nadchodzące premiery +-------------------------- + +*system:* Witamy w systemie kinowym Nachos. + +*user:* Jakie filmy wejdą do kin niedługo? + +*system:* W naszym repetuarze będą obecne: Morbius - od 1 kwietnia, Zaginione miasto - od 1 kwietnia, Fanastyczne zwierzęta: tajemnice Dumbledorea - od 8 kwietnia, doktor strange w multiwersum obłędu - od 6 maja. + + +Zadanie 7: Podawanie aktualnego repertuaru z podziałem na kategorię +-------------------------- + +*system:* Witamy w systemie kinowym Nachos. + +*user:* Czy puszczane są teraz jakieś komedie romantyczne? + +*system:* Obecnie w repertuarze w podanej kategorii znajdują się: Najgorszy człowiek na świecie. + +*user:* A czy są jakieś komedie? + +*system:* Obecnie w repertuarze w podanej kategorii znajdują się: Pies oraz To nie wypanda. -*user:* ... -*system:* ... \ No newline at end of file -- 2.20.1 From 1f93c69a946314949bcb2d25361742f175a7a315 Mon Sep 17 00:00:00 2001 From: Adrian Charkiewicz Date: Fri, 18 Mar 2022 01:24:58 +0100 Subject: [PATCH 6/6] fixed numeration --- tasks/zad2/requirements-analysis.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/zad2/requirements-analysis.md b/tasks/zad2/requirements-analysis.md index 78511e3..5a7fa6e 100644 --- a/tasks/zad2/requirements-analysis.md +++ b/tasks/zad2/requirements-analysis.md @@ -98,7 +98,7 @@ Zadanie 6: Pytanie o dostępne metody płatności -Zadanie 6: Pytanie o nadchodzące premiery +Zadanie 7: Pytanie o nadchodzące premiery -------------------------- *system:* Witamy w systemie kinowym Nachos. @@ -108,7 +108,7 @@ Zadanie 6: Pytanie o nadchodzące premiery *system:* W naszym repetuarze będą obecne: Morbius - od 1 kwietnia, Zaginione miasto - od 1 kwietnia, Fanastyczne zwierzęta: tajemnice Dumbledorea - od 8 kwietnia, doktor strange w multiwersum obłędu - od 6 maja. -Zadanie 7: Podawanie aktualnego repertuaru z podziałem na kategorię +Zadanie 8: Podawanie aktualnego repertuaru z podziałem na kategorię -------------------------- *system:* Witamy w systemie kinowym Nachos. -- 2.20.1