Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
ed37659591 | |||
![]() |
7d14280f43 | ||
![]() |
a779039b30 | ||
![]() |
9660df1ef8 | ||
![]() |
09f04ec475 | ||
![]() |
573b896431 | ||
![]() |
18bebd05a1 | ||
![]() |
4ef41c18d3 | ||
![]() |
ad5ce277e1 | ||
![]() |
9d936403b4 | ||
![]() |
98f57edf48 | ||
![]() |
cf5e0585d1 | ||
![]() |
4dc305507e |
2
.gitignore
vendored
2
.gitignore
vendored
@ -216,3 +216,5 @@ fabric.properties
|
|||||||
slot-model
|
slot-model
|
||||||
|
|
||||||
ConvLab-2
|
ConvLab-2
|
||||||
|
|
||||||
|
resources
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
- uczenie modelu realizowane jest w zmodyfikowanym pliku z zajęć **lab/08-parsing-semantyczny-uczenie(zmodyfikowany).ipynb**
|
- uczenie modelu realizowane jest w zmodyfikowanym pliku z zajęć **lab/08-parsing-semantyczny-uczenie(zmodyfikowany).ipynb**
|
||||||
|
|
||||||
- dane uczące, wygenerowane są automatycznie, na podstawie zebranych wcześniej dialogów, przez regułowy skrypt **tasks/zad8/pl/annotate.py**, a następnie poprawione ręcznie. Dane znajdują sie w dwóch plikach **tasks/zad8/pl/test.conllu** oraz **tasks/zad8/pl/train.conllu**
|
- dane uczące, generowane są automatycznie, na podstawie zebranych wcześniej dialogów, przez regułowy skrypt **tasks/zad8/pl/annotate.py**, a następnie poprawione ręcznie. Dane znajdują sie w dwóch plikach **tasks/zad8/pl/test.conllu** oraz **tasks/zad8/pl/train.conllu**
|
||||||
|
|
||||||
- model wykorzystywany jest w klasie z pliku **src/components/NLU.py**
|
- model wykorzystywany jest w klasie z pliku **src/components/NLU.py**
|
||||||
|
|
||||||
@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
- aby porozmawiać z systemem należy uruchomić wszystkie komórki pliku **lab/08-parsing-semantyczny-uczenie(zmodyfikowany).ipynb**, w celu nauczenia modelu, po ich wykonaniu należy uruchomić pythonowy skrypt **src/dialogue_system.py**
|
- aby porozmawiać z systemem należy uruchomić wszystkie komórki pliku **lab/08-parsing-semantyczny-uczenie(zmodyfikowany).ipynb**, w celu nauczenia modelu, po ich wykonaniu należy uruchomić pythonowy skrypt **src/dialogue_system.py**
|
||||||
|
|
||||||
|
- dodananie modelu służącego do klasyfikacji wypowiedzi użytkownika, rozdzielenie zadań tagowania slotow oraz klasyfikacji wypowiedzi użytkownika do dwóch niezależnych modeli
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Zadanie 9/10 DST i DP
|
## Zadanie 9/10 DST i DP
|
||||||
|
34
evaluation.md
Normal file
34
evaluation.md
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# Ewaluacja
|
||||||
|
Odpowiedzi w pliku nachos-ankieta.xlsx zawierają odpowiedzi tekstowe, które korespondują z ocenami w skali od 1 do 7.
|
||||||
|
Na przykład, dla pytania "Czy zamierzasz używać systemu w przyszłości?" odpowiedziami teksotwymi i ich reprezntacją liczbową są:
|
||||||
|
- Z pewnością -> 7
|
||||||
|
- Tak -> 6
|
||||||
|
- Raczej tak -> 5
|
||||||
|
- Średnio -> 4
|
||||||
|
- Raczej nie -> 3
|
||||||
|
- Pewnie nie -> 2
|
||||||
|
- Na pewno nie -> 1
|
||||||
|
|
||||||
|
Z tego powodu wszystkie te wartości zostały przemienione na dane liczbowe, by przeprowadzić lepszą ewaluację. (plik znajduje się w tym katalogu)
|
||||||
|
|
||||||
|
Ankieta była anonimowa, a użytkownicy korzystali z różnych komputerów, w tym członków zespołu do jej wypełnienia, nie należy się więc sugerować kolumną "Email"
|
||||||
|
|
||||||
|
Odpowiedzi jest łącznie 10, co oznacza, że wszyscy obecni (zgodnie z listą obecności z dnia 15.06) wypełnili ankietę jednokrotnie, pod warunkiem że nikt nie zrobił tego dwa razy, czego nie możemy byc pewni.
|
||||||
|
|
||||||
|
Wszystkie 10 osób odpowiedziało na pytanie, czy udało się zarezerwować bilet twierdząco, więc dla prostej metryki "task success" mamy współczynnik 100%
|
||||||
|
|
||||||
|
- Dla kolejnych metryk, w której każda z nich posiadała skalę od 1 do 7, systemom udało się zdobyć (wyniki po uśrednieniu):
|
||||||
|
- Czy odpowiedzi systemu były zrozumiałe? -> 6.1 na 7
|
||||||
|
- Czy zamierzasz używać systemu w przyszłości? -> 5 na 7
|
||||||
|
- Czy na każdym etapie rozmowy wiedziałeś co powiedzieć? -> 6.7 na 7
|
||||||
|
- Czy system rozumiał wiadomości za pierwszym razem, bez konieczności powtarzania? -> 6 na 7
|
||||||
|
- Czy system zachowywał się zgodnie z twoimi przewidywaniami? -> 5.8 na 7
|
||||||
|
- Jakie jest prawdopodobieństwo, że polecisz nas znajomemu lub współpracownikowi? -> 6 na 7
|
||||||
|
|
||||||
|
## Wnioski
|
||||||
|
Wyniki te są zadowalające, uzyskując około 6 na 7 pkt z prawie każdej kategorii. Z rozmów z użytkownikami wiemy też jaki błędy poprawić w przyszłości, gdzie priorytetowym z nich jest rezerwacja miejsc, tj. wybieranie dokładnego miejsca A-J, 1-20.
|
||||||
|
Najgorzej wypadło "Czy zamierzasz używać systemu w przyszłości?" co może oznaczać, że na zajęciach pojawił się lepszy system, z którego użytkownicy chcieliby korzystać. Jednak do takich wniosków potrzeba by było analizy ankiet dla wszystkich systemów, nie tylko tej jednej.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -80,7 +80,14 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 1,
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 7,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
@ -249,12 +256,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 5,
|
"execution_count": 4,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"from flair.data import Corpus, Sentence, Token\n",
|
"from flair.data import Corpus, Sentence, Token\n",
|
||||||
"from flair.datasets import SentenceDataset\n",
|
"from flair.datasets import SentenceDataset, CSVClassificationCorpus\n",
|
||||||
"from flair.embeddings import StackedEmbeddings\n",
|
"from flair.embeddings import StackedEmbeddings\n",
|
||||||
"from flair.embeddings import WordEmbeddings\n",
|
"from flair.embeddings import WordEmbeddings\n",
|
||||||
"from flair.embeddings import CharacterEmbeddings\n",
|
"from flair.embeddings import CharacterEmbeddings\n",
|
||||||
@ -262,7 +269,7 @@
|
|||||||
"from flair.models import SequenceTagger\n",
|
"from flair.models import SequenceTagger\n",
|
||||||
"from flair.trainers import ModelTrainer\n",
|
"from flair.trainers import ModelTrainer\n",
|
||||||
"from flair.datasets import DataLoader\n",
|
"from flair.datasets import DataLoader\n",
|
||||||
"\n",
|
"import flair\n",
|
||||||
"# determinizacja obliczeń\n",
|
"# determinizacja obliczeń\n",
|
||||||
"import random\n",
|
"import random\n",
|
||||||
"import torch\n",
|
"import torch\n",
|
||||||
@ -277,6 +284,27 @@
|
|||||||
" torch.backends.cudnn.deterministic = True"
|
" torch.backends.cudnn.deterministic = True"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 5,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/plain": [
|
||||||
|
"'0.6.1'"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"execution_count": 5,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"flair.__version__\n",
|
||||||
|
"# Python 3.8.3 "
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
@ -286,7 +314,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 6,
|
"execution_count": 30,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
@ -294,7 +322,7 @@
|
|||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"Corpus: 346 train + 38 dev + 32 test sentences\n",
|
"Corpus: 346 train + 38 dev + 32 test sentences\n",
|
||||||
"Dictionary with 78 tags: <unk>, O, O/reqmore, B-interval/reqmore, I-interval/reqmore, O/inform, B-title/inform, B-date/inform, I-date/inform, B-time/inform, B-quantity/inform, B-area/inform, I-area/inform, B-goal/inform, O/bye, O/hello, O/reqmore inform, B-goal/reqmore inform, I-goal/reqmore inform, B-date/reqmore inform, B-interval/reqmore inform, O/null, O/help, B-goal/reqmore, I-goal/reqmore, B-title/reqmore, B-title/reqmore inform, I-title/reqmore inform, O/ack, O/reqalts\n"
|
"Dictionary with 20 tags: <unk>, O, B-interval, I-interval, B-title, B-date, I-date, B-time, B-quantity, B-area, I-area, B-goal, I-goal, I-title, I-time, I-quantity, B-seats, I-seats, <START>, <STOP>\n"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -320,7 +348,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
" return SentenceDataset(fsentences)\n",
|
" return SentenceDataset(fsentences)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"corpus = Corpus(train=conllu2flair(trainset, 'slot', \"frame\"), test=conllu2flair(testset, 'slot', \"frame\"))\n",
|
"corpus = Corpus(train=conllu2flair(trainset, 'slot'), test=conllu2flair(testset, 'slot'))\n",
|
||||||
"print(corpus)\n",
|
"print(corpus)\n",
|
||||||
"tag_dictionary = corpus.make_tag_dictionary(tag_type='slot')\n",
|
"tag_dictionary = corpus.make_tag_dictionary(tag_type='slot')\n",
|
||||||
"print(tag_dictionary)"
|
"print(tag_dictionary)"
|
||||||
@ -335,7 +363,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 7,
|
"execution_count": 31,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@ -418,7 +446,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 9,
|
"execution_count": 44,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@ -480,14 +508,14 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 10,
|
"execution_count": 45,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"2022-05-22 15:25:19,970 loading file slot-model/final-model.pt\n"
|
"2022-05-30 22:30:48,788 loading file slot-model/final-model.pt\n"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -505,16 +533,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 11,
|
"execution_count": 47,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"data": {
|
"data": {
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"[('co', 'O/reqmore'), ('gracie', 'O/reqmore'), ('obecnie', 'O/reqmore')]"
|
"[('poprosze', 'O'), ('bilet', 'O'), ('na', 'O'), ('batman', 'B-title')]"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 11,
|
"execution_count": 47,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"output_type": "execute_result"
|
"output_type": "execute_result"
|
||||||
}
|
}
|
||||||
@ -526,7 +554,7 @@
|
|||||||
" model.predict(fsentence)\n",
|
" model.predict(fsentence)\n",
|
||||||
" return [(token, ftoken.get_tag('slot').value) for token, ftoken in zip(sentence, fsentence)]\n",
|
" return [(token, ftoken.get_tag('slot').value) for token, ftoken in zip(sentence, fsentence)]\n",
|
||||||
"\n",
|
"\n",
|
||||||
"predict(model, 'co gracie obecnie'.split())"
|
"predict(model, 'poprosze bilet na batman'.split())"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -569,19 +597,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 2,
|
"execution_count": 43,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"ename": "NameError",
|
"name": "stderr",
|
||||||
"evalue": "name 'testset' is not defined",
|
"output_type": "stream",
|
||||||
"output_type": "error",
|
"text": [
|
||||||
"traceback": [
|
"\n",
|
||||||
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
"KeyboardInterrupt\n",
|
||||||
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
|
"\n"
|
||||||
"\u001b[1;32mc:\\Develop\\wmi\\AITECH\\sem1\\Systemy dialogowe\\lab\\08-parsing-semantyczny-uczenie(zmodyfikowany).ipynb Cell 25'\u001b[0m in \u001b[0;36m<cell line: 40>\u001b[1;34m()\u001b[0m\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Develop/wmi/AITECH/sem1/Systemy%20dialogowe/lab/08-parsing-semantyczny-uczenie%28zmodyfikowany%29.ipynb#ch0000024?line=36'>37</a>\u001b[0m \u001b[39mprint\u001b[39m(\u001b[39m\"\u001b[39m\u001b[39mrecall: \u001b[39m\u001b[39m\"\u001b[39m, recallScore)\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Develop/wmi/AITECH/sem1/Systemy%20dialogowe/lab/08-parsing-semantyczny-uczenie%28zmodyfikowany%29.ipynb#ch0000024?line=37'>38</a>\u001b[0m \u001b[39mprint\u001b[39m(\u001b[39m\"\u001b[39m\u001b[39mf1: \u001b[39m\u001b[39m\"\u001b[39m, f1Score)\n\u001b[1;32m---> <a href='vscode-notebook-cell:/c%3A/Develop/wmi/AITECH/sem1/Systemy%20dialogowe/lab/08-parsing-semantyczny-uczenie%28zmodyfikowany%29.ipynb#ch0000024?line=39'>40</a>\u001b[0m \u001b[39meval\u001b[39;49m()\n",
|
|
||||||
"\u001b[1;32mc:\\Develop\\wmi\\AITECH\\sem1\\Systemy dialogowe\\lab\\08-parsing-semantyczny-uczenie(zmodyfikowany).ipynb Cell 25'\u001b[0m in \u001b[0;36meval\u001b[1;34m()\u001b[0m\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Develop/wmi/AITECH/sem1/Systemy%20dialogowe/lab/08-parsing-semantyczny-uczenie%28zmodyfikowany%29.ipynb#ch0000024?line=13'>14</a>\u001b[0m fp \u001b[39m=\u001b[39m \u001b[39m0\u001b[39m\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Develop/wmi/AITECH/sem1/Systemy%20dialogowe/lab/08-parsing-semantyczny-uczenie%28zmodyfikowany%29.ipynb#ch0000024?line=14'>15</a>\u001b[0m fn \u001b[39m=\u001b[39m \u001b[39m0\u001b[39m\n\u001b[1;32m---> <a href='vscode-notebook-cell:/c%3A/Develop/wmi/AITECH/sem1/Systemy%20dialogowe/lab/08-parsing-semantyczny-uczenie%28zmodyfikowany%29.ipynb#ch0000024?line=15'>16</a>\u001b[0m sentences \u001b[39m=\u001b[39m [sentence \u001b[39mfor\u001b[39;00m sentence \u001b[39min\u001b[39;00m testset]\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Develop/wmi/AITECH/sem1/Systemy%20dialogowe/lab/08-parsing-semantyczny-uczenie%28zmodyfikowany%29.ipynb#ch0000024?line=16'>17</a>\u001b[0m \u001b[39mfor\u001b[39;00m sentence \u001b[39min\u001b[39;00m sentences:\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Develop/wmi/AITECH/sem1/Systemy%20dialogowe/lab/08-parsing-semantyczny-uczenie%28zmodyfikowany%29.ipynb#ch0000024?line=17'>18</a>\u001b[0m \u001b[39m# get sentence as terms list\u001b[39;00m\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Develop/wmi/AITECH/sem1/Systemy%20dialogowe/lab/08-parsing-semantyczny-uczenie%28zmodyfikowany%29.ipynb#ch0000024?line=18'>19</a>\u001b[0m termsList \u001b[39m=\u001b[39m [w[\u001b[39m\"\u001b[39m\u001b[39mform\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39mfor\u001b[39;00m w \u001b[39min\u001b[39;00m sentence]\n",
|
|
||||||
"\u001b[1;31mNameError\u001b[0m: name 'testset' is not defined"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -608,7 +633,9 @@
|
|||||||
" # predict tags\n",
|
" # predict tags\n",
|
||||||
" predTags = [tag[1] for tag in predict(model, termsList)]\n",
|
" predTags = [tag[1] for tag in predict(model, termsList)]\n",
|
||||||
" \n",
|
" \n",
|
||||||
" expTags = [token[\"slot\"] + \"/\" + token[\"frame\"] for token in sentence]\n",
|
" # expTags = [token[\"slot\"] + \"/\" + token[\"frame\"] for token in sentence]\n",
|
||||||
|
" expTags = [token[\"slot\"] for token in sentence]\n",
|
||||||
|
"\n",
|
||||||
" for i in range(len(predTags)):\n",
|
" for i in range(len(predTags)):\n",
|
||||||
" if (expTags[i][0] == \"O\" and expTags[i] != predTags[i]):\n",
|
" if (expTags[i][0] == \"O\" and expTags[i] != predTags[i]):\n",
|
||||||
" fp += 1\n",
|
" fp += 1\n",
|
||||||
@ -642,6 +669,191 @@
|
|||||||
" 4. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, Illia Polosukhin, Attention is All you Need, NIPS 2017, pp. 5998-6008, https://arxiv.org/abs/1706.03762\n",
|
" 4. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, Illia Polosukhin, Attention is All you Need, NIPS 2017, pp. 5998-6008, https://arxiv.org/abs/1706.03762\n",
|
||||||
" 5. Alan Akbik, Duncan Blythe, Roland Vollgraf, Contextual String Embeddings for Sequence Labeling, Proceedings of the 27th International Conference on Computational Linguistics, pp. 1638–1649, https://www.aclweb.org/anthology/C18-1139.pdf\n"
|
" 5. Alan Akbik, Duncan Blythe, Roland Vollgraf, Contextual String Embeddings for Sequence Labeling, Proceedings of the 27th International Conference on Computational Linguistics, pp. 1638–1649, https://www.aclweb.org/anthology/C18-1139.pdf\n"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"### Predykcja aktów mowy użytkownika"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 36,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"2022-05-30 22:08:33,633 Reading data from ..\\tasks\\zad8\\pl\\dataSentence\n",
|
||||||
|
"2022-05-30 22:08:33,633 Train: ..\\tasks\\zad8\\pl\\dataSentence\\train.tsv\n",
|
||||||
|
"2022-05-30 22:08:33,634 Dev: None\n",
|
||||||
|
"2022-05-30 22:08:33,635 Test: ..\\tasks\\zad8\\pl\\dataSentence\\test.tsv\n",
|
||||||
|
"Corpus: 280 train + 31 dev + 32 test sentences\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"def conllu2flair(sentences, label2=None):\n",
|
||||||
|
" fsentences = []\n",
|
||||||
|
"\n",
|
||||||
|
" for sentence in sentences:\n",
|
||||||
|
" fsentence = Sentence()\n",
|
||||||
|
"\n",
|
||||||
|
" for token in sentence:\n",
|
||||||
|
" ftoken = Token(token['form'])\n",
|
||||||
|
"\n",
|
||||||
|
" \n",
|
||||||
|
" if label2:\n",
|
||||||
|
" ftoken.add_tag(label2, token[label2])\n",
|
||||||
|
" \n",
|
||||||
|
" fsentence.add_token(ftoken)\n",
|
||||||
|
"\n",
|
||||||
|
" fsentences.append(fsentence)\n",
|
||||||
|
"\n",
|
||||||
|
" return SentenceDataset(fsentences)\n",
|
||||||
|
"\n",
|
||||||
|
"trainPath = \"../tasks/zad8/pl/dataSentence/train.tsv\"\n",
|
||||||
|
"testPath = \"../tasks/zad8/pl/dataSentence/test.tsv\"\n",
|
||||||
|
"dataFolder = \"../tasks/zad8/pl/dataSentence\"\n",
|
||||||
|
"column_name_map = {0: \"text\", 1: \"label_topic\"}\n",
|
||||||
|
"corpusClassification = CSVClassificationCorpus(dataFolder,\n",
|
||||||
|
" column_name_map,\n",
|
||||||
|
" skip_header=False,\n",
|
||||||
|
" delimiter='\\t',\n",
|
||||||
|
")\n",
|
||||||
|
"print(corpusClassification)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 40,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"2022-05-30 22:10:19,891 Computing label dictionary. Progress:\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stderr",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"100%|██████████| 312/312 [00:04<00:00, 68.32it/s] "
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"2022-05-30 22:10:25,276 [b'inform', b'reqmore', b'hello', b'infomrm', b'reqmore inform', b'bye', b'ack', b'reqalts', b'impl-conf inform', b'help', b'request', b'affirm', b'thankyou', b'affirm inform', b'bye thankyou', b'hello inform', b'infrom', b'confirm', b'negate confirm', b'negate', b'negate ', b'deny']\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stderr",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"from flair.data import Corpus\n",
|
||||||
|
"from flair.datasets import TREC_6\n",
|
||||||
|
"from flair.embeddings import WordEmbeddings, FlairEmbeddings, DocumentRNNEmbeddings\n",
|
||||||
|
"from flair.models import TextClassifier\n",
|
||||||
|
"from flair.trainers import ModelTrainer\n",
|
||||||
|
"\n",
|
||||||
|
"from os.path import exists\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"# 2. create the label dictionary\n",
|
||||||
|
"label_dict = corpusClassification.make_label_dictionary()\n",
|
||||||
|
"\n",
|
||||||
|
"# 3. make a list of word embeddings\n",
|
||||||
|
"word_embeddings = [\n",
|
||||||
|
" WordEmbeddings('pl'),\n",
|
||||||
|
" FlairEmbeddings('polish-forward'),\n",
|
||||||
|
" FlairEmbeddings('polish-backward'),\n",
|
||||||
|
" CharacterEmbeddings(),\n",
|
||||||
|
"]\n",
|
||||||
|
"\n",
|
||||||
|
"# 4. initialize document embedding by passing list of word embeddings\n",
|
||||||
|
"# Can choose between many RNN types (GRU by default, to change use rnn_type parameter)\n",
|
||||||
|
"document_embeddings = DocumentRNNEmbeddings(word_embeddings, hidden_size=256)\n",
|
||||||
|
"\n",
|
||||||
|
"# 5. create the text classifier\n",
|
||||||
|
"classifier = TextClassifier(document_embeddings, label_dictionary=label_dict)\n",
|
||||||
|
"\n",
|
||||||
|
"# 6. initialize the text classifier trainer\n",
|
||||||
|
"trainer = ModelTrainer(classifier, corpusClassification)\n",
|
||||||
|
"\n",
|
||||||
|
"modelPath = 'resources/taggers/trec/final-model.pt'\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"fileExists = exists(modelPath)\n",
|
||||||
|
"\n",
|
||||||
|
"if(not fileExists):\n",
|
||||||
|
" # 7. start the training\n",
|
||||||
|
" trainer.train('resources/taggers/trec',\n",
|
||||||
|
" learning_rate=0.1,\n",
|
||||||
|
" mini_batch_size=32,\n",
|
||||||
|
" anneal_factor=0.5,\n",
|
||||||
|
" patience=5,\n",
|
||||||
|
" max_epochs=10)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 41,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"2022-05-30 22:10:47,199 loading file resources/taggers/trec/final-model.pt\n",
|
||||||
|
"[reqmore (0.5459)]\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"classifier = TextClassifier.load(modelPath)\n",
|
||||||
|
"\n",
|
||||||
|
"# create example sentence\n",
|
||||||
|
"sentence = Sentence('Jakie filmy gracie jutro?')\n",
|
||||||
|
"\n",
|
||||||
|
"# predict class and print\n",
|
||||||
|
"classifier.predict(sentence)\n",
|
||||||
|
"\n",
|
||||||
|
"print(sentence.labels)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 42,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"[inform (0.5967)]\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"# create example sentence\n",
|
||||||
|
"sentence = Sentence('siedzenia h1 h2')\n",
|
||||||
|
"\n",
|
||||||
|
"# predict class and print\n",
|
||||||
|
"classifier.predict(sentence)\n",
|
||||||
|
"\n",
|
||||||
|
"print(sentence.labels)"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
@ -671,7 +883,7 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.8.10"
|
"version": "3.8.3"
|
||||||
},
|
},
|
||||||
"subtitle": "8.Parsing semantyczny z wykorzystaniem technik uczenia maszynowego[laboratoria]",
|
"subtitle": "8.Parsing semantyczny z wykorzystaniem technik uczenia maszynowego[laboratoria]",
|
||||||
"title": "Systemy Dialogowe",
|
"title": "Systemy Dialogowe",
|
||||||
|
211
lab/12-ujednoznacznianie.ipynb
Normal file
211
lab/12-ujednoznacznianie.ipynb
Normal file
@ -0,0 +1,211 @@
|
|||||||
|
{
|
||||||
|
"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",
|
||||||
|
"<div class=\"alert alert-block alert-info\">\n",
|
||||||
|
"<h1> Systemy Dialogowe </h1>\n",
|
||||||
|
"<h2> 12. <i>Ujednoznacznianie wypowiedzi u\u017cytkownika</i> [laboratoria]</h2> \n",
|
||||||
|
"<h3> Marek Kubis (2021)</h3>\n",
|
||||||
|
"</div>\n",
|
||||||
|
"\n",
|
||||||
|
"![Logo 2](https://git.wmi.amu.edu.pl/AITech/Szablon/raw/branch/master/Logotyp_AITech2.jpg)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"Ujednoznacznianie wypowiedzi u\u017cytkownika\n",
|
||||||
|
"========================================\n",
|
||||||
|
"\n",
|
||||||
|
"Problem\n",
|
||||||
|
"-------\n",
|
||||||
|
"W systemie dialogowym ukierunkowanym na wype\u0142nianie wielu zada\u0144 jednocze\u015bnie polecenia u\u017cytkownika mog\u0105 by\u0107 niejednoznacznie. Przyk\u0142adowo wypowied\u017a\n",
|
||||||
|
"\n",
|
||||||
|
"> please book it for me\n",
|
||||||
|
"\n",
|
||||||
|
"mo\u017ce dotyczy\u0107 zar\u00f3wno rezerwacji pokoju w hotelu jak i biletu na poci\u0105g.\n",
|
||||||
|
"\n",
|
||||||
|
"System, w kt\u00f3rym modu\u0142 NLU jest zbudowany z wykorzystaniem gramatyk semantycznych mo\u017ce zwr\u00f3ci\u0107\n",
|
||||||
|
"wi\u0119cej ni\u017c jedn\u0105 ram\u0119 reprezentuj\u0105c\u0105 znaczenie wypowiedzi. Kt\u00f3ra rama powinna zosta\u0107 uznana za\n",
|
||||||
|
"prawid\u0142ow\u0105?\n",
|
||||||
|
"\n",
|
||||||
|
"System, w kt\u00f3rym modu\u0142 NLU jest zbudowany przy u\u017cyciu modelu sekwencyjnego mo\u017ce zwr\u00f3ci\u0107 jedn\u0105,\n",
|
||||||
|
"arbitralnie wybran\u0105 ram\u0119. Co wtedy?\n",
|
||||||
|
"\n",
|
||||||
|
"Ujednoznacznianie z wykorzystaniem regu\u0142\n",
|
||||||
|
"----------------------------------------\n",
|
||||||
|
"\n",
|
||||||
|
"Do ujednoznaczniania wypowiedzi u\u017cytkownika mo\u017cna wykorzysta\u0107 monitor stanu dialogu oraz taktyk\u0119\n",
|
||||||
|
"prowadzenia dialogu. Mo\u017cemy m.in.:\n",
|
||||||
|
"\n",
|
||||||
|
" 1. Dopasowa\u0107 niejednoznaczn\u0105 wypowied\u017a do wszystkich dziedzin licz\u0105c na to, \u017ce w toku dialogu\n",
|
||||||
|
" niejednoznaczno\u015b\u0107 zostanie rozstrzygni\u0119ta (to\n",
|
||||||
|
" rozwi\u0105zanie zosta\u0142o przyj\u0119te w monitorze `SimpleRuleDST` przedstawionym na zaj\u0119ciach \u00f3smych).\n",
|
||||||
|
"\n",
|
||||||
|
" 2. Dopasowa\u0107 niejednoznaczn\u0105 wypowied\u017a wy\u0142\u0105cznie do tej dziedziny, dla kt\u00f3rej stan dialogu zawiera\n",
|
||||||
|
" wype\u0142nione sloty.\n",
|
||||||
|
"\n",
|
||||||
|
" 3. Sprawdzi\u0107 czy wypowied\u017a u\u017cytkownika stanowi odpowied\u017a na pytanie uprzednio zadane przez system\n",
|
||||||
|
" (pole `request_state` w monitorze `SimpleRuleDST`).\n",
|
||||||
|
"\n",
|
||||||
|
" 4. Wykorzysta\u0107 taktyk\u0119 prowadzenia dialogu do zadania pytania, kt\u00f3re rozstrzygnie\n",
|
||||||
|
" niejednoznaczno\u015b\u0107."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"Ujednoznacznianie z wykorzystaniem uczenia maszynowego\n",
|
||||||
|
"------------------------------------------------------\n",
|
||||||
|
"\n",
|
||||||
|
"W procesie uczenia modelu NLU mo\u017cna wykorzysta\u0107 histori\u0119 dialogu jako kontekst (zbi\u00f3r dodatkowych\n",
|
||||||
|
"cech) warunkuj\u0105cych wynik uczenia.\n",
|
||||||
|
"Takie podej\u015bcie zosta\u0142o zastosowane w modelu [jointBERT](https://github.com/thu-coai/ConvLab-2/blob/master/convlab2/nlu/jointBERT/jointBERT.py), w kt\u00f3rym kontekst sk\u0142ada si\u0119 z trzech (sklejonych ze sob\u0105) tur dialogu poprzedzaj\u0105cych bie\u017c\u0105c\u0105 wypowied\u017a.\n",
|
||||||
|
"\n",
|
||||||
|
"Por\u00f3wnajmy skuteczno\u015b\u0107 modelu bezkontekstowego ze skuteczno\u015bci\u0105 modelu uwzgl\u0119dniaj\u0105cego kontekst.\n",
|
||||||
|
"Do oceny jako\u015bci wykorzystamy zbi\u00f3r danych [MultiWOZ](https://github.com/budzianowski/multiwoz) (Budzianowski i in., 2018)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"lines_to_next_cell": 0
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from convlab2.nlu.jointBERT.multiwoz import BERTNLU\n",
|
||||||
|
"from convlab2.util.dataloader.module_dataloader import MultiTurnNLUDataloader\n",
|
||||||
|
"from convlab2.util.dataloader.dataset_dataloader import MultiWOZDataloader\n",
|
||||||
|
"\n",
|
||||||
|
"dataloader = MultiTurnNLUDataloader(dataset_dataloader=MultiWOZDataloader())\n",
|
||||||
|
"data = dataloader.load_data(data_key='test', role='sys')['test']"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"lines_to_next_cell": 0
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"data['utterance'][:3]"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"data['dialog_act'][:3]"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {
|
||||||
|
"lines_to_next_cell": 0
|
||||||
|
},
|
||||||
|
"source": [
|
||||||
|
"Precision, recall oraz F1 obu modeli zmierzymy korzystaj\u0105c z funkcji `evaluate`."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from convlab2.nlu.evaluate import calculateF1\n",
|
||||||
|
"from tqdm.notebook import tqdm\n",
|
||||||
|
"\n",
|
||||||
|
"def evaluate(model, data):\n",
|
||||||
|
" results = []\n",
|
||||||
|
"\n",
|
||||||
|
" for utt, ctx, acts in tqdm(zip(data['utterance'], data['context'], data['dialog_act']), total=len(data['utterance'])):\n",
|
||||||
|
" predicted = model.predict(utterance=utt, context=ctx)\n",
|
||||||
|
" results.append({'predict': predicted, 'golden': acts})\n",
|
||||||
|
"\n",
|
||||||
|
" precision, recall, fscore = calculateF1(results)\n",
|
||||||
|
" print(f'Precision: {precision:.4f} Recall: {recall:.4f} F1: {fscore:.4f}')\n",
|
||||||
|
" return precision, recall, fscore"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {
|
||||||
|
"lines_to_next_cell": 0
|
||||||
|
},
|
||||||
|
"source": [
|
||||||
|
"Zmierzmy skuteczno\u015b\u0107 modelu bezkontekstowego."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"noctx_model = BERTNLU(mode='all',\n",
|
||||||
|
" config_file='multiwoz_all.json',\n",
|
||||||
|
" model_file='https://convlab.blob.core.windows.net/convlab-2/bert_multiwoz_all.zip')\n",
|
||||||
|
"\n",
|
||||||
|
"noctx_results = evaluate(noctx_model, data)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {
|
||||||
|
"lines_to_next_cell": 0
|
||||||
|
},
|
||||||
|
"source": [
|
||||||
|
"Zmierzmy skutecznos\u0107 modelu uwzgl\u0119dniaj\u0105cego kontekst."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"ctx_model = BERTNLU(mode='all',\n",
|
||||||
|
" config_file='multiwoz_all_context.json',\n",
|
||||||
|
" model_file='https://convlab.blob.core.windows.net/convlab-2/bert_multiwoz_all_context.zip')\n",
|
||||||
|
"\n",
|
||||||
|
"ctx_results = evaluate(ctx_model, data)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"Literatura\n",
|
||||||
|
"----------\n",
|
||||||
|
" 1. Pawel Budzianowski, Tsung-Hsien Wen, Bo-Hsiang Tseng, I\u00f1igo Casanueva, Stefan Ultes, Osman Ramadan, Milica Gasic, MultiWOZ - A Large-Scale Multi-Domain Wizard-of-Oz Dataset for Task-Oriented Dialogue Modelling. EMNLP 2018, pp. 5016-5026"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"jupytext": {
|
||||||
|
"cell_metadata_filter": "-all",
|
||||||
|
"main_language": "python",
|
||||||
|
"notebook_metadata_filter": "-all"
|
||||||
|
},
|
||||||
|
"author": "Marek Kubis",
|
||||||
|
"email": "mkubis@amu.edu.pl",
|
||||||
|
"lang": "pl",
|
||||||
|
"subtitle": "12.Ujednoznacznianie wypowiedzi u\u017cytkownika[laboratoria]",
|
||||||
|
"title": "Systemy Dialogowe",
|
||||||
|
"year": "2021"
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 4
|
||||||
|
}
|
BIN
nachos-ankieta.xlsx
Normal file
BIN
nachos-ankieta.xlsx
Normal file
Binary file not shown.
@ -1,31 +1,150 @@
|
|||||||
from urllib import request
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
|
||||||
class DP:
|
class DP:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
self.database = DBMock()
|
||||||
|
|
||||||
def getAction(self, lastUserAct, emptySlots, systemSlots):
|
def getAction(self, lastUserAct, emptySlots, systemSlots, slotsWithValues):
|
||||||
systemAct = None
|
systemAct = None
|
||||||
slotVal = None
|
slotVal = None
|
||||||
if ((lastUserAct == "hello") | (lastUserAct == "inform") | (lastUserAct == None)):
|
|
||||||
|
if ((lastUserAct == "request") | (lastUserAct == "reqmore")):
|
||||||
|
title = None
|
||||||
|
date = None
|
||||||
|
time = None
|
||||||
|
if "title" in slotsWithValues.keys(): title = slotsWithValues["title"]
|
||||||
|
if "date" in slotsWithValues.keys(): date = slotsWithValues["date"]
|
||||||
|
if "time" in slotsWithValues.keys(): time = slotsWithValues["time"]
|
||||||
|
return ["Cinema", "select", "", self.database.getShows(title=title,date=date,time=time)]
|
||||||
|
|
||||||
|
elif ((lastUserAct == "hello") | (lastUserAct == "inform") | (lastUserAct == None)):
|
||||||
# there are no empty slots
|
# there are no empty slots
|
||||||
|
systemAct = None
|
||||||
|
slotName = None
|
||||||
|
value = None
|
||||||
if not emptySlots:
|
if not emptySlots:
|
||||||
|
|
||||||
|
reservationId = max(self.database.reservations.keys()) + 1
|
||||||
|
# TODO add reservation
|
||||||
systemAct = "inform"
|
systemAct = "inform"
|
||||||
slotVal = systemSlots
|
slotName = systemSlots
|
||||||
|
value = reservationId
|
||||||
# there are empty slots
|
# there are empty slots
|
||||||
else:
|
else:
|
||||||
for slot in systemSlots:
|
for slot in emptySlots:
|
||||||
if slot in emptySlots:
|
|
||||||
systemAct = "request"
|
systemAct = "request"
|
||||||
slotVal = slot
|
slotName = slot
|
||||||
break
|
break
|
||||||
return ["Cinema", systemAct, slotVal, ""]
|
return ["Cinema", systemAct, slotName, value]
|
||||||
elif (lastUserAct == "request"):
|
|
||||||
# todo policy for user request
|
|
||||||
return ["Cinema", "", "", ""]
|
|
||||||
else:
|
else:
|
||||||
systemAct = "repeat"
|
systemAct = "repeat"
|
||||||
return ["Cinema", systemAct, "", ""]
|
return ["Cinema", systemAct, "", ""]
|
||||||
|
|
||||||
|
class DBMock():
|
||||||
|
def __init__(self):
|
||||||
|
self.shows = {
|
||||||
|
1: {
|
||||||
|
"title": "Batman",
|
||||||
|
"date": "08.06",
|
||||||
|
"time": "19:00",
|
||||||
|
"seats": ["a1", "a2", "a3", "a4", "a5",
|
||||||
|
"b1", "b2", "b3", "b4", "b5",
|
||||||
|
"c1", "c2", "c3", "c4", "c5",
|
||||||
|
"d1", "d2", "d3", "d4", "d5",
|
||||||
|
"e1", "e2", "e3", "e4", "e5",],
|
||||||
|
"free": ["a1", "a2",
|
||||||
|
"b2", "b3", "b4",
|
||||||
|
|
||||||
|
"d1", "d2",
|
||||||
|
"e1", "e2", "e3", "e4",],
|
||||||
|
},
|
||||||
|
2: {
|
||||||
|
"title": "Batman",
|
||||||
|
"date": "08.06",
|
||||||
|
"time": "20:00",
|
||||||
|
"seats": ["a1", "a2", "a3", "a4", "a5",
|
||||||
|
"b1", "b2", "b3", "b4", "b5",
|
||||||
|
"c1", "c2", "c3", "c4", "c5",
|
||||||
|
"d1", "d2", "d3", "d4", "d5",
|
||||||
|
"e1", "e2", "e3", "e4", "e5",],
|
||||||
|
"free": ["a1", "a2", "a3", "a4", "a5",
|
||||||
|
"b1", "b2", "b3", "b4", "b5",
|
||||||
|
"c1", "c2", "c3", "c4", "c5",
|
||||||
|
"d1", "d2", "d3", "d4", "d5",
|
||||||
|
"e1", "e2", "e3", "e4", "e5",],
|
||||||
|
},
|
||||||
|
3: {
|
||||||
|
"title": "Zorro",
|
||||||
|
"date": "09.06",
|
||||||
|
"time": "21:00",
|
||||||
|
"seats": ["a1", "a2", "a3", "a4", "a5",
|
||||||
|
"b1", "b2", "b3", "b4", "b5",
|
||||||
|
"c1", "c2", "c3", "c4", "c5",
|
||||||
|
"d1", "d2", "d3", "d4", "d5",
|
||||||
|
"e1", "e2", "e3", "e4", "e5",],
|
||||||
|
"free": ["a1", "a2",
|
||||||
|
"b1", "b2", "b3", "b4", "b5",
|
||||||
|
"c4", "c5",
|
||||||
|
"d1", "d2", "d3", "d4", "d5",
|
||||||
|
"e1", "e2", "e3", "e4", "e5",],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
self.reservations = {
|
||||||
|
1: {
|
||||||
|
'show': 1,
|
||||||
|
'seats': ['a3', 'a4', "a5"]
|
||||||
|
},
|
||||||
|
2: {
|
||||||
|
'show': 1,
|
||||||
|
'seats': ['b5']
|
||||||
|
},
|
||||||
|
3: {
|
||||||
|
'show': 1,
|
||||||
|
'seats': ['d3', 'd4', "d5"]
|
||||||
|
},
|
||||||
|
4: {
|
||||||
|
'show': 1,
|
||||||
|
'seats': ['e5']
|
||||||
|
},
|
||||||
|
5: {
|
||||||
|
'show': 1,
|
||||||
|
'seats': ['c1', 'c2', 'c3', 'c4', "c5"]
|
||||||
|
},
|
||||||
|
6: {
|
||||||
|
'show': 3,
|
||||||
|
'seats': ['a3', 'a4', "a5"]
|
||||||
|
},
|
||||||
|
7: {
|
||||||
|
'show': 3,
|
||||||
|
'seats': ['c1', 'c2', 'c3']
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
def getShows(self, title = None, date = None, time = None,):
|
||||||
|
result = []
|
||||||
|
for key in self.shows.keys():
|
||||||
|
# title is None
|
||||||
|
if(title is None):
|
||||||
|
if ((date is not None) & (time is not None)):
|
||||||
|
if self.shows[key]["date"] == str(date):
|
||||||
|
if self.shows[key]["time"] == str(time):
|
||||||
|
result.append([self.shows[key]["title"], self.shows[key]["date"]])
|
||||||
|
elif ((date is not None) & (time is None)):
|
||||||
|
if self.shows[key]["date"] == str(date):
|
||||||
|
result.append([self.shows[key]["title"], self.shows[key]["date"]])
|
||||||
|
elif ((date is None) & (time is not None)):
|
||||||
|
if self.shows[key]["time"] == str(time):
|
||||||
|
result.append([self.shows[key]["title"], self.shows[key]["date"]])
|
||||||
|
# title is not None
|
||||||
|
elif(title is not None):
|
||||||
|
if(date is None):
|
||||||
|
if self.shows[key]["title"] == str(title):
|
||||||
|
result.append(self.shows[key]["date"])
|
||||||
|
elif(date is not None):
|
||||||
|
if(time is None):
|
||||||
|
if self.shows[key]["date"] == str(date):
|
||||||
|
result.append(self.shows[key]["time"])
|
||||||
|
return set(result)
|
@ -2,36 +2,27 @@ class DST:
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.init_session()
|
self.init_session()
|
||||||
# self.value_dict = json.load(open('utils/value_dict.json'))
|
|
||||||
|
|
||||||
def update(self, user_act=None):
|
def update(self, user_act=None):
|
||||||
intentVal = None
|
intentVal = None
|
||||||
|
# sample user_act from NLU
|
||||||
|
# user_act = [["inform", "Cinema", "title", "batman"], ["inform", "Cinema", "date", "jutro"]]
|
||||||
for intent, domain, slot, value in user_act:
|
for intent, domain, slot, value in user_act:
|
||||||
domain = domain.lower()
|
domain = domain.lower()
|
||||||
intent = intent.lower()
|
intent = intent.lower()
|
||||||
value = value.lower()
|
value = value
|
||||||
|
slot = slot.lower()
|
||||||
|
|
||||||
if intentVal is None : intentVal = intent
|
# all intents are same
|
||||||
|
if intentVal is None: intentVal = intent
|
||||||
|
|
||||||
k = slot
|
# fills slots
|
||||||
|
if slot in self.state['belief_state']["cinema"]["book"].keys():
|
||||||
|
self.state['belief_state']["cinema"]["book"][slot] = value
|
||||||
|
|
||||||
if intent == 'inform':
|
# saves user intent
|
||||||
|
|
||||||
domain_dic = self.state['belief_state'][domain]
|
|
||||||
|
|
||||||
if k in domain_dic['semi']:
|
|
||||||
self.state['belief_state'][domain]['semi'][k] = value
|
|
||||||
elif k in domain_dic['book']:
|
|
||||||
self.state['belief_state'][domain]['book'][k] = value
|
|
||||||
elif k.lower() in domain_dic['book']:
|
|
||||||
self.state['belief_state'][domain]['book'][k.lower()] = value
|
|
||||||
elif intent == 'reqmore':
|
|
||||||
|
|
||||||
if domain not in self.state['request_state']:
|
|
||||||
self.state['request_state'][domain] = {}
|
|
||||||
if k not in self.state['request_state'][domain]:
|
|
||||||
self.state['request_state'][domain][k] = 0
|
|
||||||
self.state['user_action'].append(intentVal)
|
self.state['user_action'].append(intentVal)
|
||||||
|
|
||||||
return self.state
|
return self.state
|
||||||
|
|
||||||
def addSystemAct(self, act):
|
def addSystemAct(self, act):
|
||||||
@ -50,6 +41,20 @@ class DST:
|
|||||||
result.append(key)
|
result.append(key)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def getFilledSlots(self):
|
||||||
|
result = []
|
||||||
|
for key in self.state['belief_state']["cinema"]["book"].keys():
|
||||||
|
if self.state['belief_state']["cinema"]["book"][key] != "":
|
||||||
|
result.append(key)
|
||||||
|
return result
|
||||||
|
|
||||||
|
def getSlotsWithValues(self):
|
||||||
|
result = {}
|
||||||
|
for key in self.state['belief_state']["cinema"]["book"].keys():
|
||||||
|
if self.state['belief_state']["cinema"]["book"][key] != "":
|
||||||
|
result[key] = self.state['belief_state']["cinema"]["book"][key]
|
||||||
|
return result
|
||||||
|
|
||||||
def getSystemSlots(self):
|
def getSystemSlots(self):
|
||||||
result = []
|
result = []
|
||||||
for key in self.state['belief_state']["cinema"]["book"].keys():
|
for key in self.state['belief_state']["cinema"]["book"].keys():
|
||||||
@ -75,13 +80,8 @@ class DST:
|
|||||||
"time": "",
|
"time": "",
|
||||||
"quantity": "",
|
"quantity": "",
|
||||||
"seats": "",
|
"seats": "",
|
||||||
"area": "",
|
|
||||||
"interval": "",
|
|
||||||
},
|
},
|
||||||
"semi": {
|
|
||||||
"goal": ""
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
return state
|
return state
|
||||||
|
|
@ -1,19 +1,27 @@
|
|||||||
import re
|
import re
|
||||||
from flair.data import Sentence, Token
|
from flair.data import Sentence, Token
|
||||||
from flair.datasets import SentenceDataset
|
from flair.datasets import SentenceDataset
|
||||||
from flair.models import SequenceTagger
|
from flair.models import SequenceTagger, TextClassifier
|
||||||
|
|
||||||
|
from .chane import getDate, getTitle
|
||||||
|
|
||||||
class NLU:
|
class NLU:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.nluModel = SequenceTagger.load('./lab/slot-model/final-model.pt')
|
self.nluModelClassifier = TextClassifier.load('./lab/resources/taggers/trec/final-model.pt')
|
||||||
|
self.nluModelTagger = SequenceTagger.load('./lab/slot-model/final-model.pt')
|
||||||
|
|
||||||
def predict(self, sentence):
|
def predict(self, sentence):
|
||||||
|
# user act prediction
|
||||||
|
sentenceClass = Sentence(sentence)
|
||||||
|
self.nluModelClassifier.predict(sentenceClass)
|
||||||
|
|
||||||
|
# tags prediction
|
||||||
sentence = self.getStrCleaned(sentence)
|
sentence = self.getStrCleaned(sentence)
|
||||||
csentence = [{'form': word} for word in sentence]
|
csentence = [{'form': word} for word in sentence]
|
||||||
fsentence = self.conllu2flair([csentence])[0]
|
fsentence = self.conllu2flair([csentence])[0]
|
||||||
self.nluModel.predict(fsentence)
|
self.nluModelTagger.predict(fsentence)
|
||||||
return self.toDSTInput([(token, ftoken.get_tag('slot').value) for token, ftoken in zip(sentence, fsentence)])
|
return self.toDSTInput([(token, ftoken.get_tag('slot').value) for token, ftoken in zip(sentence, fsentence)], str(sentenceClass.labels[0]).split(" ")[0])
|
||||||
|
|
||||||
def conllu2flair(self, sentences, label=None):
|
def conllu2flair(self, sentences, label=None):
|
||||||
fsentences = []
|
fsentences = []
|
||||||
@ -42,31 +50,48 @@ class NLU:
|
|||||||
messageLower = messageLower.replace(char,'')
|
messageLower = messageLower.replace(char,'')
|
||||||
return messageLower.split()
|
return messageLower.split()
|
||||||
|
|
||||||
def toDSTInput(self, taggedSentence):
|
def toDSTInput(self, taggedSentence, intent):
|
||||||
result = []
|
result = []
|
||||||
intent = None
|
|
||||||
slotValue = None
|
slotValue = None
|
||||||
slot = None
|
slot = None
|
||||||
for tuple in taggedSentence:
|
for tuple in taggedSentence:
|
||||||
value, tagInt = tuple
|
value, tag = tuple
|
||||||
if intent is None: intent = tagInt.split("/")[1]
|
if tag == "O":
|
||||||
if tagInt.split("/")[0] == "O":
|
|
||||||
if slotValue is not None:
|
if slotValue is not None:
|
||||||
result.append([intent, 'Cinema', slot, slotValue])
|
result.append([intent, 'Cinema', slot, slotValue])
|
||||||
slot = None
|
slot = None
|
||||||
slotValue = None
|
slotValue = None
|
||||||
elif tagInt.split("/")[0].split("-")[0] == "B":
|
else:
|
||||||
slot = tagInt.split("/")[0].split("-")[1]
|
findedSlot = tag.split("-")[1]
|
||||||
slotValue = value
|
if slot is not None:
|
||||||
elif tagInt.split("/")[0].split("-")[0] == "I":
|
if findedSlot == slot:
|
||||||
try:
|
|
||||||
slotValue += " " + value
|
slotValue += " " + value
|
||||||
except:
|
else:
|
||||||
slot = tagInt.split("/")[0].split("-")[1]
|
result.append([intent, 'Cinema', slot, slotValue])
|
||||||
|
slot = findedSlot
|
||||||
slotValue = value
|
slotValue = value
|
||||||
|
else:
|
||||||
|
slot = findedSlot
|
||||||
|
slotValue = value
|
||||||
|
# elif tag.split("-")[0] == "B":
|
||||||
|
# if slot is not None & findedSlot != slot :
|
||||||
|
# slot = tag.split("-")[1]
|
||||||
|
# slotValue = value
|
||||||
|
# elif tag.split("-")[0] == "I":
|
||||||
|
# try:
|
||||||
|
# slotValue += " " + value
|
||||||
|
# except:
|
||||||
|
# slot = tag.split("-")[1]
|
||||||
|
# slotValue = value
|
||||||
|
|
||||||
if slotValue is not None:
|
if slotValue is not None:
|
||||||
|
# normalise input
|
||||||
|
if slot == "title":
|
||||||
|
slotValue = getTitle(slotValue)
|
||||||
|
elif slot == "date":
|
||||||
|
slotValue = getDate(slotValue)
|
||||||
result.append([intent, 'Cinema', slot, slotValue])
|
result.append([intent, 'Cinema', slot, slotValue])
|
||||||
|
if len(result) == 0: result.append([intent, 'Cinema', "", ""])
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
19
src/components/README.md
Normal file
19
src/components/README.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
## TODO lista
|
||||||
|
|
||||||
|
- mock bazy danych z dostępnymi filmami, datami, godzinami, wolnymi miejscami
|
||||||
|
|
||||||
|
- NLU:
|
||||||
|
- poprawne rozumienie REQMORÓW użytkownika, przemyślenie slotów dla reqmore
|
||||||
|
|
||||||
|
- DST:
|
||||||
|
- obsługa SELECT
|
||||||
|
- po dodaniu wartości slotu sprawdzenie czy ważniejsze sloty (wyżej w słowniku) nadal pasują, jeśli nie to zaproponowanie SELECTEM innych wartości slotów (stan DST musi o tym informować a DP musi podjąć decyzję o wysłaniu SELECTA i slotu do NLG)
|
||||||
|
|
||||||
|
- DP:
|
||||||
|
- dodanie SELECT dla filmu, daty, godziny, miejsc
|
||||||
|
- odpowiedź na REQMORE usera
|
||||||
|
|
||||||
|
- NLG:
|
||||||
|
- całe
|
||||||
|
|
||||||
|
- normalizacja wartości slotów
|
59
src/components/chane.py
Normal file
59
src/components/chane.py
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
from difflib import SequenceMatcher
|
||||||
|
from datetime import date
|
||||||
|
import datetime
|
||||||
|
from dateutil.parser import parse
|
||||||
|
|
||||||
|
def getDate(user_date):
|
||||||
|
#jeżeli w dacie są jakieś liczby, to uznajemy ją za poprawną datę
|
||||||
|
if any(char.isdigit() for char in user_date):
|
||||||
|
return user_date
|
||||||
|
#synonimy słów oznaczające kolejne dni
|
||||||
|
dict_today = ["dzisiaj", "dziś"]
|
||||||
|
dict_tommorow = ['jutro']
|
||||||
|
dict_day_after_tomorrow = ['za dwa dni', 'pojutrze']
|
||||||
|
|
||||||
|
#sprawdzenie, jak bardzo podobne jest słowo, które podał u żytkownik do jednego z przypadków (i bierzemy najbardziej podobne)
|
||||||
|
result_today = max(map(lambda x: SequenceMatcher(a=user_date, b=x).ratio(), dict_today))
|
||||||
|
result_tommorow = max(map(lambda x: SequenceMatcher(a=user_date, b=x).ratio(), dict_tommorow))
|
||||||
|
result_day_after_tomorrow = max(map(lambda x: SequenceMatcher(a=user_date, b=x).ratio(), dict_day_after_tomorrow))
|
||||||
|
|
||||||
|
#zwrócenie wyniku dzisiaj, dzisiaj+1 (jutro), dzisiaj+2 (pojutrze)
|
||||||
|
if result_today > result_tommorow and result_today > result_day_after_tomorrow:
|
||||||
|
return date.today().strftime("%d.%m")
|
||||||
|
elif result_tommorow > result_day_after_tomorrow:
|
||||||
|
return (date.today() + datetime.timedelta(days=1)).strftime("%d.%m")
|
||||||
|
else:
|
||||||
|
return (date.today() + datetime.timedelta(days=2)).strftime("%d.%m")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def getTitle(user_title):
|
||||||
|
titles=["Batman", "Na Noże", "Uncharted", "Ambulans", "Minionki", "Fantastyczne Zwierzęta", "To Nie Wypanda",
|
||||||
|
"Inni Ludzie", "Zorro"]
|
||||||
|
number_list = list(map(lambda x: SequenceMatcher(a=user_title, b=x).ratio(), titles))
|
||||||
|
max_value = max(number_list)
|
||||||
|
max_index = number_list.index(max_value)
|
||||||
|
return titles[max_index]
|
||||||
|
|
||||||
|
#def getSeats:
|
||||||
|
#pass
|
||||||
|
|
||||||
|
def getTime(user_time):
|
||||||
|
numbers = re.findall('[0-9]+', user_time)
|
||||||
|
numbers = [number.zfill(2) for number in numbers]
|
||||||
|
return ":".join(numbers[:2])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -18,16 +18,18 @@ def chatbot():
|
|||||||
|
|
||||||
# main loop
|
# main loop
|
||||||
while isActive:
|
while isActive:
|
||||||
userMessage = input("$")
|
userMessage = input("$ ")
|
||||||
if userMessage == "/exit":
|
if userMessage == "/exit":
|
||||||
print("Do usłyszenia")
|
print("Do usłyszenia")
|
||||||
isActive = False
|
isActive = False
|
||||||
|
elif userMessage == "/reset":
|
||||||
|
chatbot()
|
||||||
else:
|
else:
|
||||||
nluPred = nlu.predict(sentence=userMessage)
|
nluPred = nlu.predict(sentence=userMessage)
|
||||||
# print(nluPred)
|
print(nluPred)
|
||||||
dst.update(nluPred)
|
dst.update(nluPred)
|
||||||
# print(dst.state)
|
# print(dst.state)
|
||||||
dpAct = dp.getAction(dst.getLastUserAct(), dst.getEmptySlots(), dst.getSystemSlots())
|
dpAct = dp.getAction(dst.getLastUserAct(), dst.getEmptySlots(), dst.getSystemSlots(), dst.getSlotsWithValues())
|
||||||
print(dpAct)
|
print(dpAct)
|
||||||
# todo update DST system act
|
# TODO update DST system act
|
||||||
chatbot()
|
chatbot()
|
@ -10,9 +10,9 @@
|
|||||||
| area | preferred place to sit | [front, middle] OR [random, aisle]
|
| area | preferred place to sit | [front, middle] OR [random, aisle]
|
||||||
| interval | time interval | w tym tygodniu OR w następnym tygodniu
|
| interval | time interval | w tym tygodniu OR w następnym tygodniu
|
||||||
| goal | users goal in system | chciałbym zarezerwować(opcjonalne) OR jakie filmy gracie
|
| goal | users goal in system | chciałbym zarezerwować(opcjonalne) OR jakie filmy gracie
|
||||||
|
| reservation_id | reservation number | 32453758
|
||||||
| tickets_type - | tickets types and quantities | [normal, 1] OR [[student, 2], [normal, 1]]
|
| tickets_type - | tickets types and quantities | [normal, 1] OR [[student, 2], [normal, 1]]
|
||||||
| location - | location of cinema | Poznań Plaza OR Multikino 51
|
| location - | location of cinema | Poznań Plaza OR Multikino 51
|
||||||
| reservation_id - | reservation number | 32453758
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
33
tasks/zad8/pl/dataSentence/test.tsv
Normal file
33
tasks/zad8/pl/dataSentence/test.tsv
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
Dzień dobry. hello
|
||||||
|
Jakie filmy są w tym tygodniu w repertuarze? reqmore
|
||||||
|
O której godzinie w piątej mogę zobaczyć Na noże? reqmore inform
|
||||||
|
Ok, w takim razie chciałbym zarezerwować 2 miejsca na seans o 19:30. inform
|
||||||
|
Dwa normalne. inform
|
||||||
|
Mogą być. ack
|
||||||
|
Dziękuje bardzo. bye
|
||||||
|
Witam hello
|
||||||
|
Chciałbym zarezerować dwa bilety na Batman inform
|
||||||
|
A kiedy jest najbliższy seans? inform
|
||||||
|
To poproszę trzy bilety na batmana o 15:30 inform
|
||||||
|
Na samym tyle sali inform
|
||||||
|
Dziękuję thankyou
|
||||||
|
Hej hello
|
||||||
|
Chciałbym kupić bilety na seans Zorro - jak to było na prawdę inform
|
||||||
|
Zorro2 inform
|
||||||
|
Poproszę o listę seansów reqmore
|
||||||
|
Poproszę o listę filmów granych jutro wieczorem reqmore inform
|
||||||
|
Chciałbym kupić bilety na film To nie wypanda inform
|
||||||
|
20:15 inform
|
||||||
|
11 inform
|
||||||
|
W środku, pomiedzy górnym i środkowym rzędzie
|
||||||
|
W środku, pomiedzy górnym i środkowym rzędem inform
|
||||||
|
<3 thankyou
|
||||||
|
Dzień dobry hello
|
||||||
|
Chciał bym zamówić bilet na film Minionki dzisiaj o 18.30 inform
|
||||||
|
czy jest jakis film o godzinie 18:30? reqmore
|
||||||
|
niech będzie ack
|
||||||
|
1 inform
|
||||||
|
jakie sš dostępne ulgi?
|
||||||
|
studencka inform
|
||||||
|
daleko od ekranu inform
|
||||||
|
tak ack
|
|
330
tasks/zad8/pl/dataSentence/train.tsv
Normal file
330
tasks/zad8/pl/dataSentence/train.tsv
Normal file
@ -0,0 +1,330 @@
|
|||||||
|
Tak. inform
|
||||||
|
Normalny. reqmore
|
||||||
|
Super, poproszę by miejsca były obok siebie. inform
|
||||||
|
Super, czy można płacić z góry? reqmore
|
||||||
|
Ok, czy bilety mam już zarezerwowane? reqmore
|
||||||
|
Super, dziękuję. bye
|
||||||
|
Dzień dobry. hello
|
||||||
|
Chcę zarezerwować bilety. inform
|
||||||
|
Dzisiaj. inform
|
||||||
|
16:30:00 infomrm
|
||||||
|
Cześć. hello
|
||||||
|
Chciałbym anulować rezerwację biletu. inform
|
||||||
|
Numer 42069. inform
|
||||||
|
Numer 42068. inform
|
||||||
|
Numer 42067. inform
|
||||||
|
Chciałbym anulować rezerwację biletu dla imienia i nazwiska Jan Kowalski inform
|
||||||
|
Nie pamiętam. Czy mogę podać e-mail? reqmore
|
||||||
|
elo. hello
|
||||||
|
Chciałbym kupić bilety na seans Zorro - jak to było na prawdę. inform
|
||||||
|
Poproszę listę filmów granych jutro wieczorem reqmore inform
|
||||||
|
Chciałbym kupić bilety na Transformers. inform
|
||||||
|
Tak, chcę dwa bilety za 2 dni. inform
|
||||||
|
Normalne. inform
|
||||||
|
Przy oknie, w przedziale.
|
||||||
|
Wagon z przedziałami, miejsce przy oknie.
|
||||||
|
Tak, ale bardziej z góry. inform
|
||||||
|
Exit. bye
|
||||||
|
Kim jesteś? help
|
||||||
|
Co gracie? reqmore
|
||||||
|
Jaki Zorro? reqmore
|
||||||
|
W jakich godzinach gracie Zorro? reqmore
|
||||||
|
Chciałbym zarezerwować bilety na Batmana. inform
|
||||||
|
21.03.2022. inform
|
||||||
|
23.03.2022. inform
|
||||||
|
Super. ack
|
||||||
|
13:00 inform
|
||||||
|
1 normalny. inform
|
||||||
|
Blisko ekranu. inform
|
||||||
|
Dziękuję, do usłyszenia. bye
|
||||||
|
Dzień dobry. hello
|
||||||
|
chciałbym się dowiedzieć jaki jest cennik. reqmore
|
||||||
|
A jest zniżka studencka? reqmore
|
||||||
|
a co leci dzisiaj w kinie? reqmore inform
|
||||||
|
o której jest na noże? reqmore inform
|
||||||
|
poproszę dwa bilety na 12 inform
|
||||||
|
a jakie są? reqmore
|
||||||
|
2 ulgowe poprosze. inform
|
||||||
|
jakie są wolne miejsca? reqmore
|
||||||
|
Tak. ack
|
||||||
|
Chciałbym 3 bilety na batmana na jtro. inform
|
||||||
|
coś koło południa. reqmore
|
||||||
|
nic później? reqalts
|
||||||
|
To ten o 19. inform
|
||||||
|
2 ulgowe. inform
|
||||||
|
z przodu. inform
|
||||||
|
ale jakie miejsca?? reqmore
|
||||||
|
Dzień dobry. hello
|
||||||
|
Chciałabym zarezerwować bilet do kina. inform
|
||||||
|
Dziś. inform
|
||||||
|
Proszę na batmana. inform
|
||||||
|
Proszę o godzine 20:19. inform
|
||||||
|
ulogwy. inform
|
||||||
|
1. impl-conf inform
|
||||||
|
z tyłu, na środku (aby ekran był centralnie widoczny). inform
|
||||||
|
dobrze, dziekuję. bye
|
||||||
|
Witam hello
|
||||||
|
Co potrafisz? help
|
||||||
|
Jakie są najbliższe seanse? inform
|
||||||
|
A jakie są dostępne? reqmore
|
||||||
|
A w jakim to kinie? request
|
||||||
|
A gdzie jest to kino? reqmore
|
||||||
|
O której grają Uncharted? reqmore inform
|
||||||
|
Ile kosztują bilety na ten film? request
|
||||||
|
A w jaki dzień bielty są tańsze? reqmore
|
||||||
|
w takim razie chciałbym zarezerwować dwa bilety normalne i jeden ulgowy na środę 20:00 inform
|
||||||
|
Na środku sali inform
|
||||||
|
ok ack
|
||||||
|
Witam hello
|
||||||
|
Jaki jest repertuar na piątek? reqmore inform
|
||||||
|
O jakich godzinach grają te filmy? reqmore
|
||||||
|
Wszystkie ack
|
||||||
|
Czy obgługujecie rezerwację biletów grupowych? request
|
||||||
|
Rozumiem, a jak mogę dokonać rezerwacji dla 20 osób? reqmore
|
||||||
|
Tak affirm
|
||||||
|
dziękuję ack
|
||||||
|
Witam hello
|
||||||
|
Czy w kinie Rialto grają jakieś stare filmy? reqmore
|
||||||
|
to dziękuję thankyou
|
||||||
|
Witam hello
|
||||||
|
Czy tylko można u was rezerwować Nachos ?
|
||||||
|
Chciałbym zapytać co u pana hello
|
||||||
|
Poproszę bilet na batmana o 19:00 inform
|
||||||
|
bez ludzi w okolicy inform
|
||||||
|
Czy to wszystko affirm
|
||||||
|
Dzień dobry! hello
|
||||||
|
Chciałbym zarezerwować film
|
||||||
|
Bilet na film inform
|
||||||
|
Jakie filmy są teraz w kinach? request
|
||||||
|
poproszę 3x bilet na ambulans inform
|
||||||
|
niech będzie ten ostatni inform
|
||||||
|
Przedostatnim inform
|
||||||
|
Spoko ack
|
||||||
|
Chciałbym jeszcze kupon na jedzenie
|
||||||
|
Poproszę słony popcorn
|
||||||
|
Duży
|
||||||
|
Nara bye
|
||||||
|
Dzień dobry hello
|
||||||
|
Chciał bym zamówić bilet na film Minionki dzisiaj o 18.30 inform
|
||||||
|
to poprosze ups 2 inform
|
||||||
|
na dzisiaj inform
|
||||||
|
najlepiej 18.30 inform
|
||||||
|
poprosze 18 inform
|
||||||
|
jakie są dostępne miejsca? request
|
||||||
|
które miejsca są daleko od ekranu? reqmore
|
||||||
|
w takim razie poproszę M5 inform
|
||||||
|
dziekuje thankyou
|
||||||
|
Cześć hello
|
||||||
|
Co mogę zarezerwować? reqmore
|
||||||
|
Gdzie znajduje się kino? request
|
||||||
|
Tak, chciałbym iść do multikina na Malcie inform
|
||||||
|
Super, teraz chciałbym zarezerwować bilet na film inform
|
||||||
|
Uncharted inform
|
||||||
|
wybieram godzine 12:00 inform
|
||||||
|
1 miejsce, gdzieś na środku sali inform
|
||||||
|
Pasuje ack
|
||||||
|
Elo help
|
||||||
|
Chciałabym zarezerwować bilet inform
|
||||||
|
Co gracie request
|
||||||
|
Ja bym chciała na Fantsaczne zwierzta inform
|
||||||
|
29.03.2022 inform
|
||||||
|
Jakoś wieczorkiem inform
|
||||||
|
To na 21 prosze inform
|
||||||
|
To na 18 proszę inform
|
||||||
|
Najlepsze inform
|
||||||
|
Moment no ile tych miejsc i czemu nie są w tym samym rzędzie reqmore
|
||||||
|
proszę z managerem
|
||||||
|
Jeden dla mnie i dla kotka proszę inform
|
||||||
|
Dobra, to blikiem proszę
|
||||||
|
Halo halo
|
||||||
|
nie skończyłam
|
||||||
|
Ehhh
|
||||||
|
DZIEŃ DOBRY hello
|
||||||
|
No właśnie. W czym możesz pomóc? help
|
||||||
|
A jedzonko macie? reqmore
|
||||||
|
Nachosy proszę reqmore
|
||||||
|
A jakie sosy do Nachosów? reqmore
|
||||||
|
Chciałabym anulować rezerwację inform
|
||||||
|
123123 inform
|
||||||
|
Dzięki <3 thankyou
|
||||||
|
Dzień dobry hello
|
||||||
|
Chciałabym zmienić rezerwację inform
|
||||||
|
123123 inform
|
||||||
|
Upewniam się ack
|
||||||
|
Dzień dobry hello
|
||||||
|
Chciałbym zarezerwować bilety inform
|
||||||
|
batman inform
|
||||||
|
dzisiaj inform
|
||||||
|
podaj więcej informacji o seansach reqmore
|
||||||
|
podaj więcej informacji o seansie o 15.20 reqmore
|
||||||
|
czy film jest 2D czy 3D? reqmore
|
||||||
|
podaj informacje o napisach/dubbingu reqmore
|
||||||
|
Cześć hello
|
||||||
|
Chciałbym zarezwsfsgf bilet
|
||||||
|
Chciałbym zarezerwować bilet inform
|
||||||
|
Jakie są wyświetlane w najbliższą sobotę? reqmore
|
||||||
|
W których godzinach grany jest film To nie wypanda? reqmore inform
|
||||||
|
W takim razie chciałbym kupić 3 bilety, jeśli możliwe miejsca koło siebie inform
|
||||||
|
Najbliższa sobota inform
|
||||||
|
Godzina 19:30 inform
|
||||||
|
Najlepiej w ostatnim rzędzie inform
|
||||||
|
Chciałbym zapłacić przy odbiorze reqmore
|
||||||
|
Czy moja rezerwacja została potwierdzona? reqmore
|
||||||
|
84372 inform
|
||||||
|
Nie negate
|
||||||
|
Dzień dobry hello
|
||||||
|
Chciałbym dowiedzieć się jakie filmy są wyświetlane w tym tygodniu. reqmore
|
||||||
|
W jakich godzinach mogę zobaczyć Batmana w piątek? reqmore inform
|
||||||
|
Chciałbym zarezerwować 3 miejsca na seans o 17:45 inform
|
||||||
|
Czy są dostępne miejsca w tylnych rzędach? reqmore inform
|
||||||
|
Ok affirm inform
|
||||||
|
Dziękuję, do widzenia bye thankyou
|
||||||
|
Dzień dobry, chciałbym anulować rezerwację hello inform
|
||||||
|
87574 inform
|
||||||
|
Potwierdzam affirm
|
||||||
|
Cześć hello
|
||||||
|
Nie możesz thankyou
|
||||||
|
Dzień dobry, Systemie hello
|
||||||
|
Chciałbym kupić nachos reqmore
|
||||||
|
Jak mogę się do takiej strefy dostać? reqmore
|
||||||
|
W jakim mieście? reqmore
|
||||||
|
Czy można zarezerwować u was bilety na seans? reqmore
|
||||||
|
Jakie polecasz? reqmore
|
||||||
|
Jaką ocenę posiada Batman? reqmore
|
||||||
|
Dobrze. Chciałbym zatem zarezerwować bilet na Innych Ludzi inform
|
||||||
|
22.03.2022 inform
|
||||||
|
Jutro, po godzinie 16:00 inform
|
||||||
|
Jaki jutro jest dzień tygodnia? request
|
||||||
|
To poproszę o rezerwację na 17:45 inform
|
||||||
|
17:45 inform
|
||||||
|
Z tyłu sali, nie na samym końcu inform
|
||||||
|
W jakiej części rzędu znajduje się to miejsce? request
|
||||||
|
Dziękuję thankyou
|
||||||
|
Dzień dobry hello
|
||||||
|
chciałbym kupić dwa bilety na batmana inform
|
||||||
|
jutro inform
|
||||||
|
poproszę na 20:30 inform
|
||||||
|
z tyłu inform
|
||||||
|
w jakiej cenie są bilety? help
|
||||||
|
są zniżki studenckie? help
|
||||||
|
mógłbym kupić bilety? reqmore
|
||||||
|
batman - chciałbym kupić zarezerwowane miejsca reqmore inform
|
||||||
|
dobrze czy wystarczy zachować numer rezerwacji? reqmore
|
||||||
|
dobrze ack
|
||||||
|
witam hello
|
||||||
|
jakie są jutro filmy? reqmore inform
|
||||||
|
o ktorej jest nasze magiczne encanto? reqmore inform
|
||||||
|
poproszę 3 bilety na 18:20 inform
|
||||||
|
na środku inform
|
||||||
|
poproszę jeszcze jedno miejsce obok inform
|
||||||
|
dziekuje thankyou
|
||||||
|
do widzenia bye
|
||||||
|
Co dziś leci reqmore inform
|
||||||
|
Co jest dobre dla dzieci reqmore
|
||||||
|
"Poproszę 2 na ""to nie wypanda""" inform
|
||||||
|
a z przodu gdzieś inform
|
||||||
|
eee a o której?? request
|
||||||
|
Dzień dobry hello
|
||||||
|
Chciałabym zarezerwować bilet do kina inform
|
||||||
|
Wyjdż za mnie inform
|
||||||
|
The batman inform
|
||||||
|
Dziś wieczorem inform
|
||||||
|
Proszę o godzinie 20:15 inform
|
||||||
|
z tyłu, na środku (aby ekran był centralnie widoczny) inform
|
||||||
|
Dobrze, dziękuję thankyou
|
||||||
|
cześć hello
|
||||||
|
chciałbym sprawdzić repertuar kin reqmore
|
||||||
|
na dzisiaj inform
|
||||||
|
Witam hello
|
||||||
|
Jakie sš najbliższe seanse? reqmore
|
||||||
|
W jakim to kinie? reqmore
|
||||||
|
A gdzie jest to kino? reqmore
|
||||||
|
Ile kosztujš bilety na Inni ludzie? reqmore
|
||||||
|
oba inform
|
||||||
|
A w jaki dzień bilety sš tańsze? reqmore
|
||||||
|
W takim razie chciałbym zarezerwować dwa bilety na czwartek na film Inni Ludzie inform
|
||||||
|
Jeden normalny i ulgowy inform
|
||||||
|
Na środku Sali inform
|
||||||
|
Chciałem zarezerwować dwa miejsca reqmore
|
||||||
|
Zgadzam się infrom
|
||||||
|
Tak inform
|
||||||
|
Jaki jest koszt tej rezerwacji? reqmore
|
||||||
|
A ile kosztuje bilety łącznie? reqmore
|
||||||
|
ok. Dziękuję ack
|
||||||
|
Witam hello
|
||||||
|
Chciałbym zarezerwować bilet ale nie wiem na co. inform
|
||||||
|
Czy film Historia mojej żony jest ciekawy ? reqmore
|
||||||
|
Dobrze to poproszę inform
|
||||||
|
Ulgowy inform
|
||||||
|
czy jest jakaś maksymalna liczba ? reqmore
|
||||||
|
to poproszę 100 inform
|
||||||
|
tak jak powiedziałem ulgowe inform
|
||||||
|
środek Sali inform
|
||||||
|
tak confirm
|
||||||
|
Nie dziękuje negate confirm
|
||||||
|
Dzień dobry! hello
|
||||||
|
Chciałbym zarezerwować seans. Bilet na seans inform
|
||||||
|
Jakie filmy są obecnie na ekranach? reqmore
|
||||||
|
Sobota inform
|
||||||
|
Poproszę 2 bilety na innych ludzi inform
|
||||||
|
jeden ulgowy i jeden zwykły inform infrom
|
||||||
|
Na środku Sali infrom
|
||||||
|
Pewnie ack
|
||||||
|
czy te miejsca sš obok siebie? reqmore
|
||||||
|
Dzień dobry hello
|
||||||
|
Chciałabym zarezerwować bilety inform
|
||||||
|
Jaki film jest grany jutro w godzinach popołudniowych? request
|
||||||
|
Czy sš wcześniejsze seanse? reqmore
|
||||||
|
W takim razie chcę zarezerwować bilety na Psie Pazury inform
|
||||||
|
Komu przysługuje ulga?
|
||||||
|
Kim jest senior?
|
||||||
|
W takim razie chcę zarezerwować normalne bilety na Psie Pazury inform
|
||||||
|
Na środku inform
|
||||||
|
3 inform
|
||||||
|
Tak ack
|
||||||
|
Ale chciałam 3 bilety negate
|
||||||
|
zgadzam się ack
|
||||||
|
tak ack
|
||||||
|
nier negate
|
||||||
|
tak ack
|
||||||
|
nie
|
||||||
|
Dzień dobry hello
|
||||||
|
Chciałbym dowiedzieć się jaki jest aktualnie repertuar request
|
||||||
|
Jutro jest w repertuarze film inni ludzie? request
|
||||||
|
Ile kosztuje bilet na ten film? request
|
||||||
|
ulogwy
|
||||||
|
W górnej części sali inform
|
||||||
|
Gdzie znajduje się to miejsce względem ekranu? reqmore
|
||||||
|
Chciałbym na środku inform
|
||||||
|
zgadzam ack
|
||||||
|
jaka jest cena? reqmore
|
||||||
|
Dobrze, rezerwuje ack
|
||||||
|
Chciałbym anulować rezerwację deny
|
||||||
|
Dziekuje bye
|
||||||
|
Cześć hello
|
||||||
|
Co można u was zjeść? request
|
||||||
|
Co można obejrzeć w kwietniu request
|
||||||
|
kiedy gracie DKF zamek? request
|
||||||
|
poproszę dwa bilety ulgowe na 25/04/2022 12:15 15:50 inform
|
||||||
|
pierwszy rzšd po lewej stronie inform
|
||||||
|
Tak ack
|
||||||
|
zgadzam się ack
|
||||||
|
Jaki jest numer mojej rezerwacji reqmore
|
||||||
|
Dziękuję systemie thankyou
|
||||||
|
Siema hello
|
||||||
|
Chcę iść do kina inform
|
||||||
|
Co gracie request
|
||||||
|
To na fdantastyczne zwierznera prosze inform
|
||||||
|
A co macie request
|
||||||
|
A na za tydzień? request
|
||||||
|
To na za tydzień na cud guadalupe proszę inform
|
||||||
|
To na coś innego request
|
||||||
|
Dzisiaj inform
|
||||||
|
Zaskocz mnie
|
||||||
|
No to jakoś niech będzie jakoś to będzie inform
|
||||||
|
Jeden dla mnie, drugi dla kota
|
||||||
|
To jeden będzie infrom
|
||||||
|
normalny
|
||||||
|
na środku gdzieś inform
|
||||||
|
Niech będzie ack
|
||||||
|
jakieś potwierdzenie rezerwacji dostanę czy mogę po prostu wejść i usišść? request
|
|
@ -1,9 +1,19 @@
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
from sympy import true
|
||||||
|
|
||||||
def flatten(t):
|
def flatten(t):
|
||||||
return [item for sublist in t for item in sublist]
|
return [item for sublist in t for item in sublist]
|
||||||
|
|
||||||
def getData():
|
# def getStrCleaned(rawMessage):
|
||||||
|
# # / and : is needed for date and time recognition
|
||||||
|
# punctuation = '!"#$%&\'()*+,-.;<=>?@[\\\\]^_`{|}~'
|
||||||
|
# messageLower = rawMessage.lower()
|
||||||
|
# # new_str = re.sub(' +', ' ', new_str)
|
||||||
|
# for char in punctuation:
|
||||||
|
# messageLower = messageLower.replace(char,'')
|
||||||
|
# return messageLower.split()
|
||||||
|
|
||||||
|
def getData(testData):
|
||||||
Xdata = []
|
Xdata = []
|
||||||
Ydata = []
|
Ydata = []
|
||||||
pathOut = './tasks/zad8/pl/'
|
pathOut = './tasks/zad8/pl/'
|
||||||
@ -14,15 +24,27 @@ def getData():
|
|||||||
for i in range(16,20):
|
for i in range(16,20):
|
||||||
for j in range(20):
|
for j in range(20):
|
||||||
for nr in range(1,5):
|
for nr in range(1,5):
|
||||||
fileName = pathIn + "dialog-" + str(i).zfill(2) + "-" + str(j).zfill(2) + "-" + str(nr).zfill(2) + ".tsv"
|
fileName = pathIn + "dialog-" + str(i).zfill(2) + "-" + str(j).zfill(2) + "-" + str(nr).zfill(2)
|
||||||
|
if testData: fileName += "(test)"
|
||||||
|
fileName += ".tsv"
|
||||||
try:
|
try:
|
||||||
df = pd.read_csv(fileName, sep='\t', header=None, encoding="utf-8")
|
df = pd.read_csv(fileName, sep='\t', header=None, encoding="utf-8")
|
||||||
Xdata.append(df[1].tolist())
|
dfSys = df[df[0] == "user"]
|
||||||
Ydata.append(df[2].tolist())
|
dfSys.dropna()
|
||||||
|
Xdata.append(dfSys[1].tolist())
|
||||||
|
Ydata.append(dfSys[2].tolist())
|
||||||
|
# Xdata = [getStrCleaned(x) for x in Xdata]
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
return flatten(Xdata), flatten(Ydata)
|
return flatten(Xdata), flatten(Ydata)
|
||||||
|
|
||||||
x,y = getData()
|
x, y = getData(False)
|
||||||
|
xTest, yTest = getData(True)
|
||||||
|
dataTuples = list(zip(x, y))
|
||||||
|
testDataTuples = list(zip(xTest, yTest))
|
||||||
|
|
||||||
print(y)
|
df = pd.DataFrame(dataTuples)
|
||||||
|
dfTest = pd.DataFrame(testDataTuples)
|
||||||
|
|
||||||
|
df.to_csv('tasks/zad8/pl/dataSentence/train.tsv', sep="\t", index=False, header=None)
|
||||||
|
dfTest.to_csv('tasks/zad8/pl/dataSentence/test.tsv', sep="\t", index=False, header=None)
|
@ -11,8 +11,8 @@
|
|||||||
3 na reqmore NoLabel
|
3 na reqmore NoLabel
|
||||||
4 premierę reqmore NoLabel
|
4 premierę reqmore NoLabel
|
||||||
5 filmu reqmore NoLabel
|
5 filmu reqmore NoLabel
|
||||||
6 jakie reqmore B-goal
|
6 jakie reqmore B-question
|
||||||
7 premiery reqmore I-goal
|
7 premiery reqmore I-question
|
||||||
8 są reqmore NoLabel
|
8 są reqmore NoLabel
|
||||||
9 w reqmore B-interval
|
9 w reqmore B-interval
|
||||||
10 tym reqmore I-interval
|
10 tym reqmore I-interval
|
||||||
@ -37,27 +37,27 @@
|
|||||||
2 17:30 inform B-time
|
2 17:30 inform B-time
|
||||||
|
|
||||||
# text: są zniżki studenckie
|
# text: są zniżki studenckie
|
||||||
# intent: reqmore
|
# intent: null
|
||||||
# slots:
|
# slots:
|
||||||
1 są reqmore NoLabel
|
1 są null NoLabel
|
||||||
2 zniżki reqmore NoLabel
|
2 zniżki null NoLabel
|
||||||
3 studenckie reqmore NoLabel
|
3 studenckie null NoLabel
|
||||||
|
|
||||||
# text: super w takim razie poproszę studnecki
|
# text: super w takim razie poproszę studnecki
|
||||||
# intent: inform
|
# intent: null
|
||||||
# slots:
|
# slots:
|
||||||
1 super inform NoLabel
|
1 super null NoLabel
|
||||||
2 w inform NoLabel
|
2 w null NoLabel
|
||||||
3 takim inform NoLabel
|
3 takim null NoLabel
|
||||||
4 razie inform NoLabel
|
4 razie null NoLabel
|
||||||
5 poproszę inform NoLabel
|
5 poproszę null NoLabel
|
||||||
6 studnecki inform NoLabel
|
6 studnecki null NoLabel
|
||||||
|
|
||||||
# text: 1x studencki
|
# text: 1x bilet
|
||||||
# intent: inform
|
# intent: inform
|
||||||
# slots: 1x:quantity
|
# slots: 1x:quantity
|
||||||
1 1x inform B-quantity
|
1 1x inform B-quantity
|
||||||
2 studencki inform NoLabel
|
2 bilet inform NoLabel
|
||||||
|
|
||||||
# text: na środku
|
# text: na środku
|
||||||
# intent: inform
|
# intent: inform
|
||||||
@ -80,9 +80,9 @@
|
|||||||
1 tak inform NoLabel
|
1 tak inform NoLabel
|
||||||
|
|
||||||
# text: normalny
|
# text: normalny
|
||||||
# intent: reqmore
|
# intent: null
|
||||||
# slots:
|
# slots:
|
||||||
1 normalny reqmore NoLabel
|
1 normalny null NoLabel
|
||||||
|
|
||||||
# text: super poproszę by miejsca były obok siebie
|
# text: super poproszę by miejsca były obok siebie
|
||||||
# intent: inform
|
# intent: inform
|
||||||
@ -96,24 +96,24 @@
|
|||||||
7 siebie inform NoLabel
|
7 siebie inform NoLabel
|
||||||
|
|
||||||
# text: super czy można płacić z góry
|
# text: super czy można płacić z góry
|
||||||
# intent: reqmore
|
# intent: help
|
||||||
# slots:
|
# slots:
|
||||||
1 super reqmore NoLabel
|
1 super help NoLabel
|
||||||
2 czy reqmore NoLabel
|
2 czy help NoLabel
|
||||||
3 można reqmore NoLabel
|
3 można help NoLabel
|
||||||
4 płacić reqmore NoLabel
|
4 płacić help NoLabel
|
||||||
5 z reqmore NoLabel
|
5 z help NoLabel
|
||||||
6 góry reqmore NoLabel
|
6 góry help NoLabel
|
||||||
|
|
||||||
# text: ok czy bilety mam już zarezerwowane
|
# text: ok czy bilety mam już zarezerwowane
|
||||||
# intent: reqmore
|
# intent: help
|
||||||
# slots:
|
# slots:
|
||||||
1 ok reqmore NoLabel
|
1 ok help NoLabel
|
||||||
2 czy reqmore NoLabel
|
2 czy help NoLabel
|
||||||
3 bilety reqmore NoLabel
|
3 bilety help NoLabel
|
||||||
4 mam reqmore NoLabel
|
4 mam help NoLabel
|
||||||
5 już reqmore NoLabel
|
5 już help NoLabel
|
||||||
6 zarezerwowane reqmore NoLabel
|
6 zarezerwowane help NoLabel
|
||||||
|
|
||||||
# text: super dziękuję
|
# text: super dziękuję
|
||||||
# intent: bye
|
# intent: bye
|
||||||
@ -140,7 +140,7 @@
|
|||||||
1 dzisiaj inform B-date
|
1 dzisiaj inform B-date
|
||||||
|
|
||||||
# text: 16:30
|
# text: 16:30
|
||||||
# intent: infomrm
|
# intent: inform
|
||||||
# slots:
|
# slots:
|
||||||
1 16:30 inform B-time
|
1 16:30 inform B-time
|
||||||
|
|
||||||
@ -153,7 +153,7 @@
|
|||||||
# intent: inform
|
# intent: inform
|
||||||
# slots:
|
# slots:
|
||||||
1 chciałbym inform NoLabel
|
1 chciałbym inform NoLabel
|
||||||
2 anulować inform NoLabel
|
2 anulować inform B-goal
|
||||||
3 rezerwację inform NoLabel
|
3 rezerwację inform NoLabel
|
||||||
4 biletu inform NoLabel
|
4 biletu inform NoLabel
|
||||||
|
|
||||||
@ -161,25 +161,25 @@
|
|||||||
# intent: inform
|
# intent: inform
|
||||||
# slots:
|
# slots:
|
||||||
1 numer inform NoLabel
|
1 numer inform NoLabel
|
||||||
2 42069 inform NoLabel
|
2 42069 inform reservation_id
|
||||||
|
|
||||||
# text: numer 42068
|
# text: numer 42068
|
||||||
# intent: inform
|
# intent: inform
|
||||||
# slots:
|
# slots:
|
||||||
1 numer inform NoLabel
|
1 numer inform NoLabel
|
||||||
2 42068 inform NoLabel
|
2 42068 inform reservation_id
|
||||||
|
|
||||||
# text: numer 42067
|
# text: numer 42067
|
||||||
# intent: inform
|
# intent: inform
|
||||||
# slots:
|
# slots:
|
||||||
1 numer inform NoLabel
|
1 numer inform NoLabel
|
||||||
2 42067 inform NoLabel
|
2 42067 inform reservation_id
|
||||||
|
|
||||||
# text: chciałbym anulować rezerwację biletu dla imienia i nazwiska jan kowalski
|
# text: chciałbym anulować rezerwację biletu dla imienia i nazwiska jan kowalski
|
||||||
# intent: inform
|
# intent: inform
|
||||||
# slots:
|
# slots:
|
||||||
1 chciałbym inform NoLabel
|
1 chciałbym inform NoLabel
|
||||||
2 anulować inform NoLabel
|
2 anulować inform B-goal
|
||||||
3 rezerwację inform NoLabel
|
3 rezerwację inform NoLabel
|
||||||
4 biletu inform NoLabel
|
4 biletu inform NoLabel
|
||||||
5 dla inform NoLabel
|
5 dla inform NoLabel
|
||||||
@ -190,14 +190,14 @@
|
|||||||
10 kowalski inform NoLabel
|
10 kowalski inform NoLabel
|
||||||
|
|
||||||
# text: nie pamiętam czy mogę podać e-mail
|
# text: nie pamiętam czy mogę podać e-mail
|
||||||
# intent: reqmore
|
# intent: null
|
||||||
# slots:
|
# slots:
|
||||||
1 nie reqmore NoLabel
|
1 nie null NoLabel
|
||||||
2 pamiętam reqmore NoLabel
|
2 pamiętam null NoLabel
|
||||||
3 czy reqmore NoLabel
|
3 czy null NoLabel
|
||||||
4 mogę reqmore NoLabel
|
4 mogę null NoLabel
|
||||||
5 podać reqmore NoLabel
|
5 podać null NoLabel
|
||||||
6 e-mail reqmore NoLabel
|
6 e-mail null NoLabel
|
||||||
|
|
||||||
# text: elo
|
# text: elo
|
||||||
# intent: hello
|
# intent: hello
|
||||||
@ -221,14 +221,14 @@
|
|||||||
12 prawdę inform NoLabel
|
12 prawdę inform NoLabel
|
||||||
|
|
||||||
# text: poproszę listę filmów granych jutro wieczorem
|
# text: poproszę listę filmów granych jutro wieczorem
|
||||||
# intent: reqmore inform
|
# intent: reqmore
|
||||||
# slots: listęfilmów:goaljutro:date,wieczorem:interval
|
# slots: listęfilmów:goaljutro:date,wieczorem:interval
|
||||||
1 poproszę reqmore inform NoLabel
|
1 poproszę reqmore NoLabel
|
||||||
2 listę reqmore inform B-goal
|
2 listę reqmore B-question
|
||||||
3 filmów reqmore inform I-goal
|
3 filmów reqmore I-question
|
||||||
4 granych reqmore inform NoLabel
|
4 granych reqmore NoLabel
|
||||||
5 jutro reqmore inform B-date
|
5 jutro reqmore B-date
|
||||||
6 wieczorem reqmore inform B-interval
|
6 wieczorem reqmore B-interval
|
||||||
|
|
||||||
# text: chciałbym kupić bilety na transformers
|
# text: chciałbym kupić bilety na transformers
|
||||||
# intent: inform
|
# intent: inform
|
||||||
@ -2369,11 +2369,11 @@
|
|||||||
7 12:15 inform B-time
|
7 12:15 inform B-time
|
||||||
8 15:50 inform B-time
|
8 15:50 inform B-time
|
||||||
|
|
||||||
# text: pierwszy rzšd po lewej stronie
|
# text: pierwszy rząd po lewej stronie
|
||||||
# intent: inform
|
# intent: inform
|
||||||
# slots: pierwszyrzšdpopolewej:area
|
# slots: pierwszyrządpopolewej:area
|
||||||
1 pierwszy inform B-area
|
1 pierwszy inform B-area
|
||||||
2 rzšd inform I-area
|
2 rząd inform I-area
|
||||||
3 po inform I-area
|
3 po inform I-area
|
||||||
4 lewej inform I-area
|
4 lewej inform I-area
|
||||||
5 stronie inform NoLabel
|
5 stronie inform NoLabel
|
||||||
|
Loading…
Reference in New Issue
Block a user