medcat.utils.legacy.conversion_all
Classes:
-
Converter–Converts v1 models to v2 models.
Functions:
-
unpack–Unpack v1 model into target folder.
Attributes:
-
logger–
Converter
Converter(medcat1_model_pack_path: str, new_model_pack_path: Optional[str], ser_type: AvailableSerialisers = dill)
Converts v1 models to v2 models.
Methods:
-
convert–Use the gathered information to convert to a v2 model.
Attributes:
-
cdb_name– -
config_name– -
expected_files_in_folder–The base names of the required files in a folder for a v1 model.
-
new_model_folder– -
old_model_folder– -
old_model_name– -
ser_type– -
vocab_name–
Source code in medcat-v2/medcat/utils/legacy/conversion_all.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
cdb_name
class-attribute
instance-attribute
cdb_name = 'cdb.dat'
config_name
class-attribute
instance-attribute
config_name = 'config.json'
expected_files_in_folder
property
expected_files_in_folder
The base names of the required files in a folder for a v1 model.
new_model_folder
instance-attribute
new_model_folder = new_model_pack_path
old_model_folder
instance-attribute
old_model_folder = medcat1_model_pack_path
old_model_name
instance-attribute
old_model_name = rsplit('.zip', 1)[0]
ser_type
instance-attribute
ser_type = ser_type
vocab_name
class-attribute
instance-attribute
vocab_name = 'vocab.dat'
convert
convert() -> CAT
Use the gathered information to convert to a v2 model.
This converts the CDB, Vocab, and Config, in order and then created the model pack.
If self.new_model_folder is set, the model will be saved as well.
Returns:
-
CAT(CAT) –The model pack.
Source code in medcat-v2/medcat/utils/legacy/conversion_all.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
unpack
unpack(model_zip_path: str, target_folder: str)
Unpack v1 model into target folder.
Parameters:
Source code in medcat-v2/medcat/utils/legacy/conversion_all.py
173 174 175 176 177 178 179 180 | |