From 2525dcdf4c33edb6a25544653a0ecdcf06cfe97a Mon Sep 17 00:00:00 2001 From: Felix <65565033+fexfl@users.noreply.github.com> Date: Tue, 24 Dec 2024 11:43:09 +0100 Subject: [PATCH] Added display as option --- notebook/batching_performance.ipynb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/notebook/batching_performance.ipynb b/notebook/batching_performance.ipynb index ade26e6..62c05b4 100644 --- a/notebook/batching_performance.ipynb +++ b/notebook/batching_performance.ipynb @@ -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", @@ -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", @@ -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" ]