From 330f3bc94779bf5ca65d9ec1baca330355ab30c2 Mon Sep 17 00:00:00 2001 From: Eugene Date: Thu, 1 Jun 2023 12:30:30 +0200 Subject: [PATCH] add template nlg, add simple rule templates --- template_nlg.ipynb | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 template_nlg.ipynb diff --git a/template_nlg.ipynb b/template_nlg.ipynb new file mode 100644 index 0000000..3b38565 --- /dev/null +++ b/template_nlg.ipynb @@ -0,0 +1,48 @@ +{ + "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 +}