medcat.utils.legacy.legacy_converter ==================================== .. py:module:: medcat.utils.legacy.legacy_converter Attributes ---------- .. autoapisummary:: medcat.utils.legacy.legacy_converter.clogger medcat.utils.legacy.legacy_converter.hlogger Classes ------- .. autoapisummary:: medcat.utils.legacy.legacy_converter.Converter medcat.utils.legacy.legacy_converter.AvailableSerialisers Functions --------- .. autoapisummary:: medcat.utils.legacy.legacy_converter.do_conversion medcat.utils.legacy.legacy_converter.main Module Contents --------------- .. py:class:: Converter(medcat1_model_pack_path, new_model_pack_path, ser_type = AvailableSerialisers.dill) Converts v1 models to v2 models. .. py:attribute:: cdb_name :value: 'cdb.dat' .. py:attribute:: vocab_name :value: 'vocab.dat' .. py:attribute:: config_name :value: 'config.json' .. py:method:: __init__(medcat1_model_pack_path, new_model_pack_path, ser_type = AvailableSerialisers.dill) .. py:attribute:: old_model_folder .. py:attribute:: new_model_folder .. py:attribute:: ser_type .. py:property:: expected_files_in_folder The base names of the required files in a folder for a v1 model. .. py:method:: _validate() .. py:method:: convert() 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** -- The model pack. .. py:data:: clogger .. py:class:: AvailableSerialisers Bases: :py:obj:`enum.Enum` Describes the available serialisers. .. py:attribute:: dill .. py:attribute:: json .. py:method:: write_to(file_path) .. py:method:: from_file(file_path) :classmethod: .. py:method:: __new__(value) .. py:method:: _generate_next_value_(start, count, last_values) Generate the next value when not given. name: the name of the member start: the initial start value or None count: the number of existing members last_value: the last value assigned or None .. py:method:: _missing_(value) :classmethod: .. py:method:: __repr__() .. py:method:: __str__() .. py:method:: __dir__() Returns all members and all public methods .. py:method:: __format__(format_spec) Returns format using actual value type unless __str__ has been overridden. .. py:method:: __hash__() .. py:method:: __reduce_ex__(proto) .. py:method:: name() The name of the Enum member. .. py:method:: value() The value of the Enum member. .. py:data:: hlogger .. py:function:: do_conversion(file_from, file_to, save_format) Perform the conversion from v1 to v2. :param file_from: The v1 model pack path. :type file_from: str :param file_to: The v2/target model pack path. :type file_to: str :param save_format: The type of serialiser for v2. :type save_format: AvailableSerialisers .. py:function:: main(argv = None)