Skip to content

Commit

Permalink
CU-8694vxbkh: Medcat v1.12 support (#14)
Browse files Browse the repository at this point in the history
* CU-8694vxbkh: Remove use of deprecated method

* CU-8694vxbkh: Bump medcat requirement to 1.12

* Pushing change to accommodate for changed signature

The medcat.utils.meta_cat.data_utils.encode_category_values  method has a different signature.
In working_with_cogstack, the medcat/evaluate_mct_export/mct_analysis.py  file relies on old behaviour.

* CU-8694vxbkh: Pin spacy to working versions locally

---------

Co-authored-by: shubham-s-agarwal <[email protected]>
  • Loading branch information
mart-r and shubham-s-agarwal authored Oct 8, 2024
1 parent 69a225d commit 08d65ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@
"metadata": {},
"outputs": [],
"source": [
"cat.train_supervised(data_path=mctrainer_export_path, \n",
" nepochs=3,\n",
" reset_cui_count=False,\n",
" print_stats=True,\n",
" use_filters=True,\n",
" extra_cui_filter=snomed_filter, # If not filter is set remove this line\n",
" )\n"
"cat.train_supervised_from_json(data_path=mctrainer_export_path, \n",
" nepochs=3,\n",
" reset_cui_count=False,\n",
" print_stats=True,\n",
" use_filters=True,\n",
" extra_cui_filter=snomed_filter, # If not filter is set remove this line\n",
" )\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion medcat/evaluate_mct_export/mct_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def _eval(self, metacat_model, mct_export) -> dict:

# We already have everything, just get the data
category_value2id = g_config['category_value2id']
data, _ = encode_category_values(data, existing_category_value2id=category_value2id)
data, data_undersampled, _ = encode_category_values(data, existing_category_value2id=category_value2id)
print(_)
print(len(data))
# Run evaluation
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
medcat~=1.10.2
spacy<3.8.0
medcat~=1.12.0
plotly~=5.19.0
eland==8.12.1
en_core_web_md @ https://github.com/explosion/spacy-models/releases/download/en_core_web_md-3.6.0/en_core_web_md-3.6.0-py3-none-any.whl
Expand Down

0 comments on commit 08d65ed

Please sign in to comment.