diff --git a/Przykadowe_odpowiedzi.ipynb b/Przykadowe_odpowiedzi.ipynb index c445982..83a2e5c 100644 --- a/Przykadowe_odpowiedzi.ipynb +++ b/Przykadowe_odpowiedzi.ipynb @@ -2,7 +2,8 @@ "cells": [ { "cell_type": "code", - "execution_count": 3, + "execution_count": 1, + "id": "3a05341a", "metadata": {}, "outputs": [], "source": [ @@ -11,16 +12,17 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 12, + "id": "b073e4a5", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'Dzień dobry, witam w interaktywnej bibliotece'" + "'Dzień dobry, w czym mogę pomóc?'" ] }, - "execution_count": 4, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -42,7 +44,6 @@ " elif r==4:\n", " return 'Dzień dobry'\n", " \n", - " # zosia:\n", " elif r==5:\n", " return 'Cześć'\n", " elif r==6:\n", @@ -56,14 +57,15 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, + "id": "2dd476eb", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Obecnie nie ma żadnych wydarzeń.\n", + "Dzień promowania czytelnictwa.\n", "W przypadku zgubienia karty fakt ten można zgłosić w głównej filii biblioteki\n" ] } @@ -101,7 +103,7 @@ " if domain == 'library' and intent == 'Inform' and slot == 'status':\n", " if value == 0:\n", " return f'Biblioteka jest zmaknięta.'\n", - " elif value == 1:\n", + " elif value == test0:\n", " return f'Biblioteka jest otwarta.'\n", " else:\n", " return f'Biblioteka jest zamknięta do odwołania'\n", @@ -165,29 +167,30 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, + "id": "2067e38b", "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "'Czy ta książka to 1?'" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" + "name": "stdout", + "output_type": "stream", + "text": [ + "Czy ta książka to Bezsenność w Tokio?\n", + "Czy autor to Haruki Murakami?\n" + ] } ], "source": [ "#######################Confirm#############################\n", "def nlg(system_act):\n", " domain, intent, slot, value = system_act\n", + " test0 = \"Bezsenność w Tokio\"\n", + " test1 = \"Haruki Murakami\"\n", "\n", " if domain == 'books' and intent == 'Confirm' and slot == 'title':\n", " if value == 0:\n", " return f'Nie znalazłem książki o tym tytule.'\n", - " elif value == 1:\n", + " elif value == test0:\n", " return f'Czy ta książka to {value}?'\n", " else:\n", " return f'Książka o tym tytule nie została znaleziona. Proszę podać więcej informacji.'\n", @@ -195,7 +198,7 @@ " if domain == 'books' and intent == 'Confirm' and slot == 'author':\n", " if value == 0:\n", " return f'Nie znalazłem książki tego autora.'\n", - " elif value == 1:\n", + " elif value == test1:\n", " return f'Czy autor to {value}?'\n", " else:\n", " return f'Ksiązka tego autora nie została znaleziona. Proszę podać więcej informacji.'\n", @@ -213,12 +216,14 @@ " return 'Tak'\n", " \n", " \n", - "nlg(['books', 'Confirm', 'title', 1])" + "print(nlg(['books', 'Confirm', 'title', 'Bezsenność w Tokio']))\n", + "print(nlg(['books', 'Confirm', 'author', 'Haruki Murakami']))" ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 5, + "id": "c5aa0a54", "metadata": {}, "outputs": [ { @@ -226,7 +231,7 @@ "output_type": "stream", "text": [ "Tak, to będzie wszystko\n", - "Tak, to wszystko w zakresie założenia karty\n" + "Tak, to wszystko\n" ] } ], @@ -280,13 +285,14 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 6, + "id": "c5b9028d", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'Do widzenia'" + "'Dziękuję i życzę miłej lektury'" ] }, "execution_count": 8, @@ -317,7 +323,8 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 7, + "id": "22b38fb4", "metadata": {}, "outputs": [ { @@ -368,7 +375,8 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 8, + "id": "3caff585", "metadata": {}, "outputs": [ { @@ -378,7 +386,7 @@ "Chciałbym założyć kartę biblioteczną\n", "Czy książka Owoce wiśni Osamu Dazai, znajduje się w bibliotece w formie ebooka?\n", "Chciałabym zwrócić książkę Kafka Haruki Murakami\n", - "Chciałbym zarezerwować książkę Kafka Haruki Murakami\n", + "Chciałbym wypożyczyć książkę\n", "Chciałbym anulować rezerwację książki\n" ] } @@ -508,7 +516,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.3" + "version": "3.8.8" } }, "nbformat": 4,