Generic_DialogSystem/template_nlg.ipynb

49 lines
1.1 KiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import random\n",
"\n",
"\n",
"def nlg(system_act):\n",
" domain, intent, slot, value = system_act\n",
"\n",
" if intent == 'Affirm':\n",
" r = random.randint(1, 3)\n",
"\n",
" if r == 1:\n",
" return 'Tak'\n",
" elif r == 2:\n",
" return 'Zgadza się'\n",
" else:\n",
" return 'Potwierdzam'\n",
" \n",
" if intent == 'Canthelp':\n",
" r = random.randint(1, 3)\n",
"\n",
" if r == 1:\n",
" return 'Przepraszam, ale obawiam się, że nie mogę tego zrobić'\n",
" elif r == 2:\n",
" return 'Wystąpił błąd, proszę się skontaktować z obsługą'\n",
" else:\n",
" return 'ERR://23¤Y%/'\n",
" \n",
"\n",
" if domain == 'Product':\n"
]
}
],
"metadata": {
"language_info": {
"name": "python"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}