Skip to content

Commit 298ede0

Browse files
committed
CU-8699049kf: Add a few more comments regarding get_entities_multi_texts output
1 parent 133e047 commit 298ede0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

medcat/3_run_model/run_model.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,18 @@
156156
"source": [
157157
"batch_char_size = 50000 # Batch size (BS) in number of characters\n",
158158
"for text_id, text in data_iterator(df, doc_id_column, doc_text_column):\n",
159-
" cat.get_entities(text,\n",
159+
" # NOTE: get_entities_multi_text returns an iterator\n",
160+
" # so no work gets done until the iterator use materialised\n",
161+
" output = cat.get_entities_multi_texts(text,\n",
160162
" only_cui=False,\n",
161163
" # nproc=8, # Number of processors\n",
162164
" # out_split_size_chars=20*batch_char_size,\n",
163165
" # save_dir_path=ann_folder_path,\n",
164166
" # min_free_memory=0.1,\n",
165167
" )\n",
168+
" # so if we're doing a small amount of data and/or not saving it on disk\n",
169+
" # we probably want to just convert it to a list\n",
170+
" output = list(output)\n",
166171
"\n",
167172
"medcat_logger.warning(f'Annotation process complete!')\n"
168173
]
@@ -321,7 +326,7 @@
321326
],
322327
"metadata": {
323328
"kernelspec": {
324-
"display_name": "Python 3",
329+
"display_name": "venv_v2",
325330
"language": "python",
326331
"name": "python3"
327332
},
@@ -335,12 +340,7 @@
335340
"name": "python",
336341
"nbconvert_exporter": "python",
337342
"pygments_lexer": "ipython3",
338-
"version": "3.10.8"
339-
},
340-
"vscode": {
341-
"interpreter": {
342-
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
343-
}
343+
"version": "3.10.13"
344344
}
345345
},
346346
"nbformat": 4,

0 commit comments

Comments
 (0)