diff --git a/notebooks/introductory/meta/1._Add_a_MetaCat_to_a_Model.ipynb b/notebooks/introductory/meta/1._Add_a_MetaCat_to_a_Model.ipynb index 1362c6f..cc976ac 100644 --- a/notebooks/introductory/meta/1._Add_a_MetaCat_to_a_Model.ipynb +++ b/notebooks/introductory/meta/1._Add_a_MetaCat_to_a_Model.ipynb @@ -76,7 +76,7 @@ } ], "source": [ - "! pip install \"git+https://github.com/CogStack/MedCAT2@v0.2.1#egg=medcat2[meta-cat]\" # NOTE: VERSION-STRING" + "! pip install \"git+https://github.com/CogStack/MedCAT2@v0.3.3#egg=medcat2[meta-cat]\" # NOTE: VERSION-STRING" ] }, { @@ -127,7 +127,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "034a9108", "metadata": {}, "outputs": [ @@ -144,8 +144,6 @@ } ], "source": [ - "from tokenizers import ByteLevelBPETokenizer\n", - "from medcat2.components.addons.meta_cat.meta_cat_tokenizers import TokenizerWrapperBPE\n", "# create config\n", "config = ConfigMetaCAT()\n", "# add categoryy name\n", @@ -153,15 +151,13 @@ "config.model.nclasses = 3\n", "config.general.category_value2id = {'False': 2, 'Hypothetical': 1, 'True': 0}\n", "\n", - "# create tokenizer\n", - "bpe_tok = ByteLevelBPETokenizer()\n", "data_path = os.path.join(\"in_data\", \"tok_data.txt\")\n", - "bpe_tok.train(data_path)\n", - "tokenizer = TokenizerWrapperBPE(bpe_tok)\n", "\n", "# create MetaCAT\n", "# TODO: remove need for call to protected attribute\n", - "mc = MetaCATAddon.create_new(config, cat._pipeline.tokenizer, tokenizer)\n", + "mc = MetaCATAddon.create_new(\n", + " config, cat._pipeline.tokenizer,\n", + " tknzer_preprocessor=lambda tknzer: tknzer.hf_tokenizers.train(data_path))\n", "\n", "# add MetaCAT\n", "if cat.config.components.addons:\n", diff --git a/notebooks/introductory/migration/1._Migrate_v1_model_to_v2.ipynb b/notebooks/introductory/migration/1._Migrate_v1_model_to_v2.ipynb index 42e91d8..223d337 100644 --- a/notebooks/introductory/migration/1._Migrate_v1_model_to_v2.ipynb +++ b/notebooks/introductory/migration/1._Migrate_v1_model_to_v2.ipynb @@ -28,7 +28,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "007aa248", "metadata": {}, "outputs": [ @@ -131,7 +131,7 @@ } ], "source": [ - "! pip install \"git+https://github.com/CogStack/MedCAT2@v0.2.1#egg=medcat2[meta-cat,spacy,deid]\"" + "! pip install \"git+https://github.com/CogStack/MedCAT2@v0.3.3#egg=medcat2[meta-cat,spacy,deid]\"" ] }, { diff --git a/requirements.txt b/requirements.txt index c312819..9e4ac6a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -git+https://github.com/CogStack/MedCAT2@v0.2.1#egg=medcat2 +git+https://github.com/CogStack/MedCAT2@v0.3.3#egg=medcat2 ipykernel pytest-xdist~=3.6.0 nbmake<1.6