Skip to content

Commit

Permalink
Added display as option
Browse files Browse the repository at this point in the history
  • Loading branch information
fexfl committed Dec 24, 2024
1 parent dabc13c commit 2525dcd
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions notebook/batching_performance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"metadata": {},
"outputs": [],
"source": [
"def performance_test(batch_size):\n",
"def performance_test(batch_size, disp=True):\n",
" print(\"-----------------------------------\")\n",
" print(\"Starting performance test for batch size\", batch_size)\n",
" # create t0 timestamp\n",
Expand Down Expand Up @@ -102,11 +102,12 @@
" ts_list.append([ts_email_start, ts_email_ppr_done, ts_email_end])\n",
"\n",
" # display the pseudonymized text\n",
" display(HTML(output_text))\n",
" # display(HTML(output_text))\n",
"\n",
" # display original text and highlight found and replaced NEs\n",
" highlighted_html = highlight_ne(text, ps.per_list, ps.org_list, ps.loc_list, ps.misc_list)\n",
" display(HTML(highlighted_html))\n",
" if disp:\n",
" highlighted_html = highlight_ne(text, ps.per_list, ps.org_list, ps.loc_list, ps.misc_list)\n",
" display(HTML(highlighted_html))\n",
"\n",
" # display timestamps\n",
"\n",
Expand Down Expand Up @@ -161,15 +162,15 @@
"metadata": {},
"outputs": [],
"source": [
"batching_sizes = [-1, -1, 1, 2, 3, 6, 10] # first run is ignored since there seem to be some inconsistencies when loading for the first time\n",
"batching_sizes = [-1, -1, 1, 2, 3, 4, 6, 8, 10] # first run is ignored since there seem to be some inconsistencies when loading for the first time\n",
"# batching_sizes = [1]\n",
"n_samples = 1\n",
"n_samples = 3\n",
"\n",
"av_email_times_for_batches = []\n",
"for bs in batching_sizes:\n",
" average_email_time = 0\n",
" for _ in range(n_samples):\n",
" t = performance_test(bs)\n",
" t = performance_test(bs, disp=False)\n",
" average_email_time += t\n",
" av_email_times_for_batches.append(average_email_time/n_samples)\n"
]
Expand Down

0 comments on commit 2525dcd

Please sign in to comment.