Skip to content

Commit

Permalink
dianna-ai/dianna#464 Added next ToDo
Browse files Browse the repository at this point in the history
  • Loading branch information
elboyran committed Mar 7, 2023
1 parent fb286a2 commit 92fb95a
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,42 +308,45 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 25,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Rise parameter p_keep was automatically determined at 0.2\n"
"Rise parameter p_keep was automatically determined at 0.30000000000000004\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Explaining: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:11<00:00, 1.19s/it]\n"
"Explaining: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:15<00:00, 1.53s/it]\n"
]
},
{
"data": {
"text/plain": [
"[('A', 0, 0.675445753633976),\n",
" ('delectable', 1, 0.8885197058320045),\n",
" ('and', 2, 0.6921721875667571),\n",
" ('intriguing', 3, 0.9730230143666266),\n",
" ('thriller', 4, 0.8317036035656928),\n",
" ('filled', 5, 0.6274289286136627),\n",
" ('with', 6, 0.7597247225046158),\n",
" ('surprises', 7, 0.7059406036138535)]"
"[('A', 0, 0.8483416525522866),\n",
" ('delectable', 1, 0.8601043719053266),\n",
" ('and', 2, 0.7479977830251058),\n",
" ('intriguing', 3, 0.9797707005341846),\n",
" ('thriller', 4, 0.8323371187845864),\n",
" ('filled', 5, 0.7250519095857937),\n",
" ('with', 6, 0.8161629191040992),\n",
" ('surprises', 7, 0.7482723124821979)]"
]
},
"execution_count": 24,
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"## TO DO!\n",
"# Run dianna with the pre-specified parameters\n",
"\n",
"# An explanation is returned for each label, but we ask for just one label so the output is a list of length one.\n",
"explanation_relevances = dianna.explain_text(model_runner, review, model_runner.tokenizer, Explainer_type,\n",
" labels=[labels.index('positive')])[0]\n",
Expand Down

0 comments on commit 92fb95a

Please sign in to comment.