This commit is contained in:
s459312 2023-05-25 15:37:55 +02:00
parent 299452076d
commit bfbfc507cf

View File

@ -44,18 +44,18 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 109, "execution_count": 170,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"dst = DST()\n", "dst = DST()\n",
"user_act = [('inform', 'payment', 'type', 'karta'), ('inform', 'delivery', 'type','paczkomat'), ('inform', 'product', 'type', 'telefon'), ('request', 'product', 'name', '?')]\n", "user_act = [('inform', 'payment', 'type', 'karta'), ('inform', 'delivery', 'type','paczkomat'), ('inform', 'product', 'type', 'telefon'), ('request', 'product', 'type', '?')]\n",
"state = dst.update(user_act)" "state = dst.update(user_act)"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 110, "execution_count": 171,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -63,7 +63,7 @@
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"{'payment': {'type': 'karta', 'amount': '', 'loyalty_card': ''}, 'delivery': {'type': 'paczkomat', 'address': '', 'time': ''}, 'product': {'name': '', 'type': 'telefon', 'brand': '', 'price': '', 'quantity': '', 'quality': ''}}\n", "{'payment': {'type': 'karta', 'amount': '', 'loyalty_card': ''}, 'delivery': {'type': 'paczkomat', 'address': '', 'time': ''}, 'product': {'name': '', 'type': 'telefon', 'brand': '', 'price': '', 'quantity': '', 'quality': ''}}\n",
"{'product': {'name': 0}}\n" "{'product': {'type': 0}}\n"
] ]
}, },
{ {
@ -72,7 +72,7 @@
"{'user_act': [('inform', 'payment', 'type', 'karta'),\n", "{'user_act': [('inform', 'payment', 'type', 'karta'),\n",
" ('inform', 'delivery', 'type', 'paczkomat'),\n", " ('inform', 'delivery', 'type', 'paczkomat'),\n",
" ('inform', 'product', 'type', 'telefon'),\n", " ('inform', 'product', 'type', 'telefon'),\n",
" ('request', 'product', 'name', '?')],\n", " ('request', 'product', 'type', '?')],\n",
" 'system_act': [],\n", " 'system_act': [],\n",
" 'belief_state': {'payment': {'type': 'karta',\n", " 'belief_state': {'payment': {'type': 'karta',\n",
" 'amount': '',\n", " 'amount': '',\n",
@ -84,12 +84,12 @@
" 'price': '',\n", " 'price': '',\n",
" 'quantity': '',\n", " 'quantity': '',\n",
" 'quality': ''}},\n", " 'quality': ''}},\n",
" 'request_state': {'product': {'name': 0}},\n", " 'request_state': {'product': {'type': 0}},\n",
" 'terminated': False,\n", " 'terminated': False,\n",
" 'history': []}" " 'history': []}"
] ]
}, },
"execution_count": 110, "execution_count": 171,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -102,7 +102,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 136, "execution_count": 172,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -158,25 +158,26 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 137, "execution_count": 184,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"[['Inform', 'payment', 'Choice', '1'],\n", "[['Inform', 'product', 'Choice', '3'],\n",
" ['Inform', 'delivery', 'Choice', '1'],\n",
" ['Inform', 'product', 'Choice', '3'],\n",
" ['Inform', 'product', 'name', 'banan'],\n", " ['Inform', 'product', 'name', 'banan'],\n",
" ['Recommend', 'product', 'Name', 'iPhone']]" " ['Recommend', 'product', 'Name', 'banan']]"
] ]
}, },
"execution_count": 137, "execution_count": 184,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
], ],
"source": [ "source": [
"dst = DST()\n",
"user_act = [('inform', 'product', 'type', 'energol'), ('inform', 'product', 'type', 'owoc')]\n",
"state = dst.update(user_act)\n",
"policy = SimpleRulePolicy()\n", "policy = SimpleRulePolicy()\n",
"policy.predict(dst.state)" "policy.predict(dst.state)"
] ]