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",
"execution_count": 109,
"execution_count": 170,
"metadata": {},
"outputs": [],
"source": [
"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)"
]
},
{
"cell_type": "code",
"execution_count": 110,
"execution_count": 171,
"metadata": {},
"outputs": [
{
@ -63,7 +63,7 @@
"output_type": "stream",
"text": [
"{'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",
" ('inform', 'delivery', 'type', 'paczkomat'),\n",
" ('inform', 'product', 'type', 'telefon'),\n",
" ('request', 'product', 'name', '?')],\n",
" ('request', 'product', 'type', '?')],\n",
" 'system_act': [],\n",
" 'belief_state': {'payment': {'type': 'karta',\n",
" 'amount': '',\n",
@ -84,12 +84,12 @@
" 'price': '',\n",
" 'quantity': '',\n",
" 'quality': ''}},\n",
" 'request_state': {'product': {'name': 0}},\n",
" 'request_state': {'product': {'type': 0}},\n",
" 'terminated': False,\n",
" 'history': []}"
]
},
"execution_count": 110,
"execution_count": 171,
"metadata": {},
"output_type": "execute_result"
}
@ -102,7 +102,7 @@
},
{
"cell_type": "code",
"execution_count": 136,
"execution_count": 172,
"metadata": {},
"outputs": [],
"source": [
@ -158,25 +158,26 @@
},
{
"cell_type": "code",
"execution_count": 137,
"execution_count": 184,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[['Inform', 'payment', 'Choice', '1'],\n",
" ['Inform', 'delivery', 'Choice', '1'],\n",
" ['Inform', 'product', 'Choice', '3'],\n",
"[['Inform', 'product', 'Choice', '3'],\n",
" ['Inform', 'product', 'name', 'banan'],\n",
" ['Recommend', 'product', 'Name', 'iPhone']]"
" ['Recommend', 'product', 'Name', 'banan']]"
]
},
"execution_count": 137,
"execution_count": 184,
"metadata": {},
"output_type": "execute_result"
}
],
"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.predict(dst.state)"
]