diff --git a/notebooks/introductory/Part_4_1_ByteLevelBPETokenizer_and_Embeddings.html b/notebooks/introductory/Part_4_1_ByteLevelBPETokenizer_and_Embeddings.html index 0e268a3..3dcea0d 100644 --- a/notebooks/introductory/Part_4_1_ByteLevelBPETokenizer_and_Embeddings.html +++ b/notebooks/introductory/Part_4_1_ByteLevelBPETokenizer_and_Embeddings.html @@ -1,11249 +1,12626 @@
+ -# Install medcat
-! pip install medcat~=1.12.0
+! pip install medcat~=1.12.0
try:
from medcat.cat import CAT
except:
- print("WARNING: Runtime will restart automatically and please run other cells thereafter.")
+ print("WARNING: Runtime will restart automatically and please run other cells thereafter.")
exit()
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/ Collecting medcat==1.3.0 Downloading medcat-1.3.0-py3-none-any.whl (133 kB) @@ -13334,9 +14848,10 @@
WARNING: Runtime will restart automatically and please run other cells thereafter.
import gensim
import pandas as pd
import numpy as np
@@ -13371,48 +14890,59 @@
from gensim.models import Word2Vec
DATA_DIR = "./data_p4.1/"
-! DATA_DIR="./data_p4.1/"
+
+In [2]:
+
+
+DATA_DIR = "./data_p4.1/"
+! DATA_DIR="./data_p4.1/"
-
+
+
!mkdir ./models
-!wget -N https://raw.githubusercontent.com/CogStack/MedCATtutorials/main/notebooks/introductory/data/noteevents.csv -P $DATA_DIR
+
+In [3]:
+
+
+!mkdir ./models
+!wget -N https://raw.githubusercontent.com/CogStack/MedCATtutorials/main/notebooks/introductory/data/noteevents.csv -P $DATA_DIR
-
+
mkdir: cannot create directory ‘./data’: File exists mkdir: cannot create directory ‘./models’: File exists --2022-08-25 11:42:26-- https://raw.githubusercontent.com/CogStack/MedCATtutorials/main/notebooks/introductory/data/noteevents.csv @@ -13431,12 +14961,16 @@
To train meta-annotations (e.g. Experiencer, Negation...) we need two additional models:
# To train the tokenizer we will use all the data we have from our dummy dataset.
-df = pd.read_csv(DATA_DIR + "noteevents.csv")
+df = pd.read_csv(DATA_DIR + "noteevents.csv")
df.head()
# The tokenizers from huggingface require us to save all the text used for
#training into one/multiple text files.
-f = open(DATA_DIR + "tok_data.txt", 'w')
-for text in df['text'].values:
- #We'll remove new lines, so that we have one document in one line
- text = text.strip().replace("\n", ' ')
+f = open(DATA_DIR + "tok_data.txt", 'w')
+for text in df['text'].values:
+ #We'll remove new lines, so that we have one document in one line
+ text = text.strip().replace("\n", ' ')
f.write(text.lower()) # Lowercase text to remove noise
- f.write("\n")
+ f.write("\n")
f.close()
# Create, train and save the tokenizer
tokenizer = ByteLevelBPETokenizer()
-tokenizer.train(DATA_DIR + "tok_data.txt")
-tokenizer.save("./models/bbpe")
+tokenizer.train(DATA_DIR + "tok_data.txt")
+tokenizer.save("./models/bbpe")
# Now we tokenize all the text we have and train word2vec
-f = open(DATA_DIR + "tok_data.txt", 'r')
+f = open(DATA_DIR + "tok_data.txt", 'r')
# Note that if you have a very large dataset, use iterators that
#read the text line by line from the file, do not load the whole file
#into memory.
@@ -13681,36 +15232,44 @@ Meta Annotations with MedCATw2v = Word2Vec(data, vector_size=300, min_count=1)
# Check is word2vec trained, Ġ - for this tokenizer denotes start of word (a space)
-w2v.wv.most_similar('Ġcancer')
+w2v.wv.most_similar('Ġcancer')
[('Ġmetastatic', 0.7546937465667725), ('Ġcolon', 0.7531586289405823), ('Ġbreast', 0.7017560601234436), @@ -13726,14 +15285,17 @@Meta Annotations with MedCAT +
+---In [9]:--+++In [9]:++++-# Now we just have to create the embeddings matrix embeddings = [] for i in range(tokenizer.get_vocab_size()): @@ -13746,30 +15308,35 @@Meta Annotations with MedCATembeddings.append(np.random.rand(300))
++- + + + + diff --git a/notebooks/introductory/Part_4_1_ByteLevelBPETokenizer_and_Embeddings.ipynb b/notebooks/introductory/Part_4_1_ByteLevelBPETokenizer_and_Embeddings.ipynb index 2700ba6..2d512e2 100644 --- a/notebooks/introductory/Part_4_1_ByteLevelBPETokenizer_and_Embeddings.ipynb +++ b/notebooks/introductory/Part_4_1_ByteLevelBPETokenizer_and_Embeddings.ipynb @@ -1,5 +1,12 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### NOTE: This tutorial is applicable for BiLSTM model not BERT as BERT model uses its pre-trained tokenizer.-----In [10]:--++In [10]:++++-# Save the embeddings -np.save(open("./models/embeddings.npy", 'wb'), np.array(embeddings)) +np.save(open("./models/embeddings.npy", 'wb'), np.array(embeddings))
When using BERT model for MetaCAT, directly move on to Tutorial 4.2." + ] + }, { "cell_type": "code", "execution_count": 1, diff --git a/notebooks/introductory/Part_4_2_Supervised_Training_and_Meta_annotations.html b/notebooks/introductory/Part_4_2_Supervised_Training_and_Meta_annotations.html index e28da27..b4bb367 100644 --- a/notebooks/introductory/Part_4_2_Supervised_Training_and_Meta_annotations.html +++ b/notebooks/introductory/Part_4_2_Supervised_Training_and_Meta_annotations.html @@ -1,11249 +1,12626 @@ + -Part_4_2_Supervised_Training_and_Meta_annotations +Part_4_2_Supervised_Training_and_Meta_annotations - - + + + + + + + + - +body[data-format='mobile'] .jp-OutputArea-child .jp-OutputArea-output { + display: table-row; +} - - - - - - + - --- ---In [1]:--+ ++++++- -In [ ]:++---# Install medcat -! pip install medcat~=1.12.0 +! pip install medcat~=1.12.1 # Get the spacy model -! python -m spacy download en_core_web_md +! python -m spacy download en_core_web_md try: from medcat.cat import CAT except: - print("WARNING: Runtime will restart automatically and please run other cells thereafter.") + print("WARNING: Runtime will restart automatically and please run other cells thereafter.") exit()--- - -- - - - --+Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/ -Collecting medcat==1.3.0 - Downloading medcat-1.3.0-py3-none-any.whl (133 kB) - |████████████████████████████████| 133 kB 14.3 MB/s -Collecting spacy<3.1.4,>=3.1.0 - Downloading spacy-3.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB) - |████████████████████████████████| 5.9 MB 28.0 MB/s -Collecting aiofiles~=0.8.0 - Downloading aiofiles-0.8.0-py3-none-any.whl (13 kB) -Collecting psutil<6.0.0,>=5.8.0 - Downloading psutil-5.9.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (281 kB) - |████████████████████████████████| 281 kB 104.2 MB/s -Requirement already satisfied: click<=8.0.4 in /usr/local/lib/python3.7/dist-packages (from medcat==1.3.0) (7.1.2) -Collecting xxhash==3.0.0 - Downloading xxhash-3.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (212 kB) - |████████████████████████████████| 212 kB 58.1 MB/s -Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.7/dist-packages (from medcat==1.3.0) (4.64.0) -Collecting gensim~=4.1.2 - Downloading gensim-4.1.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (24.1 MB) - |████████████████████████████████| 24.1 MB 1.4 MB/s -Collecting blis<=0.7.5 - Downloading blis-0.7.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.9 MB) - |████████████████████████████████| 9.9 MB 56.3 MB/s -Collecting transformers~=4.19.2 - Downloading transformers-4.19.4-py3-none-any.whl (4.2 MB) - |████████████████████████████████| 4.2 MB 64.9 MB/s -Requirement already satisfied: scipy<=1.8.1,>=1.5.4 in /usr/local/lib/python3.7/dist-packages (from medcat==1.3.0) (1.7.3) -Collecting ipywidgets~=7.6.5 - Downloading ipywidgets-7.6.6-py2.py3-none-any.whl (121 kB) - |████████████████████████████████| 121 kB 71.5 MB/s -Collecting jsonpickle~=2.0.0 - Downloading jsonpickle-2.0.0-py2.py3-none-any.whl (37 kB) -Collecting sklearn~=0.0 - Downloading sklearn-0.0.tar.gz (1.1 kB) -Collecting elasticsearch<8.0.0,>=7.10 - Downloading elasticsearch-7.17.4-py2.py3-none-any.whl (385 kB) - |████████████████████████████████| 385 kB 60.3 MB/s -Requirement already satisfied: numpy>=1.21.4 in /usr/local/lib/python3.7/dist-packages (from medcat==1.3.0) (1.21.6) -Collecting py2neo==2021.2.3 - Downloading py2neo-2021.2.3-py2.py3-none-any.whl (177 kB) - |████████████████████████████████| 177 kB 48.1 MB/s -Requirement already satisfied: pandas<=1.4.2,>=1.1.5 in /usr/local/lib/python3.7/dist-packages (from medcat==1.3.0) (1.3.5) -Collecting multiprocess - Downloading multiprocess-0.70.13-py37-none-any.whl (115 kB) - |████████████████████████████████| 115 kB 66.8 MB/s -Collecting datasets~=2.2.2 - Downloading datasets-2.2.2-py3-none-any.whl (346 kB) - |████████████████████████████████| 346 kB 66.9 MB/s -Requirement already satisfied: dill~=0.3.4 in /usr/local/lib/python3.7/dist-packages (from medcat==1.3.0) (0.3.5.1) -Requirement already satisfied: torch>=1.0 in /usr/local/lib/python3.7/dist-packages (from medcat==1.3.0) (1.12.1+cu113) -Requirement already satisfied: urllib3 in /usr/local/lib/python3.7/dist-packages (from py2neo==2021.2.3->medcat==1.3.0) (1.24.3) -Requirement already satisfied: pygments>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from py2neo==2021.2.3->medcat==1.3.0) (2.6.1) -Requirement already satisfied: six>=1.15.0 in /usr/local/lib/python3.7/dist-packages (from py2neo==2021.2.3->medcat==1.3.0) (1.15.0) -Collecting interchange~=2021.0.4 - Downloading interchange-2021.0.4-py2.py3-none-any.whl (28 kB) -Collecting pansi>=2020.7.3 - Downloading pansi-2020.7.3-py2.py3-none-any.whl (10 kB) -Requirement already satisfied: certifi in /usr/local/lib/python3.7/dist-packages (from py2neo==2021.2.3->medcat==1.3.0) (2022.6.15) -Requirement already satisfied: packaging in /usr/local/lib/python3.7/dist-packages (from py2neo==2021.2.3->medcat==1.3.0) (21.3) -Collecting monotonic - Downloading monotonic-1.6-py2.py3-none-any.whl (8.2 kB) -Collecting dill~=0.3.4 - Downloading dill-0.3.4-py2.py3-none-any.whl (86 kB) - |████████████████████████████████| 86 kB 5.8 MB/s -Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from datasets~=2.2.2->medcat==1.3.0) (4.12.0) -Requirement already satisfied: requests>=2.19.0 in /usr/local/lib/python3.7/dist-packages (from datasets~=2.2.2->medcat==1.3.0) (2.23.0) -Requirement already satisfied: fsspec[http]>=2021.05.0 in /usr/local/lib/python3.7/dist-packages (from datasets~=2.2.2->medcat==1.3.0) (2022.7.1) -Requirement already satisfied: pyarrow>=6.0.0 in /usr/local/lib/python3.7/dist-packages (from datasets~=2.2.2->medcat==1.3.0) (6.0.1) -Requirement already satisfied: aiohttp in /usr/local/lib/python3.7/dist-packages (from datasets~=2.2.2->medcat==1.3.0) (3.8.1) -Collecting responses<0.19 - Downloading responses-0.18.0-py3-none-any.whl (38 kB) -Collecting huggingface-hub<1.0.0,>=0.1.0 - Downloading huggingface_hub-0.9.0-py3-none-any.whl (120 kB) - |████████████████████████████████| 120 kB 69.8 MB/s -Requirement already satisfied: smart-open>=1.8.1 in /usr/local/lib/python3.7/dist-packages (from gensim~=4.1.2->medcat==1.3.0) (5.2.1) -Requirement already satisfied: filelock in /usr/local/lib/python3.7/dist-packages (from huggingface-hub<1.0.0,>=0.1.0->datasets~=2.2.2->medcat==1.3.0) (3.8.0) -Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.7/dist-packages (from huggingface-hub<1.0.0,>=0.1.0->datasets~=2.2.2->medcat==1.3.0) (6.0) -Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.7/dist-packages (from huggingface-hub<1.0.0,>=0.1.0->datasets~=2.2.2->medcat==1.3.0) (4.1.1) -Requirement already satisfied: pytz in /usr/local/lib/python3.7/dist-packages (from interchange~=2021.0.4->py2neo==2021.2.3->medcat==1.3.0) (2022.2.1) -Collecting widgetsnbextension~=3.5.0 - Downloading widgetsnbextension-3.5.2-py2.py3-none-any.whl (1.6 MB) - |████████████████████████████████| 1.6 MB 51.4 MB/s -Requirement already satisfied: traitlets>=4.3.1 in /usr/local/lib/python3.7/dist-packages (from ipywidgets~=7.6.5->medcat==1.3.0) (5.1.1) -Requirement already satisfied: ipython>=4.0.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets~=7.6.5->medcat==1.3.0) (7.9.0) -Requirement already satisfied: ipykernel>=4.5.1 in /usr/local/lib/python3.7/dist-packages (from ipywidgets~=7.6.5->medcat==1.3.0) (5.3.4) -Requirement already satisfied: nbformat>=4.2.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets~=7.6.5->medcat==1.3.0) (5.4.0) -Requirement already satisfied: ipython-genutils~=0.2.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets~=7.6.5->medcat==1.3.0) (0.2.0) -Collecting jupyterlab-widgets<3,>=1.0.0 - Downloading jupyterlab_widgets-1.1.1-py3-none-any.whl (245 kB) - |████████████████████████████████| 245 kB 52.8 MB/s -Requirement already satisfied: jupyter-client in /usr/local/lib/python3.7/dist-packages (from ipykernel>=4.5.1->ipywidgets~=7.6.5->medcat==1.3.0) (6.1.12) -Requirement already satisfied: tornado>=4.2 in /usr/local/lib/python3.7/dist-packages (from ipykernel>=4.5.1->ipywidgets~=7.6.5->medcat==1.3.0) (5.1.1) -Requirement already satisfied: prompt-toolkit<2.1.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets~=7.6.5->medcat==1.3.0) (2.0.10) -Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets~=7.6.5->medcat==1.3.0) (57.4.0) -Requirement already satisfied: backcall in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets~=7.6.5->medcat==1.3.0) (0.2.0) -Collecting jedi>=0.10 - Downloading jedi-0.18.1-py2.py3-none-any.whl (1.6 MB) - |████████████████████████████████| 1.6 MB 45.4 MB/s -Requirement already satisfied: decorator in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets~=7.6.5->medcat==1.3.0) (4.4.2) -Requirement already satisfied: pickleshare in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets~=7.6.5->medcat==1.3.0) (0.7.5) -Requirement already satisfied: pexpect in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets~=7.6.5->medcat==1.3.0) (4.8.0) -Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/lib/python3.7/dist-packages (from jedi>=0.10->ipython>=4.0.0->ipywidgets~=7.6.5->medcat==1.3.0) (0.8.3) -Requirement already satisfied: jupyter-core in /usr/local/lib/python3.7/dist-packages (from nbformat>=4.2.0->ipywidgets~=7.6.5->medcat==1.3.0) (4.11.1) -Requirement already satisfied: fastjsonschema in /usr/local/lib/python3.7/dist-packages (from nbformat>=4.2.0->ipywidgets~=7.6.5->medcat==1.3.0) (2.16.1) -Requirement already satisfied: jsonschema>=2.6 in /usr/local/lib/python3.7/dist-packages (from nbformat>=4.2.0->ipywidgets~=7.6.5->medcat==1.3.0) (4.3.3) -Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema>=2.6->nbformat>=4.2.0->ipywidgets~=7.6.5->medcat==1.3.0) (22.1.0) -Requirement already satisfied: importlib-resources>=1.4.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema>=2.6->nbformat>=4.2.0->ipywidgets~=7.6.5->medcat==1.3.0) (5.9.0) -Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema>=2.6->nbformat>=4.2.0->ipywidgets~=7.6.5->medcat==1.3.0) (0.18.1) -Requirement already satisfied: zipp>=3.1.0 in /usr/local/lib/python3.7/dist-packages (from importlib-resources>=1.4.0->jsonschema>=2.6->nbformat>=4.2.0->ipywidgets~=7.6.5->medcat==1.3.0) (3.8.1) -Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging->py2neo==2021.2.3->medcat==1.3.0) (3.0.9) -Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from pandas<=1.4.2,>=1.1.5->medcat==1.3.0) (2.8.2) -Requirement already satisfied: wcwidth in /usr/local/lib/python3.7/dist-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython>=4.0.0->ipywidgets~=7.6.5->medcat==1.3.0) (0.2.5) -Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19.0->datasets~=2.2.2->medcat==1.3.0) (3.0.4) -Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19.0->datasets~=2.2.2->medcat==1.3.0) (2.10) -Collecting urllib3 - Downloading urllib3-1.25.11-py2.py3-none-any.whl (127 kB) - |████████████████████████████████| 127 kB 57.1 MB/s -Requirement already satisfied: scikit-learn in /usr/local/lib/python3.7/dist-packages (from sklearn~=0.0->medcat==1.3.0) (1.0.2) -Collecting typing-extensions>=3.7.4.3 - Downloading typing_extensions-3.10.0.2-py3-none-any.whl (26 kB) -Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.8 in /usr/local/lib/python3.7/dist-packages (from spacy<3.1.4,>=3.1.0->medcat==1.3.0) (3.0.10) -Requirement already satisfied: wasabi<1.1.0,>=0.8.1 in /usr/local/lib/python3.7/dist-packages (from spacy<3.1.4,>=3.1.0->medcat==1.3.0) (0.10.1) -Collecting pydantic!=1.8,!=1.8.1,<1.9.0,>=1.7.4 - Downloading pydantic-1.8.2-cp37-cp37m-manylinux2014_x86_64.whl (10.1 MB) - |████████████████████████████████| 10.1 MB 68.6 MB/s -Requirement already satisfied: jinja2 in /usr/local/lib/python3.7/dist-packages (from spacy<3.1.4,>=3.1.0->medcat==1.3.0) (2.11.3) -Requirement already satisfied: typer<0.5.0,>=0.3.0 in /usr/local/lib/python3.7/dist-packages (from spacy<3.1.4,>=3.1.0->medcat==1.3.0) (0.4.2) -Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy<3.1.4,>=3.1.0->medcat==1.3.0) (3.0.7) -Collecting thinc<8.1.0,>=8.0.9 - Downloading thinc-8.0.17-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (660 kB) - |████████████████████████████████| 660 kB 81.8 MB/s -Requirement already satisfied: pathy>=0.3.5 in /usr/local/lib/python3.7/dist-packages (from spacy<3.1.4,>=3.1.0->medcat==1.3.0) (0.6.2) -Requirement already satisfied: srsly<3.0.0,>=2.4.1 in /usr/local/lib/python3.7/dist-packages (from spacy<3.1.4,>=3.1.0->medcat==1.3.0) (2.4.4) -Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /usr/local/lib/python3.7/dist-packages (from spacy<3.1.4,>=3.1.0->medcat==1.3.0) (2.0.8) -Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy<3.1.4,>=3.1.0->medcat==1.3.0) (2.0.6) -Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.7/dist-packages (from spacy<3.1.4,>=3.1.0->medcat==1.3.0) (1.0.8) -Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.7/dist-packages (from transformers~=4.19.2->medcat==1.3.0) (2022.6.2) -Collecting tokenizers!=0.11.3,<0.13,>=0.11.1 - Downloading tokenizers-0.12.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (6.6 MB) - |████████████████████████████████| 6.6 MB 46.8 MB/s -Requirement already satisfied: notebook>=4.4.1 in /usr/local/lib/python3.7/dist-packages (from widgetsnbextension~=3.5.0->ipywidgets~=7.6.5->medcat==1.3.0) (5.3.1) -Requirement already satisfied: nbconvert in /usr/local/lib/python3.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets~=7.6.5->medcat==1.3.0) (5.6.1) -Requirement already satisfied: terminado>=0.8.1 in /usr/local/lib/python3.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets~=7.6.5->medcat==1.3.0) (0.13.3) -Requirement already satisfied: Send2Trash in /usr/local/lib/python3.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets~=7.6.5->medcat==1.3.0) (1.8.0) -Requirement already satisfied: pyzmq>=13 in /usr/local/lib/python3.7/dist-packages (from jupyter-client->ipykernel>=4.5.1->ipywidgets~=7.6.5->medcat==1.3.0) (23.2.1) -Requirement already satisfied: ptyprocess in /usr/local/lib/python3.7/dist-packages (from terminado>=0.8.1->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets~=7.6.5->medcat==1.3.0) (0.7.0) -Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets~=2.2.2->medcat==1.3.0) (1.2.0) -Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets~=2.2.2->medcat==1.3.0) (1.3.1) -Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets~=2.2.2->medcat==1.3.0) (6.0.2) -Requirement already satisfied: asynctest==0.13.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets~=2.2.2->medcat==1.3.0) (0.13.0) -Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets~=2.2.2->medcat==1.3.0) (1.8.1) -Requirement already satisfied: charset-normalizer<3.0,>=2.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets~=2.2.2->medcat==1.3.0) (2.1.0) -Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets~=2.2.2->medcat==1.3.0) (4.0.2) -Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.7/dist-packages (from jinja2->spacy<3.1.4,>=3.1.0->medcat==1.3.0) (2.0.1) -Collecting multiprocess - Downloading multiprocess-0.70.12.2-py37-none-any.whl (112 kB) - |████████████████████████████████| 112 kB 72.5 MB/s -Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets~=7.6.5->medcat==1.3.0) (1.5.0) -Requirement already satisfied: bleach in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets~=7.6.5->medcat==1.3.0) (5.0.1) -Requirement already satisfied: defusedxml in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets~=7.6.5->medcat==1.3.0) (0.7.1) -Requirement already satisfied: entrypoints>=0.2.2 in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets~=7.6.5->medcat==1.3.0) (0.4) -Requirement already satisfied: testpath in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets~=7.6.5->medcat==1.3.0) (0.6.0) -Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets~=7.6.5->medcat==1.3.0) (0.8.4) -Requirement already satisfied: webencodings in /usr/local/lib/python3.7/dist-packages (from bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets~=7.6.5->medcat==1.3.0) (0.5.1) -Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn->sklearn~=0.0->medcat==1.3.0) (1.1.0) -Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from scikit-learn->sklearn~=0.0->medcat==1.3.0) (3.1.0) -Building wheels for collected packages: sklearn - Building wheel for sklearn (setup.py) ... done - Created wheel for sklearn: filename=sklearn-0.0-py2.py3-none-any.whl size=1310 sha256=0fb409a925dd6e7ddc0cdc8d7911f2d6e3889472ad56bfe48302496b0fffc20d - Stored in directory: /root/.cache/pip/wheels/46/ef/c3/157e41f5ee1372d1be90b09f74f82b10e391eaacca8f22d33e -Successfully built sklearn -Installing collected packages: typing-extensions, jedi, urllib3, pydantic, dill, blis, xxhash, widgetsnbextension, tokenizers, thinc, responses, pansi, multiprocess, monotonic, jupyterlab-widgets, interchange, huggingface-hub, transformers, spacy, sklearn, py2neo, psutil, jsonpickle, ipywidgets, gensim, elasticsearch, datasets, aiofiles, medcat - Attempting uninstall: typing-extensions - Found existing installation: typing-extensions 4.1.1 - Uninstalling typing-extensions-4.1.1: - Successfully uninstalled typing-extensions-4.1.1 - Attempting uninstall: urllib3 - Found existing installation: urllib3 1.24.3 - Uninstalling urllib3-1.24.3: - Successfully uninstalled urllib3-1.24.3 - Attempting uninstall: pydantic - Found existing installation: pydantic 1.9.2 - Uninstalling pydantic-1.9.2: - Successfully uninstalled pydantic-1.9.2 - Attempting uninstall: dill - Found existing installation: dill 0.3.5.1 - Uninstalling dill-0.3.5.1: - Successfully uninstalled dill-0.3.5.1 - Attempting uninstall: blis - Found existing installation: blis 0.7.8 - Uninstalling blis-0.7.8: - Successfully uninstalled blis-0.7.8 - Attempting uninstall: widgetsnbextension - Found existing installation: widgetsnbextension 3.6.1 - Uninstalling widgetsnbextension-3.6.1: - Successfully uninstalled widgetsnbextension-3.6.1 - Attempting uninstall: thinc - Found existing installation: thinc 8.1.0 - Uninstalling thinc-8.1.0: - Successfully uninstalled thinc-8.1.0 - Attempting uninstall: jupyterlab-widgets - Found existing installation: jupyterlab-widgets 3.0.2 - Uninstalling jupyterlab-widgets-3.0.2: - Successfully uninstalled jupyterlab-widgets-3.0.2 - Attempting uninstall: spacy - Found existing installation: spacy 3.4.1 - Uninstalling spacy-3.4.1: - Successfully uninstalled spacy-3.4.1 - Attempting uninstall: psutil - Found existing installation: psutil 5.4.8 - Uninstalling psutil-5.4.8: - Successfully uninstalled psutil-5.4.8 - Attempting uninstall: ipywidgets - Found existing installation: ipywidgets 7.7.1 - Uninstalling ipywidgets-7.7.1: - Successfully uninstalled ipywidgets-7.7.1 - Attempting uninstall: gensim - Found existing installation: gensim 3.6.0 - Uninstalling gensim-3.6.0: - Successfully uninstalled gensim-3.6.0 -ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. -en-core-web-sm 3.4.0 requires spacy<3.5.0,>=3.4.0, but you have spacy 3.1.3 which is incompatible. -Successfully installed aiofiles-0.8.0 blis-0.7.5 datasets-2.2.2 dill-0.3.4 elasticsearch-7.17.4 gensim-4.1.2 huggingface-hub-0.9.0 interchange-2021.0.4 ipywidgets-7.6.6 jedi-0.18.1 jsonpickle-2.0.0 jupyterlab-widgets-1.1.1 medcat-1.3.0 monotonic-1.6 multiprocess-0.70.12.2 pansi-2020.7.3 psutil-5.9.1 py2neo-2021.2.3 pydantic-1.8.2 responses-0.18.0 sklearn-0.0 spacy-3.1.3 thinc-8.0.17 tokenizers-0.12.1 transformers-4.19.4 typing-extensions-3.10.0.2 urllib3-1.25.11 widgetsnbextension-3.5.2 xxhash-3.0.0 -
+++-+- ++ ++ + + + + ++++Collecting medcat~=1.12.1 + Downloading medcat-1.12.1-py3-none-any.whl.metadata (8.9 kB) +Collecting numpy<1.26.0,>=1.22.0 (from medcat~=1.12.1) + Downloading numpy-1.25.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (5.6 kB) +Requirement already satisfied: pandas>=1.4.2 in /usr/local/lib/python3.10/dist-packages (from medcat~=1.12.1) (2.1.4) +Requirement already satisfied: gensim<5.0.0,>=4.3.0 in /usr/local/lib/python3.10/dist-packages (from medcat~=1.12.1) (4.3.3) +Requirement already satisfied: spacy<4.0.0,>=3.6.0 in /usr/local/lib/python3.10/dist-packages (from medcat~=1.12.1) (3.7.5) +Collecting scipy~=1.9.2 (from medcat~=1.12.1) + Downloading scipy-1.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (58 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.4/58.4 kB 549.0 kB/s eta 0:00:00 +Requirement already satisfied: transformers<5.0.0,>=4.34.0 in /usr/local/lib/python3.10/dist-packages (from medcat~=1.12.1) (4.42.4) +Requirement already satisfied: accelerate>=0.23.0 in /usr/local/lib/python3.10/dist-packages (from medcat~=1.12.1) (0.32.1) +Requirement already satisfied: torch<3.0.0,>=1.13.0 in /usr/local/lib/python3.10/dist-packages (from medcat~=1.12.1) (2.3.1+cu121) +Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.10/dist-packages (from medcat~=1.12.1) (4.66.5) +Requirement already satisfied: scikit-learn<2.0.0,>=1.1.3 in /usr/local/lib/python3.10/dist-packages (from medcat~=1.12.1) (1.3.2) +Collecting dill<1.0.0,>=0.3.6 (from medcat~=1.12.1) + Downloading dill-0.3.8-py3-none-any.whl.metadata (10 kB) +Collecting datasets<3.0.0,>=2.2.2 (from medcat~=1.12.1) + Downloading datasets-2.21.0-py3-none-any.whl.metadata (21 kB) +Requirement already satisfied: jsonpickle>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from medcat~=1.12.1) (3.2.2) +Requirement already satisfied: psutil>=5.8.0 in /usr/local/lib/python3.10/dist-packages (from medcat~=1.12.1) (5.9.5) +Collecting multiprocess~=0.70.12 (from medcat~=1.12.1) + Downloading multiprocess-0.70.16-py310-none-any.whl.metadata (7.2 kB) +Collecting aiofiles>=0.8.0 (from medcat~=1.12.1) + Downloading aiofiles-24.1.0-py3-none-any.whl.metadata (10 kB) +Requirement already satisfied: ipywidgets>=7.6.5 in /usr/local/lib/python3.10/dist-packages (from medcat~=1.12.1) (7.7.1) +Collecting xxhash>=3.0.0 (from medcat~=1.12.1) + Downloading xxhash-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB) +Requirement already satisfied: blis<1.0.0,>=0.7.5 in /usr/local/lib/python3.10/dist-packages (from medcat~=1.12.1) (0.7.11) +Requirement already satisfied: click>=8.0.4 in /usr/local/lib/python3.10/dist-packages (from medcat~=1.12.1) (8.1.7) +Collecting pydantic<2.0,>=1.10.0 (from medcat~=1.12.1) + Downloading pydantic-1.10.17-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (151 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 151.6/151.6 kB 1.4 MB/s eta 0:00:00 +Collecting humanfriendly~=10.0 (from medcat~=1.12.1) + Downloading humanfriendly-10.0-py2.py3-none-any.whl.metadata (9.2 kB) +Collecting peft>=0.8.2 (from medcat~=1.12.1) + Downloading peft-0.12.0-py3-none-any.whl.metadata (13 kB) +Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from accelerate>=0.23.0->medcat~=1.12.1) (24.1) +Requirement already satisfied: pyyaml in /usr/local/lib/python3.10/dist-packages (from accelerate>=0.23.0->medcat~=1.12.1) (6.0.2) +Requirement already satisfied: huggingface-hub in /usr/local/lib/python3.10/dist-packages (from accelerate>=0.23.0->medcat~=1.12.1) (0.23.5) +Requirement already satisfied: safetensors>=0.3.1 in /usr/local/lib/python3.10/dist-packages (from accelerate>=0.23.0->medcat~=1.12.1) (0.4.4) +Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (3.15.4) +Collecting pyarrow>=15.0.0 (from datasets<3.0.0,>=2.2.2->medcat~=1.12.1) + Downloading pyarrow-17.0.0-cp310-cp310-manylinux_2_28_x86_64.whl.metadata (3.3 kB) +Requirement already satisfied: requests>=2.32.2 in /usr/local/lib/python3.10/dist-packages (from datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (2.32.3) +Requirement already satisfied: fsspec<=2024.6.1,>=2023.1.0 in /usr/local/lib/python3.10/dist-packages (from fsspec[http]<=2024.6.1,>=2023.1.0->datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (2024.6.1) +Requirement already satisfied: aiohttp in /usr/local/lib/python3.10/dist-packages (from datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (3.10.2) +Requirement already satisfied: smart-open>=1.8.1 in /usr/local/lib/python3.10/dist-packages (from gensim<5.0.0,>=4.3.0->medcat~=1.12.1) (7.0.4) +Requirement already satisfied: ipykernel>=4.5.1 in /usr/local/lib/python3.10/dist-packages (from ipywidgets>=7.6.5->medcat~=1.12.1) (5.5.6) +Requirement already satisfied: ipython-genutils~=0.2.0 in /usr/local/lib/python3.10/dist-packages (from ipywidgets>=7.6.5->medcat~=1.12.1) (0.2.0) +Requirement already satisfied: traitlets>=4.3.1 in /usr/local/lib/python3.10/dist-packages (from ipywidgets>=7.6.5->medcat~=1.12.1) (5.7.1) +Requirement already satisfied: widgetsnbextension~=3.6.0 in /usr/local/lib/python3.10/dist-packages (from ipywidgets>=7.6.5->medcat~=1.12.1) (3.6.8) +Requirement already satisfied: ipython>=4.0.0 in /usr/local/lib/python3.10/dist-packages (from ipywidgets>=7.6.5->medcat~=1.12.1) (7.34.0) +Requirement already satisfied: jupyterlab-widgets>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from ipywidgets>=7.6.5->medcat~=1.12.1) (3.0.11) +Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.4.2->medcat~=1.12.1) (2.8.2) +Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.4.2->medcat~=1.12.1) (2024.1) +Requirement already satisfied: tzdata>=2022.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.4.2->medcat~=1.12.1) (2024.1) +Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.10/dist-packages (from pydantic<2.0,>=1.10.0->medcat~=1.12.1) (4.12.2) +Requirement already satisfied: joblib>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from scikit-learn<2.0.0,>=1.1.3->medcat~=1.12.1) (1.4.2) +Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from scikit-learn<2.0.0,>=1.1.3->medcat~=1.12.1) (3.5.0) +Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.11 in /usr/local/lib/python3.10/dist-packages (from spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (3.0.12) +Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (1.0.5) +Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.10/dist-packages (from spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (1.0.10) +Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.10/dist-packages (from spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (2.0.8) +Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.10/dist-packages (from spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (3.0.9) +Requirement already satisfied: thinc<8.3.0,>=8.2.2 in /usr/local/lib/python3.10/dist-packages (from spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (8.2.5) +Requirement already satisfied: wasabi<1.2.0,>=0.9.1 in /usr/local/lib/python3.10/dist-packages (from spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (1.1.3) +Requirement already satisfied: srsly<3.0.0,>=2.4.3 in /usr/local/lib/python3.10/dist-packages (from spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (2.4.8) +Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /usr/local/lib/python3.10/dist-packages (from spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (2.0.10) +Requirement already satisfied: weasel<0.5.0,>=0.1.0 in /usr/local/lib/python3.10/dist-packages (from spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (0.4.1) +Requirement already satisfied: typer<1.0.0,>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (0.12.3) +Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (3.1.4) +Requirement already satisfied: setuptools in /usr/local/lib/python3.10/dist-packages (from spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (71.0.4) +Requirement already satisfied: langcodes<4.0.0,>=3.2.0 in /usr/local/lib/python3.10/dist-packages (from spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (3.4.0) +Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=1.13.0->medcat~=1.12.1) (1.13.1) +Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=1.13.0->medcat~=1.12.1) (3.3) +Collecting nvidia-cuda-nvrtc-cu12==12.1.105 (from torch<3.0.0,>=1.13.0->medcat~=1.12.1) + Using cached nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB) +Collecting nvidia-cuda-runtime-cu12==12.1.105 (from torch<3.0.0,>=1.13.0->medcat~=1.12.1) + Using cached nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB) +Collecting nvidia-cuda-cupti-cu12==12.1.105 (from torch<3.0.0,>=1.13.0->medcat~=1.12.1) + Using cached nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl.metadata (1.6 kB) +Collecting nvidia-cudnn-cu12==8.9.2.26 (from torch<3.0.0,>=1.13.0->medcat~=1.12.1) + Using cached nvidia_cudnn_cu12-8.9.2.26-py3-none-manylinux1_x86_64.whl.metadata (1.6 kB) +Collecting nvidia-cublas-cu12==12.1.3.1 (from torch<3.0.0,>=1.13.0->medcat~=1.12.1) + Using cached nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB) +Collecting nvidia-cufft-cu12==11.0.2.54 (from torch<3.0.0,>=1.13.0->medcat~=1.12.1) + Using cached nvidia_cufft_cu12-11.0.2.54-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB) +Collecting nvidia-curand-cu12==10.3.2.106 (from torch<3.0.0,>=1.13.0->medcat~=1.12.1) + Using cached nvidia_curand_cu12-10.3.2.106-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB) +Collecting nvidia-cusolver-cu12==11.4.5.107 (from torch<3.0.0,>=1.13.0->medcat~=1.12.1) + Using cached nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl.metadata (1.6 kB) +Collecting nvidia-cusparse-cu12==12.1.0.106 (from torch<3.0.0,>=1.13.0->medcat~=1.12.1) + Using cached nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl.metadata (1.6 kB) +Collecting nvidia-nccl-cu12==2.20.5 (from torch<3.0.0,>=1.13.0->medcat~=1.12.1) + Using cached nvidia_nccl_cu12-2.20.5-py3-none-manylinux2014_x86_64.whl.metadata (1.8 kB) +Collecting nvidia-nvtx-cu12==12.1.105 (from torch<3.0.0,>=1.13.0->medcat~=1.12.1) + Using cached nvidia_nvtx_cu12-12.1.105-py3-none-manylinux1_x86_64.whl.metadata (1.7 kB) +Requirement already satisfied: triton==2.3.1 in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=1.13.0->medcat~=1.12.1) (2.3.1) +Collecting nvidia-nvjitlink-cu12 (from nvidia-cusolver-cu12==11.4.5.107->torch<3.0.0,>=1.13.0->medcat~=1.12.1) + Using cached nvidia_nvjitlink_cu12-12.6.20-py3-none-manylinux2014_x86_64.whl.metadata (1.5 kB) +Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers<5.0.0,>=4.34.0->medcat~=1.12.1) (2024.5.15) +Requirement already satisfied: tokenizers<0.20,>=0.19 in /usr/local/lib/python3.10/dist-packages (from transformers<5.0.0,>=4.34.0->medcat~=1.12.1) (0.19.1) +Requirement already satisfied: aiohappyeyeballs>=2.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (2.3.5) +Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (1.3.1) +Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (24.2.0) +Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (1.4.1) +Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (6.0.5) +Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (1.9.4) +Requirement already satisfied: async-timeout<5.0,>=4.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (4.0.3) +Requirement already satisfied: jupyter-client in /usr/local/lib/python3.10/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.6.5->medcat~=1.12.1) (6.1.12) +Requirement already satisfied: tornado>=4.2 in /usr/local/lib/python3.10/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.6.5->medcat~=1.12.1) (6.3.3) +Collecting jedi>=0.16 (from ipython>=4.0.0->ipywidgets>=7.6.5->medcat~=1.12.1) + Using cached jedi-0.19.1-py2.py3-none-any.whl.metadata (22 kB) +Requirement already satisfied: decorator in /usr/local/lib/python3.10/dist-packages (from ipython>=4.0.0->ipywidgets>=7.6.5->medcat~=1.12.1) (4.4.2) +Requirement already satisfied: pickleshare in /usr/local/lib/python3.10/dist-packages (from ipython>=4.0.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.7.5) +Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from ipython>=4.0.0->ipywidgets>=7.6.5->medcat~=1.12.1) (3.0.47) +Requirement already satisfied: pygments in /usr/local/lib/python3.10/dist-packages (from ipython>=4.0.0->ipywidgets>=7.6.5->medcat~=1.12.1) (2.16.1) +Requirement already satisfied: backcall in /usr/local/lib/python3.10/dist-packages (from ipython>=4.0.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.2.0) +Requirement already satisfied: matplotlib-inline in /usr/local/lib/python3.10/dist-packages (from ipython>=4.0.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.1.7) +Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.10/dist-packages (from ipython>=4.0.0->ipywidgets>=7.6.5->medcat~=1.12.1) (4.9.0) +Requirement already satisfied: language-data>=1.2 in /usr/local/lib/python3.10/dist-packages (from langcodes<4.0.0,>=3.2.0->spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (1.2.0) +Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.2->pandas>=1.4.2->medcat~=1.12.1) (1.16.0) +Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.32.2->datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (3.3.2) +Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.32.2->datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (3.7) +Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.32.2->datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (2.0.7) +Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.32.2->datasets<3.0.0,>=2.2.2->medcat~=1.12.1) (2024.7.4) +Requirement already satisfied: wrapt in /usr/local/lib/python3.10/dist-packages (from smart-open>=1.8.1->gensim<5.0.0,>=4.3.0->medcat~=1.12.1) (1.16.0) +Requirement already satisfied: confection<1.0.0,>=0.0.1 in /usr/local/lib/python3.10/dist-packages (from thinc<8.3.0,>=8.2.2->spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (0.1.5) +Requirement already satisfied: shellingham>=1.3.0 in /usr/local/lib/python3.10/dist-packages (from typer<1.0.0,>=0.3.0->spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (1.5.4) +Requirement already satisfied: rich>=10.11.0 in /usr/local/lib/python3.10/dist-packages (from typer<1.0.0,>=0.3.0->spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (13.7.1) +Requirement already satisfied: cloudpathlib<1.0.0,>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from weasel<0.5.0,>=0.1.0->spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (0.18.1) +Requirement already satisfied: notebook>=4.4.1 in /usr/local/lib/python3.10/dist-packages (from widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (6.5.5) +Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (2.1.5) +Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from sympy->torch<3.0.0,>=1.13.0->medcat~=1.12.1) (1.3.0) +Requirement already satisfied: parso<0.9.0,>=0.8.3 in /usr/local/lib/python3.10/dist-packages (from jedi>=0.16->ipython>=4.0.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.8.4) +Requirement already satisfied: marisa-trie>=0.7.7 in /usr/local/lib/python3.10/dist-packages (from language-data>=1.2->langcodes<4.0.0,>=3.2.0->spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (1.2.0) +Requirement already satisfied: pyzmq<25,>=17 in /usr/local/lib/python3.10/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (24.0.1) +Requirement already satisfied: argon2-cffi in /usr/local/lib/python3.10/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (23.1.0) +Requirement already satisfied: jupyter-core>=4.6.1 in /usr/local/lib/python3.10/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (5.7.2) +Requirement already satisfied: nbformat in /usr/local/lib/python3.10/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (5.10.4) +Requirement already satisfied: nbconvert>=5 in /usr/local/lib/python3.10/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (6.5.4) +Requirement already satisfied: nest-asyncio>=1.5 in /usr/local/lib/python3.10/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (1.6.0) +Requirement already satisfied: Send2Trash>=1.8.0 in /usr/local/lib/python3.10/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (1.8.3) +Requirement already satisfied: terminado>=0.8.3 in /usr/local/lib/python3.10/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.18.1) +Requirement already satisfied: prometheus-client in /usr/local/lib/python3.10/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.20.0) +Requirement already satisfied: nbclassic>=0.4.7 in /usr/local/lib/python3.10/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (1.1.0) +Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.10/dist-packages (from pexpect>4.3->ipython>=4.0.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.7.0) +Requirement already satisfied: wcwidth in /usr/local/lib/python3.10/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython>=4.0.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.2.13) +Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.10/dist-packages (from rich>=10.11.0->typer<1.0.0,>=0.3.0->spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (3.0.0) +Requirement already satisfied: platformdirs>=2.5 in /usr/local/lib/python3.10/dist-packages (from jupyter-core>=4.6.1->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (4.2.2) +Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.10/dist-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->typer<1.0.0,>=0.3.0->spacy<4.0.0,>=3.6.0->medcat~=1.12.1) (0.1.2) +Requirement already satisfied: notebook-shim>=0.2.3 in /usr/local/lib/python3.10/dist-packages (from nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.2.4) +Requirement already satisfied: lxml in /usr/local/lib/python3.10/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (4.9.4) +Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.10/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (4.12.3) +Requirement already satisfied: bleach in /usr/local/lib/python3.10/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (6.1.0) +Requirement already satisfied: defusedxml in /usr/local/lib/python3.10/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.7.1) +Requirement already satisfied: entrypoints>=0.2.2 in /usr/local/lib/python3.10/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.4) +Requirement already satisfied: jupyterlab-pygments in /usr/local/lib/python3.10/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.3.0) +Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/lib/python3.10/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.8.4) +Requirement already satisfied: nbclient>=0.5.0 in /usr/local/lib/python3.10/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.10.0) +Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.10/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (1.5.1) +Requirement already satisfied: tinycss2 in /usr/local/lib/python3.10/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (1.3.0) +Requirement already satisfied: fastjsonschema>=2.15 in /usr/local/lib/python3.10/dist-packages (from nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (2.20.0) +Requirement already satisfied: jsonschema>=2.6 in /usr/local/lib/python3.10/dist-packages (from nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (4.23.0) +Requirement already satisfied: argon2-cffi-bindings in /usr/local/lib/python3.10/dist-packages (from argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (21.2.0) +Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (2023.12.1) +Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.35.1) +Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.20.0) +Requirement already satisfied: jupyter-server<3,>=1.8 in /usr/local/lib/python3.10/dist-packages (from notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (1.24.0) +Requirement already satisfied: cffi>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (1.17.0) +Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.10/dist-packages (from beautifulsoup4->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (2.5) +Requirement already satisfied: webencodings in /usr/local/lib/python3.10/dist-packages (from bleach->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (0.5.1) +Requirement already satisfied: pycparser in /usr/local/lib/python3.10/dist-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (2.22) +Requirement already satisfied: anyio<4,>=3.1.0 in /usr/local/lib/python3.10/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (3.7.1) +Requirement already satisfied: websocket-client in /usr/local/lib/python3.10/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (1.8.0) +Requirement already satisfied: sniffio>=1.1 in /usr/local/lib/python3.10/dist-packages (from anyio<4,>=3.1.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (1.3.1) +Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio<4,>=3.1.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.6.5->medcat~=1.12.1) (1.2.2) +Downloading medcat-1.12.1-py3-none-any.whl (235 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 235.5/235.5 kB 3.5 MB/s eta 0:00:00 +Downloading aiofiles-24.1.0-py3-none-any.whl (15 kB) +Downloading datasets-2.21.0-py3-none-any.whl (527 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 527.3/527.3 kB 8.8 MB/s eta 0:00:00 +Downloading dill-0.3.8-py3-none-any.whl (116 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 116.3/116.3 kB 6.4 MB/s eta 0:00:00 +Downloading humanfriendly-10.0-py2.py3-none-any.whl (86 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.8/86.8 kB 1.7 MB/s eta 0:00:00 +Downloading multiprocess-0.70.16-py310-none-any.whl (134 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 134.8/134.8 kB 6.7 MB/s eta 0:00:00 +Downloading numpy-1.25.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.2/18.2 MB 29.9 MB/s eta 0:00:00 +Downloading peft-0.12.0-py3-none-any.whl (296 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 296.4/296.4 kB 13.4 MB/s eta 0:00:00 +Downloading pydantic-1.10.17-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.1/3.1 MB 54.3 MB/s eta 0:00:00 +Downloading scipy-1.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (33.7 MB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 33.7/33.7 MB 35.2 MB/s eta 0:00:00 +Using cached nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl (410.6 MB) +Using cached nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (14.1 MB) +Using cached nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (23.7 MB) +Using cached nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (823 kB) +Using cached nvidia_cudnn_cu12-8.9.2.26-py3-none-manylinux1_x86_64.whl (731.7 MB) +Using cached nvidia_cufft_cu12-11.0.2.54-py3-none-manylinux1_x86_64.whl (121.6 MB) +Using cached nvidia_curand_cu12-10.3.2.106-py3-none-manylinux1_x86_64.whl (56.5 MB) +Using cached nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl (124.2 MB) +Using cached nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl (196.0 MB) +Using cached nvidia_nccl_cu12-2.20.5-py3-none-manylinux2014_x86_64.whl (176.2 MB) +Using cached nvidia_nvtx_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (99 kB) +Downloading xxhash-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 194.1/194.1 kB 341.2 kB/s eta 0:00:00 +Downloading pyarrow-17.0.0-cp310-cp310-manylinux_2_28_x86_64.whl (39.9 MB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 39.9/39.9 MB 12.0 MB/s eta 0:00:00 +Using cached jedi-0.19.1-py2.py3-none-any.whl (1.6 MB) +Using cached nvidia_nvjitlink_cu12-12.6.20-py3-none-manylinux2014_x86_64.whl (19.7 MB) +Installing collected packages: xxhash, pydantic, nvidia-nvtx-cu12, nvidia-nvjitlink-cu12, nvidia-nccl-cu12, nvidia-curand-cu12, nvidia-cufft-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-cupti-cu12, nvidia-cublas-cu12, numpy, jedi, humanfriendly, dill, aiofiles, scipy, pyarrow, nvidia-cusparse-cu12, nvidia-cudnn-cu12, multiprocess, nvidia-cusolver-cu12, datasets, peft, medcat + Attempting uninstall: pydantic + Found existing installation: pydantic 2.8.2 + Uninstalling pydantic-2.8.2: + Successfully uninstalled pydantic-2.8.2 + Attempting uninstall: numpy + Found existing installation: numpy 1.26.4 + Uninstalling numpy-1.26.4: + Successfully uninstalled numpy-1.26.4 + Attempting uninstall: scipy + Found existing installation: scipy 1.13.1 + Uninstalling scipy-1.13.1: + Successfully uninstalled scipy-1.13.1 + Attempting uninstall: pyarrow + Found existing installation: pyarrow 14.0.2 + Uninstalling pyarrow-14.0.2: + Successfully uninstalled pyarrow-14.0.2 +ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. +albumentations 1.4.13 requires pydantic>=2.7.0, but you have pydantic 1.10.17 which is incompatible. +albumentations 1.4.13 requires scipy>=1.10.0, but you have scipy 1.9.3 which is incompatible. +cudf-cu12 24.4.1 requires pyarrow<15.0.0a0,>=14.0.1, but you have pyarrow 17.0.0 which is incompatible. +ibis-framework 8.0.0 requires pyarrow<16,>=2, but you have pyarrow 17.0.0 which is incompatible. +pandas-stubs 2.1.4.231227 requires numpy>=1.26.0; python_version < "3.13", but you have numpy 1.25.2 which is incompatible. +Successfully installed aiofiles-24.1.0 datasets-2.21.0 dill-0.3.8 humanfriendly-10.0 jedi-0.19.1 medcat-1.12.1 multiprocess-0.70.16 numpy-1.25.2 nvidia-cublas-cu12-12.1.3.1 nvidia-cuda-cupti-cu12-12.1.105 nvidia-cuda-nvrtc-cu12-12.1.105 nvidia-cuda-runtime-cu12-12.1.105 nvidia-cudnn-cu12-8.9.2.26 nvidia-cufft-cu12-11.0.2.54 nvidia-curand-cu12-10.3.2.106 nvidia-cusolver-cu12-11.4.5.107 nvidia-cusparse-cu12-12.1.0.106 nvidia-nccl-cu12-2.20.5 nvidia-nvjitlink-cu12-12.6.20 nvidia-nvtx-cu12-12.1.105 peft-0.12.0 pyarrow-17.0.0 pydantic-1.10.17 scipy-1.9.3 xxhash-3.4.1 +++ + --- +--+Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/ -Collecting en-core-web-md==3.1.0 - Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_md-3.1.0/en_core_web_md-3.1.0-py3-none-any.whl (45.4 MB) - |████████████████████████████████| 45.4 MB 99.1 MB/s -Requirement already satisfied: spacy<3.2.0,>=3.1.0 in /usr/local/lib/python3.7/dist-packages (from en-core-web-md==3.1.0) (3.1.3) -Requirement already satisfied: blis<0.8.0,>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (0.7.5) -Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (4.64.0) -Requirement already satisfied: jinja2 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (2.11.3) -Requirement already satisfied: wasabi<1.1.0,>=0.8.1 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (0.10.1) -Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (21.3) -Requirement already satisfied: srsly<3.0.0,>=2.4.1 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (2.4.4) -Requirement already satisfied: pydantic!=1.8,!=1.8.1,<1.9.0,>=1.7.4 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (1.8.2) -Requirement already satisfied: thinc<8.1.0,>=8.0.9 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (8.0.17) -Requirement already satisfied: typing-extensions<4.0.0.0,>=3.7.4 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (3.10.0.2) -Requirement already satisfied: typer<0.5.0,>=0.3.0 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (0.4.2) -Requirement already satisfied: pathy>=0.3.5 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (0.6.2) -Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (3.0.7) -Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (1.0.8) -Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (57.4.0) -Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (2.0.6) -Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.8 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (3.0.10) -Requirement already satisfied: requests<3.0.0,>=2.13.0 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (2.23.0) -Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (2.0.8) -Requirement already satisfied: numpy>=1.15.0 in /usr/local/lib/python3.7/dist-packages (from spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (1.21.6) -Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from catalogue<2.1.0,>=2.0.6->spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (3.8.1) -Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging>=20.0->spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (3.0.9) -Requirement already satisfied: smart-open<6.0.0,>=5.2.1 in /usr/local/lib/python3.7/dist-packages (from pathy>=0.3.5->spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (5.2.1) -Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (2.10) -Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (2022.6.15) -Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (1.25.11) -Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (3.0.4) -Requirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/lib/python3.7/dist-packages (from typer<0.5.0,>=0.3.0->spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (7.1.2) -Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.7/dist-packages (from jinja2->spacy<3.2.0,>=3.1.0->en-core-web-md==3.1.0) (2.0.1) ++ + + + + ++Collecting en-core-web-md==3.7.1 + Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_md-3.7.1/en_core_web_md-3.7.1-py3-none-any.whl (42.8 MB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.8/42.8 MB 16.1 MB/s eta 0:00:00 +Requirement already satisfied: spacy<3.8.0,>=3.7.2 in /usr/local/lib/python3.10/dist-packages (from en-core-web-md==3.7.1) (3.7.5) +Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.11 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (3.0.12) +Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.0.5) +Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.0.10) +Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2.0.8) +Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (3.0.9) +Requirement already satisfied: thinc<8.3.0,>=8.2.2 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (8.2.5) +Requirement already satisfied: wasabi<1.2.0,>=0.9.1 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.1.3) +Requirement already satisfied: srsly<3.0.0,>=2.4.3 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2.4.8) +Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2.0.10) +Requirement already satisfied: weasel<0.5.0,>=0.1.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (0.4.1) +Requirement already satisfied: typer<1.0.0,>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (0.12.3) +Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (4.66.5) +Requirement already satisfied: requests<3.0.0,>=2.13.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2.32.3) +Requirement already satisfied: pydantic!=1.8,!=1.8.1,<3.0.0,>=1.7.4 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.10.17) +Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (3.1.4) +Requirement already satisfied: setuptools in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (71.0.4) +Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (24.1) +Requirement already satisfied: langcodes<4.0.0,>=3.2.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (3.4.0) +Requirement already satisfied: numpy>=1.19.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.25.2) +Requirement already satisfied: language-data>=1.2 in /usr/local/lib/python3.10/dist-packages (from langcodes<4.0.0,>=3.2.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.2.0) +Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.10/dist-packages (from pydantic!=1.8,!=1.8.1,<3.0.0,>=1.7.4->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (4.12.2) +Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (3.3.2) +Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (3.7) +Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2.0.7) +Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2024.7.4) +Requirement already satisfied: blis<0.8.0,>=0.7.8 in /usr/local/lib/python3.10/dist-packages (from thinc<8.3.0,>=8.2.2->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (0.7.11) +Requirement already satisfied: confection<1.0.0,>=0.0.1 in /usr/local/lib/python3.10/dist-packages (from thinc<8.3.0,>=8.2.2->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (0.1.5) +Requirement already satisfied: click>=8.0.0 in /usr/local/lib/python3.10/dist-packages (from typer<1.0.0,>=0.3.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (8.1.7) +Requirement already satisfied: shellingham>=1.3.0 in /usr/local/lib/python3.10/dist-packages (from typer<1.0.0,>=0.3.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.5.4) +Requirement already satisfied: rich>=10.11.0 in /usr/local/lib/python3.10/dist-packages (from typer<1.0.0,>=0.3.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (13.7.1) +Requirement already satisfied: cloudpathlib<1.0.0,>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from weasel<0.5.0,>=0.1.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (0.18.1) +Requirement already satisfied: smart-open<8.0.0,>=5.2.1 in /usr/local/lib/python3.10/dist-packages (from weasel<0.5.0,>=0.1.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (7.0.4) +Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2.1.5) +Requirement already satisfied: marisa-trie>=0.7.7 in /usr/local/lib/python3.10/dist-packages (from language-data>=1.2->langcodes<4.0.0,>=3.2.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.2.0) +Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.10/dist-packages (from rich>=10.11.0->typer<1.0.0,>=0.3.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (3.0.0) +Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.10/dist-packages (from rich>=10.11.0->typer<1.0.0,>=0.3.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2.16.1) +Requirement already satisfied: wrapt in /usr/local/lib/python3.10/dist-packages (from smart-open<8.0.0,>=5.2.1->weasel<0.5.0,>=0.1.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.16.0) +Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.10/dist-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->typer<1.0.0,>=0.3.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (0.1.2) Installing collected packages: en-core-web-md -Successfully installed en-core-web-md-3.1.0 +Successfully installed en-core-web-md-3.7.1 ✔ Download and installation successful You can now load the package via spacy.load('en_core_web_md') +⚠ Restart to reload dependencies +If you are in a Jupyter or Colab notebook, you may need to restart Python in +order to load all the package's dependencies. You can do this by selecting the +'Restart kernel' or 'Restart runtime' option. WARNING: Runtime will restart automatically and please run other cells thereafter.--+++-+++Restart the runtime if on colab, sometimes necessary after installing models
--In [1]:--++++ +++++In [ ]:++++++ +! python -m spacy download en_core_web_md +++ +++ + ++ ++ ++ + + + + ++ +++Collecting en-core-web-md==3.7.1 + Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_md-3.7.1/en_core_web_md-3.7.1-py3-none-any.whl (42.8 MB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.8/42.8 MB 11.2 MB/s eta 0:00:00 +Requirement already satisfied: spacy<3.8.0,>=3.7.2 in /usr/local/lib/python3.10/dist-packages (from en-core-web-md==3.7.1) (3.7.5) +Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.11 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (3.0.12) +Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.0.5) +Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.0.10) +Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2.0.8) +Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (3.0.9) +Requirement already satisfied: thinc<8.3.0,>=8.2.2 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (8.2.5) +Requirement already satisfied: wasabi<1.2.0,>=0.9.1 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.1.3) +Requirement already satisfied: srsly<3.0.0,>=2.4.3 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2.4.8) +Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2.0.10) +Requirement already satisfied: weasel<0.5.0,>=0.1.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (0.4.1) +Requirement already satisfied: typer<1.0.0,>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (0.12.3) +Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (4.66.5) +Requirement already satisfied: requests<3.0.0,>=2.13.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2.32.3) +Requirement already satisfied: pydantic!=1.8,!=1.8.1,<3.0.0,>=1.7.4 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.10.17) +Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (3.1.4) +Requirement already satisfied: setuptools in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (71.0.4) +Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (24.1) +Requirement already satisfied: langcodes<4.0.0,>=3.2.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (3.4.0) +Requirement already satisfied: numpy>=1.19.0 in /usr/local/lib/python3.10/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.25.2) +Requirement already satisfied: language-data>=1.2 in /usr/local/lib/python3.10/dist-packages (from langcodes<4.0.0,>=3.2.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.2.0) +Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.10/dist-packages (from pydantic!=1.8,!=1.8.1,<3.0.0,>=1.7.4->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (4.12.2) +Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (3.3.2) +Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (3.7) +Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2.0.7) +Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2024.7.4) +Requirement already satisfied: blis<0.8.0,>=0.7.8 in /usr/local/lib/python3.10/dist-packages (from thinc<8.3.0,>=8.2.2->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (0.7.11) +Requirement already satisfied: confection<1.0.0,>=0.0.1 in /usr/local/lib/python3.10/dist-packages (from thinc<8.3.0,>=8.2.2->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (0.1.5) +Requirement already satisfied: click>=8.0.0 in /usr/local/lib/python3.10/dist-packages (from typer<1.0.0,>=0.3.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (8.1.7) +Requirement already satisfied: shellingham>=1.3.0 in /usr/local/lib/python3.10/dist-packages (from typer<1.0.0,>=0.3.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.5.4) +Requirement already satisfied: rich>=10.11.0 in /usr/local/lib/python3.10/dist-packages (from typer<1.0.0,>=0.3.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (13.7.1) +Requirement already satisfied: cloudpathlib<1.0.0,>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from weasel<0.5.0,>=0.1.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (0.18.1) +Requirement already satisfied: smart-open<8.0.0,>=5.2.1 in /usr/local/lib/python3.10/dist-packages (from weasel<0.5.0,>=0.1.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (7.0.4) +Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2.1.5) +Requirement already satisfied: marisa-trie>=0.7.7 in /usr/local/lib/python3.10/dist-packages (from language-data>=1.2->langcodes<4.0.0,>=3.2.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.2.0) +Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.10/dist-packages (from rich>=10.11.0->typer<1.0.0,>=0.3.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (3.0.0) +Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.10/dist-packages (from rich>=10.11.0->typer<1.0.0,>=0.3.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (2.16.1) +Requirement already satisfied: wrapt in /usr/local/lib/python3.10/dist-packages (from smart-open<8.0.0,>=5.2.1->weasel<0.5.0,>=0.1.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (1.16.0) +Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.10/dist-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->typer<1.0.0,>=0.3.0->spacy<3.8.0,>=3.7.2->en-core-web-md==3.7.1) (0.1.2) +✔ Download and installation successful +You can now load the package via spacy.load('en_core_web_md') +⚠ Restart to reload dependencies +If you are in a Jupyter or Colab notebook, you may need to restart Python in +order to load all the package's dependencies. You can do this by selecting the +'Restart kernel' or 'Restart runtime' option. +++-++++In [ ]:++++-import pandas as pd import numpy as np import seaborn as sns -import json +import json from matplotlib import pyplot as plt from medcat.cat import CAT @@ -13423,382 +15048,468 @@ from medcat.vocab import Vocab from medcat.meta_cat import MetaCAT from medcat.config_meta_cat import ConfigMetaCAT -from medcat.preprocessing.tokenizers import TokenizerWrapperBPE, TokenizerWrapperBERT +from medcat.preprocessing.tokenizers import TokenizerWrapperBPE +from medcat.tokenizers.meta_cat_tokenizers import TokenizerWrapperBERT from tokenizers import ByteLevelBPETokenizer-++++ +-++- + + -+-/usr/local/lib/python3.7/dist-packages/medcat/cat.py:18: TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console) - from tqdm.autonotebook import tqdm, trange ++/usr/local/lib/python3.10/dist-packages/medcat/cat.py:17: TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console) + from tqdm.autonotebook import tqdm, trange++---In [2]:---+DATA_DIR = "./data_p4.2/" -! DATA_DIR="./data_p4.2/" -vocab_path = DATA_DIR + "vocab.dat" -cdb_path = DATA_DIR + "cdb-medmen-v1.dat" ++In [ ]:+++++-DATA_DIR = "./data_p4.2/" +! DATA_DIR="./data_p4.2/" +vocab_path = DATA_DIR + "vocab.dat" +cdb_path = DATA_DIR + "cdb-medmen-v1.dat"++---In [3]:--+ ++++In [ ]:+++-# Download the models and required data -!wget -N https://raw.githubusercontent.com/CogStack/MedCATtutorials/main/notebooks/introductory/data/MedCAT_Export.json -P $DATA_DIR +!wget -N https://raw.githubusercontent.com/CogStack/MedCATtutorials/main/notebooks/introductory/data/MedCAT_Export.json -P $DATA_DIR # You can also use the models created in Part 4.1 of the Tutorial -!wget -N https://cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com/medcat-example-models/mc_status.zip -P $DATA_DIR +!wget -N https://cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com/medcat-example-models/mc_status.zip -P $DATA_DIR # Get MedCAT models components (Alternatively you can use a previously created MedCAT model packs) -!wget -N https://cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com/medcat-example-models/vocab.dat -P $DATA_DIR -!wget -N https://cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com/medcat-example-models/cdb-medmen-v1.dat -P $DATA_DIR +!wget -N https://cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com/medcat-example-models/vocab.dat -P $DATA_DIR +!wget -N https://cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com/medcat-example-models/cdb-medmen-v1.dat -P $DATA_DIR++--+--+- + + -+---2022-08-25 12:02:19-- https://raw.githubusercontent.com/CogStack/MedCATtutorials/main/notebooks/introductory/data/MedCAT_Export.json ++--2024-08-16 08:23:54-- https://raw.githubusercontent.com/CogStack/MedCATtutorials/main/notebooks/introductory/data/MedCAT_Export.json Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 272538 (266K) [text/plain] -Saving to: ‘./data/MedCAT_Export.json’ +Saving to: ‘./data_p4.2/MedCAT_Export.json’ -MedCAT_Export.json 100%[===================>] 266.15K --.-KB/s in 0.01s +MedCAT_Export.json 100%[===================>] 266.15K --.-KB/s in 0.04s -2022-08-25 12:02:19 (19.3 MB/s) - ‘./data/MedCAT_Export.json’ saved [272538/272538] +Last-modified header missing -- time-stamps turned off. +2024-08-16 08:23:54 (6.82 MB/s) - ‘./data_p4.2/MedCAT_Export.json’ saved [272538/272538] ---2022-08-25 12:02:19-- https://medcat.rosalind.kcl.ac.uk/media/mc_status.zip -Resolving medcat.rosalind.kcl.ac.uk (medcat.rosalind.kcl.ac.uk)... 193.61.202.225 -Connecting to medcat.rosalind.kcl.ac.uk (medcat.rosalind.kcl.ac.uk)|193.61.202.225|:443... connected. +--2024-08-16 08:23:54-- https://cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com/medcat-example-models/mc_status.zip +Resolving cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com (cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com)... 52.95.150.170, 3.5.246.110, 3.5.244.200, ... +Connecting to cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com (cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com)|52.95.150.170|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 37947480 (36M) [application/zip] -Saving to: ‘./data/mc_status.zip’ +Saving to: ‘./data_p4.2/mc_status.zip’ -mc_status.zip 100%[===================>] 36.19M 46.6MB/s in 0.8s +mc_status.zip 100%[===================>] 36.19M 20.9MB/s in 1.7s -2022-08-25 12:02:20 (46.6 MB/s) - ‘./data/mc_status.zip’ saved [37947480/37947480] +2024-08-16 08:23:57 (20.9 MB/s) - ‘./data_p4.2/mc_status.zip’ saved [37947480/37947480] ---2022-08-25 12:02:20-- https://medcat.rosalind.kcl.ac.uk/media/vocab.dat -Resolving medcat.rosalind.kcl.ac.uk (medcat.rosalind.kcl.ac.uk)... 193.61.202.225 -Connecting to medcat.rosalind.kcl.ac.uk (medcat.rosalind.kcl.ac.uk)|193.61.202.225|:443... connected. +--2024-08-16 08:23:57-- https://cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com/medcat-example-models/vocab.dat +Resolving cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com (cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com)... 52.95.150.170, 3.5.246.110, 3.5.244.200, ... +Connecting to cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com (cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com)|52.95.150.170|:443... connected. HTTP request sent, awaiting response... 200 OK -Length: 274445907 (262M) [application/octet-stream] -Saving to: ‘./data/vocab.dat’ +Length: 274445907 (262M) [binary/octet-stream] +Saving to: ‘./data_p4.2/vocab.dat’ -vocab.dat 100%[===================>] 261.73M 48.8MB/s in 5.5s +vocab.dat 100%[===================>] 261.73M 32.6MB/s in 8.8s -2022-08-25 12:02:26 (47.6 MB/s) - ‘./data/vocab.dat’ saved [274445907/274445907] +2024-08-16 08:24:06 (29.6 MB/s) - ‘./data_p4.2/vocab.dat’ saved [274445907/274445907] ---2022-08-25 12:02:26-- https://medcat.rosalind.kcl.ac.uk/media/cdb-medmen-v1_2.dat -Resolving medcat.rosalind.kcl.ac.uk (medcat.rosalind.kcl.ac.uk)... 193.61.202.225 -Connecting to medcat.rosalind.kcl.ac.uk (medcat.rosalind.kcl.ac.uk)|193.61.202.225|:443... connected. +--2024-08-16 08:24:06-- https://cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com/medcat-example-models/cdb-medmen-v1.dat +Resolving cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com (cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com)... 52.95.142.38, 3.5.246.238, 52.95.149.2, ... +Connecting to cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com (cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com)|52.95.142.38|:443... connected. HTTP request sent, awaiting response... 200 OK -Length: 356502941 (340M) [application/octet-stream] -Saving to: ‘./data/cdb-medmen-v1_2.dat’ +Length: 356087008 (340M) [binary/octet-stream] +Saving to: ‘./data_p4.2/cdb-medmen-v1.dat’ -cdb-medmen-v1_2.dat 100%[===================>] 339.99M 67.2MB/s in 6.4s +cdb-medmen-v1.dat 100%[===================>] 339.59M 31.5MB/s in 12s -2022-08-25 12:02:32 (53.4 MB/s) - ‘./data/cdb-medmen-v1_2.dat’ saved [356502941/356502941] +2024-08-16 08:24:18 (29.4 MB/s) - ‘./data_p4.2/cdb-medmen-v1.dat’ saved [356087008/356087008]--+++-+++MedCATtrainer Export¶
--In [4]:--+++++++In [ ]:++++-#@title -data = json.load(open(DATA_DIR + "MedCAT_Export.json")) +data = json.load(open(DATA_DIR + "MedCAT_Export.json"))++---In [5]:---++In [ ]:++++-#@title print(data.keys())-++++ +-++- + + -++dict_keys(['projects'])++---In [6]:---++In [ ]:++++-#@title -data['projects'][0].keys() +data['projects'][0].keys()-++++ +-++-+Out[6]:+ +Out[ ]:-+dict_keys(['name', 'id', 'cuis', 'tuis', 'documents'])++---In [7]:---++In [ ]:++++-#@title -data['projects'][0]['documents'][0].keys() +data['projects'][0]['documents'][0].keys()-++++ +-++-+Out[7]:+ +Out[ ]:-+dict_keys(['id', 'name', 'text', 'last_modified', 'annotations'])++---In [8]:---++In [ ]:++++-#@title -data['projects'][0]['documents'][0]['annotations'][0].keys() +data['projects'][0]['documents'][0]['annotations'][0].keys()-++++ +-++-+Out[8]:+ +Out[ ]:-+dict_keys(['id', 'user', 'cui', 'value', 'start', 'end', 'validated', 'correct', 'deleted', 'alternative', 'killed', 'last_modified', 'manually_created', 'acc', 'meta_anns'])++---In [9]:---++In [ ]:++++-#@title -data['projects'][0]['documents'][0]['annotations'][0]['meta_anns'][0].keys() +data['projects'][0]['documents'][0]['annotations'][0]['meta_anns'][0].keys()-++++ +--+-+Out[9]:+ +Out[ ]:-+dict_keys(['name', 'value', 'acc', 'validated'])---Fine-tuning the NER+L model¶
+++-++++Fine-tuning the NER+L model¶
--++++-+++First we load the existing MedCAT models that we will fine-tune.
--In [10]:--++-++++In [ ]:++++-# Create and load the CDB (Concept Database) cdb = CDB.load(cdb_path) # NOTE: CDBs saved prior to medcat 1.10 will also load a config -# as part of the CDB, but below we'll be changing that anyway +# as part of the CDB, but below we'll be changing that anyway # Create and load the Vocabulary vocab = Vocab.load(vocab_path) # Setup config config = Config() -config.general['spacy_model'] = 'en_core_web_md' +config.general['spacy_model'] = 'en_core_web_md' # Create CAT - the main class from medcat used for concept annotation cat = CAT(cdb=cdb, config=config, vocab=vocab)-++++ +--+- + + -+-WARNING:medcat.cdb:The CDB was exported by an unknown version of MedCAT. ++WARNING:medcat.utils.saving.serializer:Found config in CDB for model (./data_p4.2). This is an old format. Please re-save the model in the new format to avoid potential issues +WARNING:medcat.cdb:The CDB was exported by an unknown version of MedCAT.--+++++-+--In [11]:---cat.train_supervised_from_json(data_path=DATA_DIR + "MedCAT_Export.json", ++-++++In [ ]:+++++-cat.train_supervised_from_json(data_path=DATA_DIR + "MedCAT_Export.json", nepochs=1, reset_cui_count=False, - print_stats=True, - use_filters=True) + print_stats=True, + use_filters=True)-++++ +-+- + + -+-INFO:medcat:Running without a test set, or train==test+- + + - - - - -- - +-+Stats project: 0%| | 0/1 [00:00<?, ?it/s]- - ++ + - - - -- - +-+Stats document: 0%| | 0/27 [00:00<?, ?it/s]+- + + -+-Epoch: 0, Prec: 0.7948717948717948, Rec: 0.7828282828282829, F1: 0.7888040712468194 Docs with false positives: 2124; 1383; 516; 1734; 96; 1577; 1881; 1687; 899; 688 @@ -13953,122 +15657,83 @@Fine-tuning the NER+L model
+- + + - - - - -- - +-+Epoch: 0%| | 0/1 [00:00<?, ?it/s]- - ++ + - - - -- - +-+Project: 0%| | 0/1 [00:00<?, ?it/s]+- + + - - - - -- - +-+Document: 0%| | 0/27 [00:00<?, ?it/s]- - ++ + - - - -- - +-+Stats project: 0%| | 0/1 [00:00<?, ?it/s]+- + + - - - - -- - +-+Stats document: 0%| | 0/27 [00:00<?, ?it/s]+- + + -+-Epoch: 1, Prec: 0.8439024390243902, Rec: 0.8737373737373737, F1: 0.858560794044665 Docs with false positives: 2124; 1383; 516; 96; 1577; 1881; 1687; 688; 1737; 716 @@ -14123,14 +15788,15 @@Fine-tuning the NER+L model
++ +-+ +Out[11]:+ +Out[ ]:-++ ++ +({'C0011847': 15, 'C0020538': 5, 'C0011849': 4, @@ -17399,1903 +19065,3476 @@Fine-tuning the NER+L model +
++++ +++++In [ ]:++++++ +# If we want to know the F1, P, R for each cui, we can call the stats method +data = json.load(open(DATA_DIR + "MedCAT_Export.json")) +fps, fns, tps, cui_prec, cui_rec, cui_f1, cui_counts, examples = cat._print_stats(data, extra_cui_filter=True) +++ +++ + ++ ++ ++ + + + + + + ++ +++ +Stats project: 0%| | 0/1 [00:00<?, ?it/s]++ + + + + + + ++ +++ +Stats document: 0%| | 0/27 [00:00<?, ?it/s]++ + + + + ++ +++Epoch: 0, Prec: 0.07726965532777652, Rec: 0.8511166253101737, F1: 0.1416769929781082 + +Docs with false positives: 2124; 1383; 1734; 516; 73; 96; 1577; 1881; 1070; 1687 + +Docs with false negatives: 1383; 73; 96; 1577; 1881; 1070; 688; 1737; 716; 496 + + + +False Positives + +Patients - C0030705 - 200 +Normal - C0205307 - 67 +Medical History - C0262926 - 57 +Daily - C0332173 - 46 +year - C0439234 - 41 +Bilateral - C0238767 - 40 +Right - C0205090 - 33 +Pain - C0030193 - 28 +Physical Examination - C0031809 - 27 +Lung - C0024109 - 25 + + +False Negatives + +Diabetes Mellitus, Non-Insulin-Dependent - C0011860 - 9 +Diabetes Mellitus - C0011849 - 7 +disorder lesions skin - C0037284 - 4 +Pseudomonas aeruginosa infection - C0854135 - 3 +Pulmonary Embolism - C0034065 - 3 +Coronary heart disease - C0010068 - 2 +Arthritis - C0003864 - 2 +C1561826 - C1561826 - 2 +Syndrome - C0039082 - 2 +Ulcer - C0041582 - 2 + + +True Positives + +Hypertensive disease - C0020538 - 43 +disorder lesions skin - C0037284 - 17 +Hyperlipidemia - C0020473 - 12 +Coronary Arteriosclerosis - C0010054 - 10 +Lymphadenopathy - C0497156 - 10 +Mental Depression - C0011570 - 10 +Erythema - C0041834 - 9 +Congestive heart failure - C0018802 - 8 +Chronic Obstructive Airway Disease - C0024117 - 7 +Renal Insufficiency - C1565489 - 7 +************************************************************************************************************** + +++++++++++K-fold metrics¶
K-fold cross-validation offers a more robust evaluation of your model's performance by dividing your dataset into k subsets, or folds. +Unlike a single evaluation on the entire dataset (like
+ +cat._print_stats
), the k-fold approach ensures that every data point is used for both training and validation, thereby reducing the risk of bias and providing a more reliable estimate of the model's generalization capabilities. +This method is particularly beneficial for assessing the fine-tuned performance of your model on specific datasets, as it accounts for variability and offers a comprehensive understanding of how the model might perform on unseen data.+++ +++++In [ ]:++++++ +# you need to import the module to use it +from medcat.stats.kfold import get_k_fold_stats +fps, fns, tps, cui_prec, cui_rec, cui_f1, cui_counts, examples = get_k_fold_stats(cat, data) ++++ +++++In [ ]:++++++ +# Now we can check F1/P/R for a cui using +cui = "C0020538" # Hypertension +print(cui_f1[cui], cui_prec[cui], cui_rec[cui]) +++ +++ + ++ ++ ++ + + + + ++ +++0.9662921348314606 0.9347826086956522 1.0 +++++ +++++In [ ]:++++++ +# inspect fn, fp examples for specific CUIs of interest... +examples['fn']['C0010068'] +++ +++ + ++ ++ ++ + ++ +Out[ ]:+ + + + +++ +[{'text': ' appendectomy, oophorectomy.,FAMILY HISTORY: , Positive for coronary artery disease in her father and brother in their 40s.,SOCIAL HISTORY: , S', + 'cui': 'C0010068', + 'source value': 'coronary artery disease', + 'acc': 1, + 'project index': 0, + 'document inedex': 1}, + {'text': 'on fraction of 20%-25% in December 2005, COPD, mild diffuse coronary artery disease, and renal insufficiency.,ALLERGIES:, NO KNOWN DRUG ALLERGI', + 'cui': 'C0010068', + 'source value': 'coronary artery disease', + 'acc': 1, 'project index': 0, - 'document inedex': 23}, - {'text': 'is primarily bilateral recess, intermittent lower extremity radiculopathy, DJD of both knees, bilateral pes anserinus bursitis, and c', - 'cui': 'C0700594', - 'source value': 'radiculopathy', + 'document inedex': 25}]+++++ +++++In [ ]:++++++ +# annotations inside first projects... +[anno for d in data['projects'][0]['documents'] for anno in d['annotations']][0:5] +++ +++ + ++ ++ ++ + ++ +Out[ ]:+ + + + +++ +[{'id': 45580, + 'user': 'wish', + 'cui': 'C0017168', + 'value': 'gastroesophageal reflux', + 'start': 332, + 'end': 355, + 'validated': True, + 'correct': True, + 'deleted': False, + 'alternative': False, + 'killed': False, + 'last_modified': '2020-04-01 22:06:34.303633+00:00', + 'manually_created': False, 'acc': 1.0, - 'project index': 0, - 'document inedex': 24}, - {'text': ' primarily lateral recess with intermittent lower extremity radiculopathy, stable.,8. Degenerative disc disease of both knees, sympt', - 'cui': 'C0700594', - 'source value': 'radiculopathy', + 'meta_anns': [{'name': 'Status', + 'value': 'Other', 'acc': 1.0, - 'project index': 0, - 'document inedex': 24}], - 'C0041582': [{'text': ' reveal any additional scars, rashes, cafe au lait spots or ulcers. No significant lymphadenopathy noted.,Spine: Examination', - 'cui': 'C0041582', - 'source value': 'ulcers', - 'acc': 0.33016347633031534, - 'project index': 0, - 'document inedex': 23}, - {'text': ' reveal any additional scars, rashes, cafe au lait spots or ulcers. No significant lymphadenopathy noted.,Spine: Examination', - 'cui': 'C0041582', - 'source value': 'ulcers', - 'acc': 0.32397186541676487, - 'project index': 0, - 'document inedex': 24}], - 'C0158266': [{'text': 'sian female who had seen Dr. XYZ with low back pain, lumbar degenerative disc disease, lumbar spondylosis, facet and sacroiliac joint syndrome, l', - 'cui': 'C0158266', - 'source value': 'degenerative disc disease', + 'validated': True}]}, + {'id': 45581, + 'user': 'wish', + 'cui': 'C0020538', + 'value': 'hypertension', + 'start': 255, + 'end': 267, + 'validated': True, + 'correct': True, + 'deleted': False, + 'alternative': False, + 'killed': False, + 'last_modified': '2020-04-01 22:06:30.394941+00:00', + 'manually_created': False, 'acc': 1.0, - 'project index': 0, - 'document inedex': 24}, - {'text': 'ponent to it.,IMPRESSION:,1. Low back syndrome with lumbar degenerative disc disease, lumbar spinal stenosis, and facet joint syndrome on the ri', - 'cui': 'C0158266', - 'source value': 'degenerative disc disease', + 'meta_anns': [{'name': 'Status', + 'value': 'Confirmed', 'acc': 1.0, - 'project index': 0, - 'document inedex': 24}, - {'text': 'ith intermittent lower extremity radiculopathy, stable.,8. Degenerative disc disease of both knees, symptomatic.,9. Pes anserinus bursitis, bil', - 'cui': 'C0158266', - 'source value': 'Degenerative disc disease', + 'validated': True}]}, + {'id': 45582, + 'user': 'wish', + 'cui': 'C0012634', + 'value': 'disorder', + 'start': 356, + 'end': 364, + 'validated': True, + 'correct': False, + 'deleted': False, + 'alternative': False, + 'killed': True, + 'last_modified': '2020-04-01 22:06:48.174475+00:00', + 'manually_created': False, + 'acc': 0.364258020093567, + 'meta_anns': [{'name': 'Status', + 'value': 'Other', 'acc': 1.0, - 'project index': 0, - 'document inedex': 24}], - 'C0006444': [{'text': 'y radiculopathy, DJD of both knees, bilateral pes anserinus bursitis, and chronic pain syndrome. Dr. XYZ had performed right an', - 'cui': 'C0006444', - 'source value': 'bursitis', + 'validated': True}]}, + {'id': 45583, + 'user': 'wish', + 'cui': 'C0038454', + 'value': 'stroke', + 'start': 276, + 'end': 282, + 'validated': True, + 'correct': True, + 'deleted': False, + 'alternative': False, + 'killed': False, + 'last_modified': '2020-04-01 22:06:33.410261+00:00', + 'manually_created': False, + 'acc': 0.39498916376357734, + 'meta_anns': [{'name': 'Status', + 'value': 'Confirmed', 'acc': 1.0, - 'project index': 0, - 'document inedex': 24}, - {'text': ' disc disease of both knees, symptomatic.,9. Pes anserinus bursitis, bilaterally symptomatic.,10. Chronic pain syndrome.,RECOM', - 'cui': 'C0006444', - 'source value': 'bursitis', + 'validated': True}]}, + {'id': 45584, + 'user': 'wish', + 'cui': 'C0007787', + 'value': 'TIA', + 'start': 272, + 'end': 275, + 'validated': True, + 'correct': True, + 'deleted': False, + 'alternative': False, + 'killed': False, + 'last_modified': '2020-04-01 22:06:32.727096+00:00', + 'manually_created': False, + 'acc': 0.43553226241827225, + 'meta_anns': [{'name': 'Status', + 'value': 'Confirmed', 'acc': 1.0, - 'project index': 0, - 'document inedex': 24}], - 'C0024003': [{'text': 'denopathy noted.,Spine: Examination shows decreased lumbar lordosis with tenderness that seems to be in her right sacroiliac jo', - 'cui': 'C0024003', - 'source value': 'lordosis', - 'acc': 0.502686235070267, - 'project index': 0, - 'document inedex': 24}]}})+ 'validated': True}]}] +++++++++++MetaAnnotations¶
During the annotation process we have created only one meta-annotation called "Status". Here we are going to train a BiLSTM to detect that meta-annotation.
+ +++++++++++MetaCAT¶
The class we are going to use to train meta-annotations is called MetaCAT. As input it takes:
++
tokenizer
- BBPE tokenizer from huggingface and BERT tokenizer+
embeddings
- The precalculated embeddings for the tokens produced by the tokenizer. Can be anything from Word2Vec to BERT. This is a numpy matrix, or python list of embeddings (only for Bi-LSTM).+
cntx_left
- Size of context from the left side of the entity that will be taken into account.+
cntx_right
- Size of context from the right side of the entity that will be taken into account.+
save_dir
- Where do we want to save the trained models.+
pad_id
- Padding index in the embeddings matrix.+ +
device
- On which device to run thiscpu
orcuda
++++++++++You can choose to train
+BERT
orBi-LSTM
model for MetaCAT.
+In this tutorial, we'll demonstrate:+
+ +- continuing training for a previously trained
+Bi-LSTM
model (on NHS data)- training
+BERT
without loading a previously trained model (on NHS data)++++++++++Run the model setup, config and train sections for either BERT or Bi-LSTM
+ +++++++++++BERT¶
++++++++++Model setup¶
++++ +++++In [ ]:++++++ +# training BERT without loading previous model pack + +config_metacat = ConfigMetaCAT() +config_metacat.model['model_name'] = 'bert' + +# add category name +config_metacat.general['category_name'] = 'Status' +# add number of classes +config_metacat.model['nclasses'] = 2 + +tokenizer = TokenizerWrapperBERT.load("", config_metacat.model['model_variant']) +++ +++ + ++ ++ ++ + + + + ++ +++WARNING:root:Could not load tokenizer from path due to error: bert-tokenizer is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models' +If this is a private repository, make sure to pass a token having permission to this repo either by logging in with `huggingface-cli login` or by passing `token=<your_token>`. Loading from library for model variant: bert-base-uncased ++++++ +++++In [ ]:++++++ +mc = MetaCAT(tokenizer=tokenizer, embeddings=None, config=config_metacat) +++ +++ + ++ ++ ++ + + + + ++ +++WARNING:medcat.utils.meta_cat.models: +Input size for bert-base-uncased model should be 768, provided input size is 300 Input size changed to 768 +INFO:medcat.meta_cat:BERT model used for classification +++++++++++MetaCAT configuration¶
For a full list of all the configurable parameter. Follow this link.
+Some noteable parameters:
++
category_name
- What is the name of this meta-annotation (same as the name in the MedCATtrainer)+
model_name
- bert or lstm+
model_variant
- Only for BERT: Specifies the model variant to be used+
lr
- Learning rate+
test_size
- Proportion of the test set+
bach_size
- Batch size+
model_freeze_layers
- Only for BERT: Freeze BERT's layers or train using LoRA+
metric
- What metric should be used for choosing the best model.+
nepochs
- Number of epochs to run for+
lowercase
- Do you want to lowercase the text+
class_weights
- Pytorch parameter for unbalanced classes+
compute_class_weights
- Do you want the classes weights to be computed automatically based on the data+
ignore_cpos
- The position of the entity will be ignored, do not use this.+ +
auto_save_model
- This will autosave the top performing epoch during the training process++++ +++++In [ ]:++++++ +# Example of how to change parameters +mc.config.model['input_size'] = 768 +mc.config.model['hidden_size'] = 300 + +mc.config.train.lr = 5e-4 +mc.config.model.dropout = 0.2 + +mc.config.model['model_freeze_layers'] = False +mc.config.train['nepochs'] = 55 +mc.config.train['auto_save_model'] = True +++++++++Train MetaCAT¶
To run the training we use the
+train_from_json
method that allows us to specify:+
json_path
: Path to a MedCATtrainer export containing the meta_annotations we want to train for.+ +
save_dir_path
: (optional, defaults toNone
): In case we have auto_save_model (meaning during the training the best model will be saved) we need to set a save path.+++ +++++In [ ]:++++++ +import logging +logging.basicConfig(level=logging.INFO,force=True) ++++ +++++In [ ]:++++++ +mc.train_from_json(json_path=DATA_DIR+"MedCAT_Export.json", save_dir_path='status_bert') +# Saving the model this way will only save the model epoch with the best performance ++-++ + ++ ++INFO:medcat.utils.meta_cat.ml_utils:Epoch: 6 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -+ + + + + +-++ accuracy 0.61 365 + macro avg 0.57 0.58 0.58 365 +weighted avg 0.64 0.61 0.62 365 -INFO:medcat.utils.meta_cat.data_utils:Updated label_data: {0: 128, 1: 128} +/usr/local/lib/python3.10/dist-packages/transformers/optimization.py:591: FutureWarning: This implementation of AdamW is deprecated and will be removed in a future version. Use the PyTorch implementation torch.optim.AdamW instead, or set `no_deprecation_warning=True` to disable this warning + warnings.warn( +INFO:medcat.utils.meta_cat.ml_utils:Total steps for optimizer: 200 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 0 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.69 0.64 0.66 251 + 1 0.31 0.36 0.33 114 + + accuracy 0.55 365 + macro avg 0.50 0.50 0.50 365 +weighted avg 0.57 0.55 0.56 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 0 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.63 0.63 0.63 27 + 1 0.29 0.29 0.29 14 + + accuracy 0.51 41 + macro avg 0.46 0.46 0.46 41 +weighted avg 0.51 0.51 0.51 41 + +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_bert/model.dat at epoch: 0 and macro avg/f1-score: 0.4576719576719577 ##### + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 1 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.68 0.60 0.64 251 + 1 0.31 0.39 0.34 114 + + accuracy 0.53 365 + macro avg 0.49 0.49 0.49 365 +weighted avg 0.57 0.53 0.55 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 1 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.65 0.63 0.64 27 + 1 0.33 0.36 0.34 14 + + accuracy 0.54 41 + macro avg 0.49 0.49 0.49 41 +weighted avg 0.54 0.54 0.54 41 + +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_bert/model.dat at epoch: 1 and macro avg/f1-score: 0.4931685100845803 ##### + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 2 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.68 0.61 0.64 251 + 1 0.30 0.38 0.34 114 + + accuracy 0.53 365 + macro avg 0.49 0.49 0.49 365 +weighted avg 0.56 0.53 0.55 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 2 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.68 0.63 0.65 27 + 1 0.38 0.43 0.40 14 + + accuracy 0.56 41 + macro avg 0.53 0.53 0.53 41 +weighted avg 0.58 0.56 0.57 41 + +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_bert/model.dat at epoch: 2 and macro avg/f1-score: 0.5269230769230769 ##### + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 3 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.69 0.58 0.63 251 + 1 0.32 0.44 0.37 114 + + accuracy 0.53 365 + macro avg 0.51 0.51 0.50 365 +weighted avg 0.58 0.53 0.55 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 3 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.70 0.59 0.64 27 + 1 0.39 0.50 0.44 14 + + accuracy 0.56 41 + macro avg 0.54 0.55 0.54 41 +weighted avg 0.59 0.56 0.57 41 + +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_bert/model.dat at epoch: 3 and macro avg/f1-score: 0.53875 ##### + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 4 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.73 0.60 0.66 251 + 1 0.37 0.52 0.43 114 + + accuracy 0.57 365 + macro avg 0.55 0.56 0.54 365 +weighted avg 0.62 0.57 0.59 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 4 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.70 0.59 0.64 27 + 1 0.39 0.50 0.44 14 + + accuracy 0.56 41 + macro avg 0.54 0.55 0.54 41 +weighted avg 0.59 0.56 0.57 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 5 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.72 0.57 0.64 251 + 1 0.35 0.51 0.42 114 + + accuracy 0.55 365 + macro avg 0.54 0.54 0.53 365 +weighted avg 0.60 0.55 0.57 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 5 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.67 0.59 0.63 27 + 1 0.35 0.43 0.39 14 + + accuracy 0.54 41 + macro avg 0.51 0.51 0.51 41 +weighted avg 0.56 0.54 0.55 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 6 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.75 0.67 0.70 251 + 1 0.40 0.50 0.45 114 ----+ accuracy 0.61 41 + macro avg 0.59 0.60 0.59 41 +weighted avg 0.64 0.61 0.62 41 -In [12]:-----+ 0 0.74 0.63 0.68 27 + 1 0.44 0.57 0.50 14 -# If we want to know the F1, P, R for each cui, we can call the stats method -data = json.load(open(DATA_DIR + "MedCAT_Export.json")) -fps, fns, tps, cui_prec, cui_rec, cui_f1, cui_counts, examples = cat._print_stats(data, extra_cui_filter=True) --+ accuracy 0.97 365 + macro avg 0.96 0.97 0.97 365 +weighted avg 0.97 0.97 0.97 365 -+INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_bert/model.dat at epoch: 6 and macro avg/f1-score: 0.5900000000000001 ##### +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 7 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support --+ 0 0.75 0.68 0.71 251 + 1 0.42 0.51 0.46 114 - + accuracy 0.62 365 + macro avg 0.58 0.59 0.59 365 +weighted avg 0.65 0.62 0.63 365 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 7 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + 0 0.79 0.70 0.75 27 + 1 0.53 0.64 0.58 14 + accuracy 0.68 41 + macro avg 0.66 0.67 0.66 41 +weighted avg 0.70 0.68 0.69 41 +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_bert/model.dat at epoch: 7 and macro avg/f1-score: 0.6628716002530045 ##### - - - -+ 0 0.80 0.70 0.74 251 + 1 0.48 0.61 0.54 114 -- - -+INFO:medcat.utils.meta_cat.ml_utils:Epoch: 8 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -+ accuracy 0.67 365 + macro avg 0.64 0.66 0.64 365 +weighted avg 0.70 0.67 0.68 365 - +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 8 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + 0 0.80 0.74 0.77 27 + 1 0.56 0.64 0.60 14 + accuracy 0.71 41 + macro avg 0.68 0.69 0.68 41 +weighted avg 0.72 0.71 0.71 41 +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_bert/model.dat at epoch: 8 and macro avg/f1-score: 0.6846153846153846 ##### +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 9 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - - - -+ accuracy 0.72 365 + macro avg 0.69 0.71 0.69 365 +weighted avg 0.74 0.72 0.73 365 -- - -+ 0 0.83 0.74 0.78 251 + 1 0.54 0.68 0.60 114 -+INFO:medcat.utils.meta_cat.ml_utils:Epoch: 9 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - + 0 0.81 0.78 0.79 27 + 1 0.60 0.64 0.62 14 + accuracy 0.73 41 + macro avg 0.70 0.71 0.71 41 +weighted avg 0.74 0.73 0.73 41 -+ 0 0.99 0.97 0.98 251 + 1 0.93 0.97 0.95 114 ---Epoch: 0, Prec: 0.07726965532777652, Rec: 0.8511166253101737, F1: 0.1416769929781082 +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_bert/model.dat at epoch: 9 and macro avg/f1-score: 0.7065712426805465 ##### -Docs with false positives: 2124; 1383; 1734; 516; 73; 96; 1577; 1881; 1070; 1687 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 10 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -Docs with false negatives: 1383; 73; 96; 1577; 1881; 1070; 688; 1737; 716; 496 + 0 0.84 0.80 0.82 251 + 1 0.61 0.67 0.64 114 + accuracy 0.76 365 + macro avg 0.72 0.74 0.73 365 +weighted avg 0.77 0.76 0.76 365 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 10 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -False Positives + 0 0.81 0.78 0.79 27 + 1 0.60 0.64 0.62 14 -Patients - C0030705 - 200 -Normal - C0205307 - 67 -Medical History - C0262926 - 57 -Daily - C0332173 - 46 -year - C0439234 - 41 -Bilateral - C0238767 - 40 -Right - C0205090 - 33 -Pain - C0030193 - 28 -Physical Examination - C0031809 - 27 -Lung - C0024109 - 25 + accuracy 0.73 41 + macro avg 0.70 0.71 0.71 41 +weighted avg 0.74 0.73 0.73 41 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 11 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -False Negatives + 0 0.87 0.80 0.83 251 + 1 0.62 0.73 0.67 114 + + accuracy 0.78 365 + macro avg 0.75 0.76 0.75 365 +weighted avg 0.79 0.78 0.78 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 11 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.81 0.78 0.79 27 + 1 0.60 0.64 0.62 14 + + accuracy 0.73 41 + macro avg 0.70 0.71 0.71 41 +weighted avg 0.74 0.73 0.73 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 12 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.92 0.81 0.86 251 + 1 0.67 0.85 0.75 114 + + accuracy 0.82 365 + macro avg 0.80 0.83 0.81 365 +weighted avg 0.85 0.82 0.83 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 12 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.74 0.78 27 + 1 0.59 0.71 0.65 14 + + accuracy 0.73 41 + macro avg 0.71 0.73 0.71 41 +weighted avg 0.75 0.73 0.74 41 + +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_bert/model.dat at epoch: 12 and macro avg/f1-score: 0.7147375079063883 ##### + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 13 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.91 0.83 0.87 251 + 1 0.69 0.82 0.75 114 + + accuracy 0.83 365 + macro avg 0.80 0.83 0.81 365 +weighted avg 0.84 0.83 0.83 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 13 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.81 0.78 0.79 27 + 1 0.60 0.64 0.62 14 + + accuracy 0.73 41 + macro avg 0.70 0.71 0.71 41 +weighted avg 0.74 0.73 0.73 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 14 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.93 0.85 0.89 251 + 1 0.73 0.87 0.79 114 + + accuracy 0.86 365 + macro avg 0.83 0.86 0.84 365 +weighted avg 0.87 0.86 0.86 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 14 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.81 0.78 0.79 27 + 1 0.60 0.64 0.62 14 + + accuracy 0.73 41 + macro avg 0.70 0.71 0.71 41 +weighted avg 0.74 0.73 0.73 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 15 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.93 0.84 0.89 251 + 1 0.72 0.87 0.79 114 + + accuracy 0.85 365 + macro avg 0.83 0.86 0.84 365 +weighted avg 0.87 0.85 0.86 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 15 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.81 0.81 0.81 27 + 1 0.64 0.64 0.64 14 + + accuracy 0.76 41 + macro avg 0.73 0.73 0.73 41 +weighted avg 0.76 0.76 0.76 41 + +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_bert/model.dat at epoch: 15 and macro avg/f1-score: 0.7288359788359788 ##### + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 16 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.95 0.90 0.92 251 + 1 0.80 0.89 0.84 114 + + accuracy 0.89 365 + macro avg 0.87 0.89 0.88 365 +weighted avg 0.90 0.89 0.89 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 16 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.82 0.85 0.84 27 + 1 0.69 0.64 0.67 14 + + accuracy 0.78 41 + macro avg 0.76 0.75 0.75 41 +weighted avg 0.78 0.78 0.78 41 + +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_bert/model.dat at epoch: 16 and macro avg/f1-score: 0.7515151515151515 ##### + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 17 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.95 0.88 0.91 251 + 1 0.77 0.89 0.83 114 + + accuracy 0.88 365 + macro avg 0.86 0.89 0.87 365 +weighted avg 0.89 0.88 0.88 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 17 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.82 0.85 0.84 27 + 1 0.69 0.64 0.67 14 + + accuracy 0.78 41 + macro avg 0.76 0.75 0.75 41 +weighted avg 0.78 0.78 0.78 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 18 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.95 0.90 0.92 251 + 1 0.80 0.89 0.84 114 + + accuracy 0.89 365 + macro avg 0.87 0.89 0.88 365 +weighted avg 0.90 0.89 0.89 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 18 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.82 0.85 0.84 27 + 1 0.69 0.64 0.67 14 + + accuracy 0.78 41 + macro avg 0.76 0.75 0.75 41 +weighted avg 0.78 0.78 0.78 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 19 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.95 0.91 0.93 251 + 1 0.81 0.89 0.85 114 + + accuracy 0.90 365 + macro avg 0.88 0.90 0.89 365 +weighted avg 0.90 0.90 0.90 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 19 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.82 0.85 0.84 27 + 1 0.69 0.64 0.67 14 + + accuracy 0.78 41 + macro avg 0.76 0.75 0.75 41 +weighted avg 0.78 0.78 0.78 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 20 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.97 0.91 0.94 251 + 1 0.83 0.93 0.88 114 + + accuracy 0.92 365 + macro avg 0.90 0.92 0.91 365 +weighted avg 0.92 0.92 0.92 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 20 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.89 0.86 27 + 1 0.75 0.64 0.69 14 + + accuracy 0.80 41 + macro avg 0.79 0.77 0.77 41 +weighted avg 0.80 0.80 0.80 41 + +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_bert/model.dat at epoch: 20 and macro avg/f1-score: 0.7747252747252749 ##### + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 21 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.96 0.94 0.95 251 + 1 0.87 0.91 0.89 114 + + accuracy 0.93 365 + macro avg 0.91 0.92 0.92 365 +weighted avg 0.93 0.93 0.93 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 21 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.89 0.86 27 + 1 0.75 0.64 0.69 14 + + accuracy 0.80 41 + macro avg 0.79 0.77 0.77 41 +weighted avg 0.80 0.80 0.80 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 22 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.96 0.94 0.95 251 + 1 0.88 0.92 0.90 114 + + accuracy 0.93 365 + macro avg 0.92 0.93 0.92 365 +weighted avg 0.94 0.93 0.93 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 22 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.89 0.86 27 + 1 0.75 0.64 0.69 14 + + accuracy 0.80 41 + macro avg 0.79 0.77 0.77 41 +weighted avg 0.80 0.80 0.80 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 23 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.96 0.92 0.94 251 + 1 0.85 0.92 0.88 114 + + accuracy 0.92 365 + macro avg 0.90 0.92 0.91 365 +weighted avg 0.93 0.92 0.92 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 23 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.92 0.85 0.88 27 + 1 0.75 0.86 0.80 14 + + accuracy 0.85 41 + macro avg 0.83 0.85 0.84 41 +weighted avg 0.86 0.85 0.86 41 + +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_bert/model.dat at epoch: 23 and macro avg/f1-score: 0.8423076923076922 ##### + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 24 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.97 0.94 0.96 251 + 1 0.88 0.93 0.91 114 + + accuracy 0.94 365 + macro avg 0.93 0.94 0.93 365 +weighted avg 0.94 0.94 0.94 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 24 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.92 0.81 0.86 27 + 1 0.71 0.86 0.77 14 + + accuracy 0.83 41 + macro avg 0.81 0.84 0.82 41 +weighted avg 0.84 0.83 0.83 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 25 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.95 0.96 251 + 1 0.89 0.95 0.92 114 + + accuracy 0.95 365 + macro avg 0.93 0.95 0.94 365 +weighted avg 0.95 0.95 0.95 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 25 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.92 0.81 0.86 27 + 1 0.71 0.86 0.77 14 + + accuracy 0.83 41 + macro avg 0.81 0.84 0.82 41 +weighted avg 0.84 0.83 0.83 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 26 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.96 0.94 0.95 251 + 1 0.87 0.91 0.89 114 + + accuracy 0.93 365 + macro avg 0.91 0.92 0.92 365 +weighted avg 0.93 0.93 0.93 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 26 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.92 0.81 0.86 27 + 1 0.71 0.86 0.77 14 + + accuracy 0.83 41 + macro avg 0.81 0.84 0.82 41 +weighted avg 0.84 0.83 0.83 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 27 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.94 0.96 251 + 1 0.89 0.96 0.92 114 + + accuracy 0.95 365 + macro avg 0.94 0.95 0.94 365 +weighted avg 0.95 0.95 0.95 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 27 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.85 0.81 0.83 27 + 1 0.67 0.71 0.69 14 + + accuracy 0.78 41 + macro avg 0.76 0.76 0.76 41 +weighted avg 0.78 0.78 0.78 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 28 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.94 0.96 251 + 1 0.88 0.96 0.92 114 + + accuracy 0.95 365 + macro avg 0.93 0.95 0.94 365 +weighted avg 0.95 0.95 0.95 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 28 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.85 0.81 0.83 27 + 1 0.67 0.71 0.69 14 + + accuracy 0.78 41 + macro avg 0.76 0.76 0.76 41 +weighted avg 0.78 0.78 0.78 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 29 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.95 0.97 251 + 1 0.90 0.96 0.93 114 + + accuracy 0.95 365 + macro avg 0.94 0.95 0.95 365 +weighted avg 0.95 0.95 0.95 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 29 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.86 0.89 0.87 27 + 1 0.77 0.71 0.74 14 + + accuracy 0.83 41 + macro avg 0.81 0.80 0.81 41 +weighted avg 0.83 0.83 0.83 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 30 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.96 0.97 251 + 1 0.92 0.96 0.94 114 + + accuracy 0.96 365 + macro avg 0.95 0.96 0.96 365 +weighted avg 0.96 0.96 0.96 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 30 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.85 0.85 0.85 27 + 1 0.71 0.71 0.71 14 + + accuracy 0.80 41 + macro avg 0.78 0.78 0.78 41 +weighted avg 0.80 0.80 0.80 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 31 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.96 0.97 251 + 1 0.92 0.96 0.94 114 + + accuracy 0.96 365 + macro avg 0.95 0.96 0.95 365 +weighted avg 0.96 0.96 0.96 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 31 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.85 0.85 0.85 27 + 1 0.71 0.71 0.71 14 + + accuracy 0.80 41 + macro avg 0.78 0.78 0.78 41 +weighted avg 0.80 0.80 0.80 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 32 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.96 0.97 251 + 1 0.92 0.96 0.94 114 + + accuracy 0.96 365 + macro avg 0.95 0.96 0.95 365 +weighted avg 0.96 0.96 0.96 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 32 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.88 0.85 0.87 27 + 1 0.73 0.79 0.76 14 + + accuracy 0.83 41 + macro avg 0.81 0.82 0.81 41 +weighted avg 0.83 0.83 0.83 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 33 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.96 0.97 251 + 1 0.92 0.96 0.94 114 + + accuracy 0.96 365 + macro avg 0.95 0.96 0.96 365 +weighted avg 0.96 0.96 0.96 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 33 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.88 0.85 0.87 27 + 1 0.73 0.79 0.76 14 + + accuracy 0.83 41 + macro avg 0.81 0.82 0.81 41 +weighted avg 0.83 0.83 0.83 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 34 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.95 0.97 251 + 1 0.90 0.96 0.93 114 + + accuracy 0.96 365 + macro avg 0.94 0.96 0.95 365 +weighted avg 0.96 0.96 0.96 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 34 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.85 0.85 0.85 27 + 1 0.71 0.71 0.71 14 + + accuracy 0.80 41 + macro avg 0.78 0.78 0.78 41 +weighted avg 0.80 0.80 0.80 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 35 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.96 0.97 251 + 1 0.91 0.96 0.93 114 + + accuracy 0.96 365 + macro avg 0.94 0.96 0.95 365 +weighted avg 0.96 0.96 0.96 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 35 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.89 0.86 27 + 1 0.75 0.64 0.69 14 + + accuracy 0.80 41 + macro avg 0.79 0.77 0.77 41 +weighted avg 0.80 0.80 0.80 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 36 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.96 0.97 251 + 1 0.92 0.96 0.94 114 + + accuracy 0.96 365 + macro avg 0.95 0.96 0.96 365 +weighted avg 0.97 0.96 0.96 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 36 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 + + accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 37 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.99 0.96 0.97 251 + 1 0.92 0.97 0.94 114 + + accuracy 0.96 365 + macro avg 0.95 0.97 0.96 365 +weighted avg 0.97 0.96 0.96 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 37 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 + + accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 38 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.99 0.95 0.97 251 + 1 0.90 0.97 0.94 114 + + accuracy 0.96 365 + macro avg 0.95 0.96 0.95 365 +weighted avg 0.96 0.96 0.96 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 38 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 + + accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 39 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.96 0.97 251 + 1 0.92 0.96 0.94 114 + + accuracy 0.96 365 + macro avg 0.95 0.96 0.96 365 +weighted avg 0.96 0.96 0.96 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 39 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.89 0.86 27 + 1 0.75 0.64 0.69 14 + + accuracy 0.80 41 + macro avg 0.79 0.77 0.77 41 +weighted avg 0.80 0.80 0.80 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 40 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.99 0.96 0.97 251 + 1 0.92 0.97 0.94 114 + + accuracy 0.96 365 + macro avg 0.95 0.97 0.96 365 +weighted avg 0.97 0.96 0.96 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 40 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.89 0.86 27 + 1 0.75 0.64 0.69 14 + + accuracy 0.80 41 + macro avg 0.79 0.77 0.77 41 +weighted avg 0.80 0.80 0.80 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 41 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.97 0.98 251 + 1 0.93 0.96 0.95 114 + + accuracy 0.97 365 + macro avg 0.96 0.97 0.96 365 +weighted avg 0.97 0.97 0.97 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 41 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 + + accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 42 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.99 0.97 0.98 251 + 1 0.93 0.97 0.95 114 + + accuracy 0.97 365 + macro avg 0.96 0.97 0.97 365 +weighted avg 0.97 0.97 0.97 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 42 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 + + accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 43 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.99 0.97 0.98 251 + 1 0.93 0.97 0.95 114 + + accuracy 0.97 365 + macro avg 0.96 0.97 0.97 365 +weighted avg 0.97 0.97 0.97 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 43 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 + + accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 44 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.96 0.97 251 + 1 0.92 0.96 0.94 114 + + accuracy 0.96 365 + macro avg 0.95 0.96 0.96 365 +weighted avg 0.96 0.96 0.96 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 44 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 + + accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 45 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.99 0.97 0.98 251 + 1 0.94 0.97 0.96 114 + + accuracy 0.97 365 + macro avg 0.96 0.97 0.97 365 +weighted avg 0.97 0.97 0.97 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 45 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 + + accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 46 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.96 0.97 251 + 1 0.92 0.96 0.94 114 + + accuracy 0.96 365 + macro avg 0.95 0.96 0.95 365 +weighted avg 0.96 0.96 0.96 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 46 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 + + accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 47 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.99 0.96 0.98 251 + 1 0.93 0.97 0.95 114 + + accuracy 0.97 365 + macro avg 0.96 0.97 0.96 365 +weighted avg 0.97 0.97 0.97 365 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 47 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 + + accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 + +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 48 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + + 0 0.98 0.97 0.98 251 + 1 0.93 0.96 0.95 114 + + accuracy 0.97 365 + macro avg 0.96 0.97 0.96 365 +weighted avg 0.97 0.97 0.97 365 -Diabetes Mellitus, Non-Insulin-Dependent - C0011860 - 9 -Diabetes Mellitus - C0011849 - 7 -disorder lesions skin - C0037284 - 4 -Pseudomonas aeruginosa infection - C0854135 - 3 -Pulmonary Embolism - C0034065 - 3 -Coronary heart disease - C0010068 - 2 -Arthritis - C0003864 - 2 -C1561826 - C1561826 - 2 -Syndrome - C0039082 - 2 -Ulcer - C0041582 - 2 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 48 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 -True Positives + accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 -Hypertensive disease - C0020538 - 43 -disorder lesions skin - C0037284 - 17 -Hyperlipidemia - C0020473 - 12 -Coronary Arteriosclerosis - C0010054 - 10 -Lymphadenopathy - C0497156 - 10 -Mental Depression - C0011570 - 10 -Erythema - C0041834 - 9 -Congestive heart failure - C0018802 - 8 -Chronic Obstructive Airway Disease - C0024117 - 7 -Renal Insufficiency - C1565489 - 7 -************************************************************************************************************** +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 49 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support --------K-fold metrics¶
K-fold cross-validation offers a more robust evaluation of your model's performance by dividing your dataset into k subsets, or folds. -Unlike a single evaluation on the entire dataset (like
+INFO:medcat.utils.meta_cat.ml_utils:Epoch: 49 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -cat._print_stats
), the k-fold approach ensures that every data point is used for both training and validation, thereby reducing the risk of bias and providing a more reliable estimate of the model's generalization capabilities. -This method is particularly beneficial for assessing the fine-tuned performance of your model on specific datasets, as it accounts for variability and offers a comprehensive understanding of how the model might perform on unseen data.---+ accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 -In [ ]:-----+ 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 -# you need to import the module to use it -from medcat.stats.kfold import get_k_fold_stats -fps, fns, tps, cui_prec, cui_rec, cui_f1, cui_counts, examples = get_k_fold_stats(cat, data) ----+ 0 0.99 0.97 0.98 251 + 1 0.94 0.97 0.96 114 -In [13]:-----+INFO:medcat.utils.meta_cat.ml_utils:Epoch: 50 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -# Now we can check F1/P/R for a cui using -cui = "C0020538" # Hypertension -print(cui_f1[cui], cui_prec[cui], cui_rec[cui]) --+ accuracy 0.96 365 + macro avg 0.95 0.97 0.96 365 +weighted avg 0.97 0.96 0.96 365 -+ accuracy 0.97 365 + macro avg 0.96 0.97 0.97 365 +weighted avg 0.97 0.97 0.97 365 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 50 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support --+ 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 - + accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 51 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -+ 0 0.99 0.96 0.97 251 + 1 0.92 0.97 0.94 114 ---0.9662921348314606 0.9347826086956522 1.0 -----+ 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 -In [14]:-----+INFO:medcat.utils.meta_cat.ml_utils:Epoch: 51 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -# inspect fn, fp examples for specific CUIs of interest... -examples['fn']['C0010068'] --+ accuracy 0.96 365 + macro avg 0.95 0.96 0.96 365 +weighted avg 0.97 0.96 0.96 365 -+ accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 52 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support --+ 0 0.98 0.97 0.98 251 + 1 0.94 0.96 0.95 114 -+ 0 0.98 0.96 0.97 251 + 1 0.92 0.96 0.94 114 -Out[14]:+ accuracy 0.97 365 + macro avg 0.96 0.97 0.97 365 +weighted avg 0.97 0.97 0.97 365 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 52 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 + accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 --+INFO:medcat.utils.meta_cat.ml_utils:Epoch: 53 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -[{'text': ' appendectomy, oophorectomy.,FAMILY HISTORY: , Positive for coronary artery disease in her father and brother in their 40s.,SOCIAL HISTORY: , S', - 'cui': 'C0010068', - 'source value': 'coronary artery disease', - 'acc': 1, - 'project index': 0, - 'document inedex': 1}, - {'text': 'on fraction of 20%-25% in December 2005, COPD, mild diffuse coronary artery disease, and renal insufficiency.,ALLERGIES:, NO KNOWN DRUG ALLERGI', - 'cui': 'C0010068', - 'source value': 'coronary artery disease', - 'acc': 1, - 'project index': 0, - 'document inedex': 25}]---+ 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 -In [15]:-----+INFO:medcat.utils.meta_cat.ml_utils:Epoch: 53 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -# annotations inside first projects... -[anno for d in data['projects'][0]['documents'] for anno in d['annotations']][0:5] ---+ accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 54 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -+ 0 0.98 0.97 0.98 251 + 1 0.94 0.96 0.95 114 -+Out[15]:+ accuracy 0.97 365 + macro avg 0.96 0.97 0.97 365 +weighted avg 0.97 0.97 0.97 365 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 54 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + 0 0.83 0.93 0.88 27 + 1 0.82 0.64 0.72 14 + accuracy 0.83 41 + macro avg 0.83 0.78 0.80 41 +weighted avg 0.83 0.83 0.82 41 --[{'id': 45580, - 'user': 'wish', - 'cui': 'C0017168', - 'value': 'gastroesophageal reflux', - 'start': 332, - 'end': 355, - 'validated': True, - 'correct': True, - 'deleted': False, - 'alternative': False, - 'killed': False, - 'last_modified': '2020-04-01 22:06:34.303633+00:00', - 'manually_created': False, - 'acc': 1.0, - 'meta_anns': [{'name': 'Status', - 'value': 'Other', - 'acc': 1.0, - 'validated': True}]}, - {'id': 45581, - 'user': 'wish', - 'cui': 'C0020538', - 'value': 'hypertension', - 'start': 255, - 'end': 267, - 'validated': True, - 'correct': True, - 'deleted': False, - 'alternative': False, - 'killed': False, - 'last_modified': '2020-04-01 22:06:30.394941+00:00', - 'manually_created': False, - 'acc': 1.0, - 'meta_anns': [{'name': 'Status', - 'value': 'Confirmed', - 'acc': 1.0, - 'validated': True}]}, - {'id': 45582, - 'user': 'wish', - 'cui': 'C0012634', - 'value': 'disorder', - 'start': 356, - 'end': 364, - 'validated': True, - 'correct': False, - 'deleted': False, - 'alternative': False, - 'killed': True, - 'last_modified': '2020-04-01 22:06:48.174475+00:00', - 'manually_created': False, - 'acc': 0.364258020093567, - 'meta_anns': [{'name': 'Status', - 'value': 'Other', - 'acc': 1.0, - 'validated': True}]}, - {'id': 45583, - 'user': 'wish', - 'cui': 'C0038454', - 'value': 'stroke', - 'start': 276, - 'end': 282, - 'validated': True, - 'correct': True, - 'deleted': False, - 'alternative': False, - 'killed': False, - 'last_modified': '2020-04-01 22:06:33.410261+00:00', - 'manually_created': False, - 'acc': 0.39498916376357734, - 'meta_anns': [{'name': 'Status', - 'value': 'Confirmed', - 'acc': 1.0, - 'validated': True}]}, - {'id': 45584, - 'user': 'wish', - 'cui': 'C0007787', - 'value': 'TIA', - 'start': 272, - 'end': 275, - 'validated': True, - 'correct': True, - 'deleted': False, - 'alternative': False, - 'killed': False, - 'last_modified': '2020-04-01 22:06:32.727096+00:00', - 'manually_created': False, - 'acc': 0.43553226241827225, - 'meta_anns': [{'name': 'Status', - 'value': 'Confirmed', - 'acc': 1.0, - 'validated': True}]}]+ ++ + ++Out[ ]:+ + + + ++{'confusion_matrix': array([[0.85185185, 0.14814815], + [0.14285714, 0.85714286]]), + 'report': {'0': {'precision': 0.92, + 'recall': 0.8518518518518519, + 'f1-score': 0.8846153846153846, + 'support': 27.0}, + '1': {'precision': 0.75, + 'recall': 0.8571428571428571, + 'f1-score': 0.7999999999999999, + 'support': 14.0}, + 'accuracy': 0.8536585365853658, + 'macro avg': {'precision': 0.835, + 'recall': 0.8544973544973544, + 'f1-score': 0.8423076923076922, + 'support': 41.0}, + 'weighted avg': {'precision': 0.8619512195121952, + 'recall': 0.8536585365853658, + 'f1-score': 0.8557223264540337, + 'support': 41.0}}, + 'report_train': {'0': {'precision': 0.9626556016597511, + 'recall': 0.9243027888446215, + 'f1-score': 0.9430894308943089, + 'support': 251.0}, + '1': {'precision': 0.8467741935483871, + 'recall': 0.9210526315789473, + 'f1-score': 0.8823529411764707, + 'support': 114.0}, + 'accuracy': 0.9232876712328767, + 'macro avg': {'precision': 0.9047148976040691, + 'recall': 0.9226777102117845, + 'f1-score': 0.9127211860353898, + 'support': 365.0}, + 'weighted avg': {'precision': 0.9264625043318182, + 'recall': 0.9232876712328767, + 'f1-score': 0.9241196779413401, + 'support': 365.0}}, + 'epoch': 23}---+MetaAnnotations¶
During the annotation process we have created only one meta-annotation called "Status". Here we are going to train a BiLSTM to detect that meta-annotation.
+++++++++Bi-LSTM¶
+++++++-Model setup¶
--+-MetaCAT¶
The class we are going to use to train meta-annotations is called MetaCAT. As input it takes:
--
tokenizer
- A BBPE tokenizer from huggingface-
embeddings
- The precalculated embeddings for the tokens produced by the tokenizer. Can be anything from Word2Vec to BERT. This is a numpy matrix, or python list of embeddings.-
cntx_left
- Size of context from the left side of the entity that will be taken into account.-
cntx_right
- Size of context from the right side of the entity that will be taken into account.-
save_dir
- Where do we want to save the trained models.-
pad_id
- Padding index in the embeddings matrix.-
device
- On which device to run thiscpu
orcuda
++---In [16]:---+ ++!unzip $DATA_DIR/mc_status.zip ++In [ ]:++++-!unzip $DATA_DIR/mc_status.zip++--+-++- + + -+-Archive: data/mc_status.zip - creating: Status/ - inflating: Status/model.dat - inflating: Status/config.json - inflating: Status/bbpe-vocab.json - inflating: Status/bbpe-merges.txt ++Archive: ./data_p4.2//mc_status.zip + creating: Status/ + inflating: Status/model.dat + inflating: Status/config.json + inflating: Status/bbpe-vocab.json + inflating: Status/bbpe-merges.txt++----In [17]:--++In [ ]:++++-# Get the required tokenizer (note that we have already downloaded the required models) -mc = MetaCAT.load('Status') +mc = MetaCAT.load('Status')---MetaCAT configuration¶
For a full list of all the configurable parameter. Follow this link.
+++-++++MetaCAT configuration¶
For a full list of all the configurable parameter. Follow this link.
Some noteable parameters:
-
category_name
- What is the name of this meta-annotation (same as the name in the MedCATtrainer)+
model_name
- for now onlylstm
+
model_name
- bert or lstm
model_variant
- Only for BERT: Specifies the model variant to be used
lr
- Learning rate
test_size
- Proportion of the test set+
bach_size
- Batch size+
model_freeze_layers
- Only for BERT: Freeze BERT's layers or train using LoRA
metric
- What metric should be used for choosing the best model.
nepochs
- Number of epochs to run for-
lowercase
- Do you want to lowercase the text+
class_weights
- Pytorch LSTM parameter for unbalanced classes+
class_weights
- Pytorch parameter for unbalanced classes
compute_class_weights
- Do you want the classes weights to be computed automatically based on the data
ignore_cpos
- The position of the entity will be ignored, do not use this.
auto_save_model
- This will autosave the top performing epoch during the training process--In [18]:---++++++In [ ]:++++-# Example of how to change parameters -mc.config.model['input_size'] = 768 -mc.config.model['hidden_size'] = 300 +mc.config.model['input_size'] = 768 +mc.config.model['hidden_size'] = 300 +mc.config.general['category_value2id'] = {'Other':1,'Confirmed':0} + +mc.config.train['test_size'] = 0.2 -mc.config.train['nepochs'] = 55 -mc.config.train['auto_save_model'] = True +mc.config.model['nclasses'] = 2 +mc.config.train['nepochs'] = 55 +mc.config.train['auto_save_model'] = True---Train MetaCAT¶
To run the training we use the
+train
method that allows us to specify:++-++++Train MetaCAT¶
To run the training we use the
train_from_json
method that allows us to specify:
json_path
: Path to a MedCATtrainer export containing the meta_annotations we want to train for.
save_dir_path
: (optional, defaults toNone
): In case we have auto_save_model (meaning during the training the best model will be saved) we need to set a save path.--In [19]:---mc.train_from_json(json_path= DATA_DIR+"MedCAT_Export.json", save_dir_path='status') -# Saving the model this way will only save the model epoch with the best performance +++- -+++In [ ]:++++-import logging +logging.basicConfig(level=logging.INFO,force=True)-- - -- - - - ---WARNING:medcat:The number of classes set in the config is not the same as the one found in the data: 2 vs 3 -WARNING:medcat:Auto-setting the nclasses value in config and rebuilding the model. --- - - - --Epoch: 0 ************************************************** Train - precision recall f1-score support - - 0 0.00 0.00 0.00 0 - 1 0.46 0.49 0.47 113 - 2 0.77 0.70 0.74 253 - - accuracy 0.64 366 - macro avg 0.41 0.40 0.40 366 -weighted avg 0.68 0.64 0.65 366 - -Epoch: 0 ************************************************** Test - precision recall f1-score support - - 1 1.00 0.27 0.42 15 - 2 0.69 1.00 0.82 25 - - accuracy 0.73 40 - macro avg 0.85 0.63 0.62 40 -weighted avg 0.81 0.72 0.67 40 - - -##### Model saved to status/model.dat at epoch: 0 and weighted avg/f1-score: 0.6701898188093184 ##### ++++++- -In [ ]:+++- +mc.train_from_json(json_path= DATA_DIR+"MedCAT_Export.json", save_dir_path='status_lstm') +# Saving the model this way will only save the model epoch with the best performance +- - - - --+ +/usr/local/lib/python3.7/dist-packages/sklearn/metrics/_classification.py:1318: UndefinedMetricWarning: Recall and F-score are ill-defined and being set to 0.0 in labels with no true samples. Use `zero_division` parameter to control this behavior. - _warn_prf(average, modifier, msg_start, len(result)) -/usr/local/lib/python3.7/dist-packages/sklearn/metrics/_classification.py:1318: UndefinedMetricWarning: Recall and F-score are ill-defined and being set to 0.0 in labels with no true samples. Use `zero_division` parameter to control this behavior. - _warn_prf(average, modifier, msg_start, len(result)) -/usr/local/lib/python3.7/dist-packages/sklearn/metrics/_classification.py:1318: UndefinedMetricWarning: Recall and F-score are ill-defined and being set to 0.0 in labels with no true samples. Use `zero_division` parameter to control this behavior. - _warn_prf(average, modifier, msg_start, len(result)) -+-- ++----Epoch: 1 ************************************************** Train - precision recall f1-score support + + - 1 1.00 0.18 0.30 113 - 2 0.73 1.00 0.84 253 - accuracy 0.75 366 - macro avg 0.87 0.59 0.57 366 -weighted avg 0.81 0.75 0.68 366 ++INFO:medcat.utils.meta_cat.data_utils:Updated label_data: {1: 128, 0: 128} +WARNING:medcat.utils.meta_cat.ml_utils:Class weights not provided and compute_class_weights parameter is set to False. No class weights used for training. +/usr/local/lib/python3.10/dist-packages/transformers/optimization.py:591: FutureWarning: This implementation of AdamW is deprecated and will be removed in a future version. Use the PyTorch implementation torch.optim.AdamW instead, or set `no_deprecation_warning=True` to disable this warning + warnings.warn( +INFO:medcat.utils.meta_cat.ml_utils:Total steps for optimizer: 178 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 0 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -Epoch: 1 ************************************************** Test - precision recall f1-score support + 0 0.89 0.93 0.91 222 + 1 0.83 0.75 0.79 102 - 1 1.00 0.20 0.33 15 - 2 0.68 1.00 0.81 25 + accuracy 0.87 324 + macro avg 0.86 0.84 0.85 324 +weighted avg 0.87 0.87 0.87 324 - accuracy 0.70 40 - macro avg 0.84 0.60 0.57 40 -weighted avg 0.80 0.70 0.63 40 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 0 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -Epoch: 2 ************************************************** Train - precision recall f1-score support + 0 0.85 0.84 0.85 56 + 1 0.67 0.69 0.68 26 - 1 1.00 0.35 0.52 113 - 2 0.78 1.00 0.87 253 + accuracy 0.79 82 + macro avg 0.76 0.77 0.76 82 +weighted avg 0.79 0.79 0.79 82 - accuracy 0.80 366 - macro avg 0.89 0.68 0.70 366 -weighted avg 0.85 0.80 0.77 366 +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_lstm/model.dat at epoch: 0 and weighted avg/f1-score: 0.7937048875843168 ##### -Epoch: 2 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 1 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.90 0.60 0.72 15 - 2 0.80 0.96 0.87 25 + 0 0.95 0.96 0.96 222 + 1 0.92 0.88 0.90 102 - accuracy 0.82 40 - macro avg 0.85 0.78 0.80 40 -weighted avg 0.84 0.82 0.82 40 + accuracy 0.94 324 + macro avg 0.93 0.92 0.93 324 +weighted avg 0.94 0.94 0.94 324 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 1 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -##### Model saved to status/model.dat at epoch: 2 and weighted avg/f1-score: 0.8154545454545457 ##### + 0 0.87 0.84 0.85 56 + 1 0.68 0.73 0.70 26 -Epoch: 3 ************************************************** Train - precision recall f1-score support + accuracy 0.80 82 + macro avg 0.77 0.79 0.78 82 +weighted avg 0.81 0.80 0.81 82 - 1 0.90 0.88 0.89 113 - 2 0.95 0.96 0.95 253 +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_lstm/model.dat at epoch: 1 and weighted avg/f1-score: 0.8067175823273386 ##### - accuracy 0.93 366 - macro avg 0.92 0.92 0.92 366 -weighted avg 0.93 0.93 0.93 366 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 2 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -Epoch: 3 ************************************************** Test - precision recall f1-score support + 0 0.96 0.98 0.97 222 + 1 0.95 0.90 0.92 102 - 1 0.83 0.67 0.74 15 - 2 0.82 0.92 0.87 25 + accuracy 0.95 324 + macro avg 0.95 0.94 0.95 324 +weighted avg 0.95 0.95 0.95 324 - accuracy 0.82 40 - macro avg 0.83 0.79 0.80 40 -weighted avg 0.83 0.82 0.82 40 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 2 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + 0 0.87 0.84 0.85 56 + 1 0.68 0.73 0.70 26 -##### Model saved to status/model.dat at epoch: 3 and weighted avg/f1-score: 0.820230607966457 ##### + accuracy 0.80 82 + macro avg 0.77 0.79 0.78 82 +weighted avg 0.81 0.80 0.81 82 -Epoch: 4 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 3 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.96 0.89 0.93 113 - 2 0.95 0.98 0.97 253 + 0 0.96 0.97 0.97 222 + 1 0.93 0.92 0.93 102 - accuracy 0.96 366 - macro avg 0.96 0.94 0.95 366 -weighted avg 0.96 0.96 0.96 366 + accuracy 0.95 324 + macro avg 0.95 0.95 0.95 324 +weighted avg 0.95 0.95 0.95 324 -Epoch: 4 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 3 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.92 0.73 0.81 15 - 2 0.86 0.96 0.91 25 + 0 0.92 0.86 0.89 56 + 1 0.73 0.85 0.79 26 - accuracy 0.88 40 - macro avg 0.89 0.85 0.86 40 -weighted avg 0.88 0.88 0.87 40 + accuracy 0.85 82 + macro avg 0.83 0.85 0.84 82 +weighted avg 0.86 0.85 0.86 82 +INFO:medcat.utils.meta_cat.ml_utils: +##### Model saved to status_lstm/model.dat at epoch: 3 and weighted avg/f1-score: 0.8561749903213317 ##### -##### Model saved to status/model.dat at epoch: 4 and weighted avg/f1-score: 0.8715932914046121 ##### +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 4 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -Epoch: 5 ************************************************** Train - precision recall f1-score support + 0 0.98 1.00 0.99 222 + 1 0.99 0.96 0.98 102 - 1 0.96 0.99 0.97 113 - 2 1.00 0.98 0.99 253 + accuracy 0.98 324 + macro avg 0.99 0.98 0.98 324 +weighted avg 0.98 0.98 0.98 324 - accuracy 0.98 366 - macro avg 0.98 0.99 0.98 366 -weighted avg 0.98 0.98 0.98 366 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 4 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -Epoch: 5 ************************************************** Test - precision recall f1-score support + 0 0.90 0.84 0.87 56 + 1 0.70 0.81 0.75 26 - 1 0.81 0.87 0.84 15 - 2 0.92 0.88 0.90 25 + accuracy 0.83 82 + macro avg 0.80 0.82 0.81 82 +weighted avg 0.84 0.83 0.83 82 - accuracy 0.88 40 - macro avg 0.86 0.87 0.87 40 -weighted avg 0.88 0.88 0.88 40 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 5 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support + 0 0.99 0.99 0.99 222 + 1 0.97 0.97 0.97 102 -##### Model saved to status/model.dat at epoch: 5 and weighted avg/f1-score: 0.8757406188281764 ##### + accuracy 0.98 324 + macro avg 0.98 0.98 0.98 324 +weighted avg 0.98 0.98 0.98 324 -Epoch: 6 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 5 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.98 1.00 0.99 113 - 2 1.00 0.99 1.00 253 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 - accuracy 0.99 366 - macro avg 0.99 1.00 0.99 366 -weighted avg 0.99 0.99 0.99 366 + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 -Epoch: 6 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 6 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.90 0.60 0.72 15 - 2 0.80 0.96 0.87 25 + 0 0.99 1.00 0.99 222 + 1 1.00 0.97 0.99 102 - accuracy 0.82 40 - macro avg 0.85 0.78 0.80 40 -weighted avg 0.84 0.82 0.82 40 + accuracy 0.99 324 + macro avg 0.99 0.99 0.99 324 +weighted avg 0.99 0.99 0.99 324 -Epoch: 7 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 6 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.99 0.85 0.91 113 - 2 0.94 1.00 0.97 253 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 - accuracy 0.95 366 - macro avg 0.96 0.92 0.94 366 -weighted avg 0.95 0.95 0.95 366 + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 -Epoch: 7 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 7 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.90 0.60 0.72 15 - 2 0.80 0.96 0.87 25 + 0 0.99 1.00 0.99 222 + 1 0.99 0.98 0.99 102 - accuracy 0.82 40 - macro avg 0.85 0.78 0.80 40 -weighted avg 0.84 0.82 0.82 40 + accuracy 0.99 324 + macro avg 0.99 0.99 0.99 324 +weighted avg 0.99 0.99 0.99 324 -Epoch: 8 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 7 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 1.00 0.97 0.99 113 - 2 0.99 1.00 0.99 253 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 - accuracy 0.99 366 - macro avg 0.99 0.99 0.99 366 -weighted avg 0.99 0.99 0.99 366 + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 -Epoch: 8 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 8 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.76 0.87 0.81 15 - 2 0.91 0.84 0.87 25 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 - accuracy 0.85 40 - macro avg 0.84 0.85 0.84 40 -weighted avg 0.86 0.85 0.85 40 + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 -Epoch: 9 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 8 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.92 1.00 0.96 113 - 2 1.00 0.96 0.98 253 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 - accuracy 0.97 366 - macro avg 0.96 0.98 0.97 366 -weighted avg 0.97 0.97 0.97 366 + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 -Epoch: 9 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 9 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.72 0.87 0.79 15 - 2 0.91 0.80 0.85 25 + 0 1.00 1.00 1.00 222 + 1 0.99 1.00 1.00 102 - accuracy 0.82 40 - macro avg 0.82 0.83 0.82 40 -weighted avg 0.84 0.82 0.83 40 + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 -Epoch: 10 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 9 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.96 1.00 0.98 113 - 2 1.00 0.98 0.99 253 + 0 0.87 0.86 0.86 56 + 1 0.70 0.73 0.72 26 - accuracy 0.99 366 - macro avg 0.98 0.99 0.98 366 -weighted avg 0.99 0.99 0.99 366 + accuracy 0.82 82 + macro avg 0.79 0.79 0.79 82 +weighted avg 0.82 0.82 0.82 82 -Epoch: 10 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 10 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.86 0.80 0.83 15 - 2 0.88 0.92 0.90 25 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 - accuracy 0.88 40 - macro avg 0.87 0.86 0.86 40 -weighted avg 0.87 0.88 0.87 40 + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 -Epoch: 11 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 10 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 1.00 0.99 1.00 113 - 2 1.00 1.00 1.00 253 + 0 0.87 0.86 0.86 56 + 1 0.70 0.73 0.72 26 - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + accuracy 0.82 82 + macro avg 0.79 0.79 0.79 82 +weighted avg 0.82 0.82 0.82 82 -Epoch: 11 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 11 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.91 0.67 0.77 15 - 2 0.83 0.96 0.89 25 + 0 1.00 1.00 1.00 222 + 1 0.99 1.00 1.00 102 - accuracy 0.85 40 - macro avg 0.87 0.81 0.83 40 -weighted avg 0.86 0.85 0.84 40 + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 -Epoch: 12 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 11 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 1.00 0.97 0.99 113 - 2 0.99 1.00 0.99 253 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 - accuracy 0.99 366 - macro avg 0.99 0.99 0.99 366 -weighted avg 0.99 0.99 0.99 366 + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 -Epoch: 12 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 12 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.90 0.60 0.72 15 - 2 0.80 0.96 0.87 25 + 0 1.00 1.00 1.00 222 + 1 0.99 0.99 0.99 102 - accuracy 0.82 40 - macro avg 0.85 0.78 0.80 40 -weighted avg 0.84 0.82 0.82 40 + accuracy 0.99 324 + macro avg 0.99 0.99 0.99 324 +weighted avg 0.99 0.99 0.99 324 -Epoch: 13 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 12 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 1.00 0.99 1.00 113 - 2 1.00 1.00 1.00 253 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 -Epoch: 13 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 13 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.91 0.67 0.77 15 - 2 0.83 0.96 0.89 25 + 0 1.00 1.00 1.00 222 + 1 0.99 1.00 1.00 102 - accuracy 0.85 40 - macro avg 0.87 0.81 0.83 40 -weighted avg 0.86 0.85 0.84 40 + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 -Epoch: 14 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 13 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 -Epoch: 14 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 14 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.92 0.73 0.81 15 - 2 0.86 0.96 0.91 25 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 - accuracy 0.88 40 - macro avg 0.89 0.85 0.86 40 -weighted avg 0.88 0.88 0.87 40 + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 -Epoch: 15 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 14 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 -Epoch: 15 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 15 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.67 0.80 0.73 15 - 2 0.86 0.76 0.81 25 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 - accuracy 0.78 40 - macro avg 0.77 0.78 0.77 40 -weighted avg 0.79 0.78 0.78 40 + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 -Epoch: 16 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 15 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.98 1.00 0.99 113 - 2 1.00 0.99 1.00 253 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 - accuracy 0.99 366 - macro avg 0.99 1.00 0.99 366 -weighted avg 0.99 0.99 0.99 366 + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 -Epoch: 16 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 16 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.65 0.87 0.74 15 - 2 0.90 0.72 0.80 25 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 - accuracy 0.78 40 - macro avg 0.78 0.79 0.77 40 -weighted avg 0.81 0.78 0.78 40 + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 -Epoch: 17 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 16 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 -Epoch: 17 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 17 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.67 0.80 0.73 15 - 2 0.86 0.76 0.81 25 + 0 1.00 1.00 1.00 222 + 1 0.99 0.99 0.99 102 - accuracy 0.78 40 - macro avg 0.77 0.78 0.77 40 -weighted avg 0.79 0.78 0.78 40 + accuracy 0.99 324 + macro avg 0.99 0.99 0.99 324 +weighted avg 0.99 0.99 0.99 324 -Epoch: 18 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 17 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 -Epoch: 18 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 18 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.80 0.80 0.80 15 - 2 0.88 0.88 0.88 25 + 0 1.00 1.00 1.00 222 + 1 0.99 1.00 1.00 102 - accuracy 0.85 40 - macro avg 0.84 0.84 0.84 40 -weighted avg 0.85 0.85 0.85 40 + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 -Epoch: 19 ************************************************** Train - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 18 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 1.00 0.99 1.00 113 - 2 1.00 1.00 1.00 253 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 -Epoch: 19 ************************************************** Test - precision recall f1-score support +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 19 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - 1 0.92 0.80 0.86 15 - 2 0.89 0.96 0.92 25 + 0 1.00 1.00 1.00 222 + 1 1.00 1.00 1.00 102 - accuracy 0.90 40 - macro avg 0.91 0.88 0.89 40 -weighted avg 0.90 0.90 0.90 40 + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 19 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support -##### Model saved to status/model.dat at epoch: 19 and weighted avg/f1-score: 0.8983516483516484 ##### + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 20 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 0.99 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 20 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 0.99 0.99 0.99 102 -Epoch: 20 ************************************************** Test - precision recall f1-score support + accuracy 0.99 324 + macro avg 0.99 0.99 0.99 324 +weighted avg 0.99 0.99 0.99 324 - 1 0.91 0.67 0.77 15 - 2 0.83 0.96 0.89 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 20 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.85 40 - macro avg 0.87 0.81 0.83 40 -weighted avg 0.86 0.85 0.84 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 21 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 0.99 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 21 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 0.99 1.00 1.00 102 -Epoch: 21 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.90 0.60 0.72 15 - 2 0.80 0.96 0.87 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 21 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.82 40 - macro avg 0.85 0.78 0.80 40 -weighted avg 0.84 0.82 0.82 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 22 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 0.98 0.99 113 - 2 0.99 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 22 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.99 366 - macro avg 1.00 0.99 0.99 366 -weighted avg 0.99 0.99 0.99 366 + 0 1.00 1.00 1.00 222 + 1 0.99 1.00 1.00 102 -Epoch: 22 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.90 0.60 0.72 15 - 2 0.80 0.96 0.87 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 22 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.82 40 - macro avg 0.85 0.78 0.80 40 -weighted avg 0.84 0.82 0.82 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 23 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 0.99 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 23 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 0.99 1.00 1.00 102 -Epoch: 23 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.90 0.60 0.72 15 - 2 0.80 0.96 0.87 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 23 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.82 40 - macro avg 0.85 0.78 0.80 40 -weighted avg 0.84 0.82 0.82 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 24 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 0.99 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 24 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 -Epoch: 24 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.90 0.60 0.72 15 - 2 0.80 0.96 0.87 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 24 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.82 40 - macro avg 0.85 0.78 0.80 40 -weighted avg 0.84 0.82 0.82 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 25 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 0.99 0.99 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 25 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.99 366 - macro avg 0.99 0.99 0.99 366 -weighted avg 0.99 0.99 0.99 366 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 -Epoch: 25 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.90 0.60 0.72 15 - 2 0.80 0.96 0.87 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 25 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.82 40 - macro avg 0.85 0.78 0.80 40 -weighted avg 0.84 0.82 0.82 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 26 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 26 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 0.99 0.99 0.99 102 -Epoch: 26 ************************************************** Test - precision recall f1-score support + accuracy 0.99 324 + macro avg 0.99 0.99 0.99 324 +weighted avg 0.99 0.99 0.99 324 - 1 0.92 0.73 0.81 15 - 2 0.86 0.96 0.91 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 26 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.88 40 - macro avg 0.89 0.85 0.86 40 -weighted avg 0.88 0.88 0.87 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 27 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 27 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 1.00 1.00 102 -Epoch: 27 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.92 0.73 0.81 15 - 2 0.86 0.96 0.91 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 27 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.88 40 - macro avg 0.89 0.85 0.86 40 -weighted avg 0.88 0.88 0.87 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 28 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 28 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 0.99 1.00 1.00 102 -Epoch: 28 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.79 0.73 0.76 15 - 2 0.85 0.88 0.86 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 28 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.82 40 - macro avg 0.82 0.81 0.81 40 -weighted avg 0.82 0.82 0.82 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 29 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 29 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 1.00 1.00 102 -Epoch: 29 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.79 0.73 0.76 15 - 2 0.85 0.88 0.86 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 29 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.82 40 - macro avg 0.82 0.81 0.81 40 -weighted avg 0.82 0.82 0.82 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 30 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 30 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 -Epoch: 30 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.79 0.73 0.76 15 - 2 0.85 0.88 0.86 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 30 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.82 40 - macro avg 0.82 0.81 0.81 40 -weighted avg 0.82 0.82 0.82 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 31 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 31 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 -Epoch: 31 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.79 0.73 0.76 15 - 2 0.85 0.88 0.86 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 31 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.82 40 - macro avg 0.82 0.81 0.81 40 -weighted avg 0.82 0.82 0.82 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 32 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 32 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 1.00 1.00 102 -Epoch: 32 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.79 0.73 0.76 15 - 2 0.85 0.88 0.86 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 32 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.82 40 - macro avg 0.82 0.81 0.81 40 -weighted avg 0.82 0.82 0.82 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 33 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 33 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 1.00 1.00 102 -Epoch: 33 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.85 0.73 0.79 15 - 2 0.85 0.92 0.88 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 33 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.85 40 - macro avg 0.85 0.83 0.84 40 -weighted avg 0.85 0.85 0.85 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 34 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 0.99 0.99 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 34 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.99 366 - macro avg 0.99 0.99 0.99 366 -weighted avg 0.99 0.99 0.99 366 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 -Epoch: 34 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.85 0.73 0.79 15 - 2 0.85 0.92 0.88 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 34 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.85 40 - macro avg 0.85 0.83 0.84 40 -weighted avg 0.85 0.85 0.85 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 35 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 0.99 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 35 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 0.99 1.00 1.00 102 -Epoch: 35 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.85 0.73 0.79 15 - 2 0.85 0.92 0.88 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 35 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.85 40 - macro avg 0.85 0.83 0.84 40 -weighted avg 0.85 0.85 0.85 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 36 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 0.99 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 36 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 -Epoch: 36 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.85 0.73 0.79 15 - 2 0.85 0.92 0.88 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 36 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.85 40 - macro avg 0.85 0.83 0.84 40 -weighted avg 0.85 0.85 0.85 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 37 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 0.99 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 37 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 1.00 1.00 102 -Epoch: 37 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.85 0.73 0.79 15 - 2 0.85 0.92 0.88 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 37 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.85 40 - macro avg 0.85 0.83 0.84 40 -weighted avg 0.85 0.85 0.85 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 38 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 0.99 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 38 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 1.00 1.00 102 -Epoch: 38 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.85 0.73 0.79 15 - 2 0.85 0.92 0.88 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 38 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.85 40 - macro avg 0.85 0.83 0.84 40 -weighted avg 0.85 0.85 0.85 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 39 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 0.99 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 39 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 -Epoch: 39 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.85 0.73 0.79 15 - 2 0.85 0.92 0.88 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 39 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.85 40 - macro avg 0.85 0.83 0.84 40 -weighted avg 0.85 0.85 0.85 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 40 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 0.99 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 40 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 1.00 1.00 102 -Epoch: 40 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.85 0.73 0.79 15 - 2 0.85 0.92 0.88 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 40 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.85 40 - macro avg 0.85 0.83 0.84 40 -weighted avg 0.85 0.85 0.85 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 41 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 0.99 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 41 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 1.00 1.00 102 -Epoch: 41 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.85 0.73 0.79 15 - 2 0.85 0.92 0.88 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 41 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.85 40 - macro avg 0.85 0.83 0.84 40 -weighted avg 0.85 0.85 0.85 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 42 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 0.99 0.99 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 42 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.99 366 - macro avg 0.99 0.99 0.99 366 -weighted avg 0.99 0.99 0.99 366 + 0 1.00 1.00 1.00 222 + 1 0.99 0.99 0.99 102 -Epoch: 42 ************************************************** Test - precision recall f1-score support + accuracy 0.99 324 + macro avg 0.99 0.99 0.99 324 +weighted avg 0.99 0.99 0.99 324 - 1 0.85 0.73 0.79 15 - 2 0.85 0.92 0.88 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 42 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.85 40 - macro avg 0.85 0.83 0.84 40 -weighted avg 0.85 0.85 0.85 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 43 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 43 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 1.00 1.00 102 -Epoch: 43 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.85 0.73 0.79 15 - 2 0.85 0.92 0.88 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 43 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.85 40 - macro avg 0.85 0.83 0.84 40 -weighted avg 0.85 0.85 0.85 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 44 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 0.99 0.99 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 44 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.99 366 - macro avg 0.99 0.99 0.99 366 -weighted avg 0.99 0.99 0.99 366 + 0 1.00 1.00 1.00 222 + 1 0.99 0.99 0.99 102 -Epoch: 44 ************************************************** Test - precision recall f1-score support + accuracy 0.99 324 + macro avg 0.99 0.99 0.99 324 +weighted avg 0.99 0.99 0.99 324 - 1 0.73 0.73 0.73 15 - 2 0.84 0.84 0.84 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 44 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.80 40 - macro avg 0.79 0.79 0.79 40 -weighted avg 0.80 0.80 0.80 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 45 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 45 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 0.99 1.00 1.00 102 -Epoch: 45 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.73 0.73 0.73 15 - 2 0.84 0.84 0.84 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 45 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.80 40 - macro avg 0.79 0.79 0.79 40 -weighted avg 0.80 0.80 0.80 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 46 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 0.99 0.99 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 46 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.99 366 - macro avg 0.99 0.99 0.99 366 -weighted avg 0.99 0.99 0.99 366 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 -Epoch: 46 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.73 0.73 0.73 15 - 2 0.84 0.84 0.84 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 46 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.80 40 - macro avg 0.79 0.79 0.79 40 -weighted avg 0.80 0.80 0.80 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 47 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 47 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 0.99 1.00 1.00 102 -Epoch: 47 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.73 0.73 0.73 15 - 2 0.84 0.84 0.84 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 47 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.80 40 - macro avg 0.79 0.79 0.79 40 -weighted avg 0.80 0.80 0.80 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 48 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 48 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 1.00 1.00 102 -Epoch: 48 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.73 0.73 0.73 15 - 2 0.84 0.84 0.84 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 48 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.80 40 - macro avg 0.79 0.79 0.79 40 -weighted avg 0.80 0.80 0.80 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 49 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 49 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 -Epoch: 49 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.73 0.73 0.73 15 - 2 0.84 0.84 0.84 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 49 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.80 40 - macro avg 0.79 0.79 0.79 40 -weighted avg 0.80 0.80 0.80 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 50 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 50 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 0.99 1.00 102 -Epoch: 50 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.73 0.73 0.73 15 - 2 0.84 0.84 0.84 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 50 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.80 40 - macro avg 0.79 0.79 0.79 40 -weighted avg 0.80 0.80 0.80 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 51 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 1.00 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 51 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 1.00 1.00 102 -Epoch: 51 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.73 0.73 0.73 15 - 2 0.84 0.84 0.84 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 51 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.80 40 - macro avg 0.79 0.79 0.79 40 -weighted avg 0.80 0.80 0.80 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 52 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 52 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 0.99 1.00 1.00 102 -Epoch: 52 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.73 0.73 0.73 15 - 2 0.84 0.84 0.84 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 52 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.80 40 - macro avg 0.79 0.79 0.79 40 -weighted avg 0.80 0.80 0.80 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 53 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 1.00 1.00 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 53 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 1.00 366 - macro avg 1.00 1.00 1.00 366 -weighted avg 1.00 1.00 1.00 366 + 0 1.00 1.00 1.00 222 + 1 1.00 1.00 1.00 102 -Epoch: 53 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.79 0.73 0.76 15 - 2 0.85 0.88 0.86 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 53 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.82 40 - macro avg 0.82 0.81 0.81 40 -weighted avg 0.82 0.82 0.82 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 -Epoch: 54 ************************************************** Train - precision recall f1-score support + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82 - 1 0.99 0.99 0.99 113 - 2 1.00 1.00 1.00 253 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 54 ************************************************** Train +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.99 366 - macro avg 0.99 0.99 0.99 366 -weighted avg 0.99 0.99 0.99 366 + 0 1.00 1.00 1.00 222 + 1 1.00 1.00 1.00 102 -Epoch: 54 ************************************************** Test - precision recall f1-score support + accuracy 1.00 324 + macro avg 1.00 1.00 1.00 324 +weighted avg 1.00 1.00 1.00 324 - 1 0.79 0.73 0.76 15 - 2 0.85 0.88 0.86 25 +INFO:medcat.utils.meta_cat.ml_utils:Epoch: 54 ************************************************** Test +INFO:medcat.utils.meta_cat.ml_utils: precision recall f1-score support - accuracy 0.82 40 - macro avg 0.82 0.81 0.81 40 -weighted avg 0.82 0.82 0.82 40 + 0 0.89 0.86 0.87 56 + 1 0.71 0.77 0.74 26 + + accuracy 0.83 82 + macro avg 0.80 0.81 0.81 82 +weighted avg 0.83 0.83 0.83 82- -Out[19]:- - - - --+{'report': {'1': {'precision': 0.9230769230769231, - 'recall': 0.8, - 'f1-score': 0.8571428571428571, - 'support': 15}, - '2': {'precision': 0.8888888888888888, - 'recall': 0.96, - 'f1-score': 0.923076923076923, - 'support': 25}, - 'accuracy': 0.9, - 'macro avg': {'precision': 0.905982905982906, - 'recall': 0.88, - 'f1-score': 0.8901098901098901, - 'support': 40}, - 'weighted avg': {'precision': 0.9017094017094017, - 'recall': 0.9, - 'f1-score': 0.8983516483516484, - 'support': 40}}, - 'epoch': 19}++ + +Out[ ]:+ + + + ++{'confusion_matrix': array([[0.85714286, 0.14285714], + [0.15384615, 0.84615385]]), + 'report': {'0': {'precision': 0.9230769230769231, + 'recall': 0.8571428571428571, + 'f1-score': 0.888888888888889, + 'support': 56.0}, + '1': {'precision': 0.7333333333333333, + 'recall': 0.8461538461538461, + 'f1-score': 0.7857142857142856, + 'support': 26.0}, + 'accuracy': 0.8536585365853658, + 'macro avg': {'precision': 0.8282051282051281, + 'recall': 0.8516483516483516, + 'f1-score': 0.8373015873015872, + 'support': 82.0}, + 'weighted avg': {'precision': 0.8629143214509067, + 'recall': 0.8536585365853658, + 'f1-score': 0.8561749903213317, + 'support': 82.0}}, + 'report_train': {'0': {'precision': 0.9641255605381166, + 'recall': 0.9684684684684685, + 'f1-score': 0.9662921348314607, + 'support': 222.0}, + '1': {'precision': 0.9306930693069307, + 'recall': 0.9215686274509803, + 'f1-score': 0.9261083743842364, + 'support': 102.0}, + 'accuracy': 0.9537037037037037, + 'macro avg': {'precision': 0.9474093149225237, + 'recall': 0.9450185479597244, + 'f1-score': 0.9462002546078485, + 'support': 324.0}, + 'weighted avg': {'precision': 0.9536005170023729, + 'recall': 0.9537037037037037, + 'f1-score': 0.9536416917277049, + 'support': 324.0}}, + 'epoch': 3}--+++-+++We can now save the models using the
save
function. It has only one argumentfull_save
ifTrue
it will also save the embeddings and tokenizers (note that this is slightly redundant, as we no training was done on the embeddings/tokenizers).--In [20]:---++++++In [ ]:++++-# Alternative way to save -mc.save("alternative_status_metamodel") +mc.save("alternative_status_metamodel")--+++-+++Test of the whole pipeline¶
--In [21]:--++++++In [ ]:++