From a0d25784f92951fd504610fedd2cd3ef37be00c8 Mon Sep 17 00:00:00 2001 From: Davis King Date: Wed, 23 Jan 2019 07:57:34 -0500 Subject: [PATCH] Fixed text_categorizer() not being loaded correctly in Python 3 --- mitielib/mitie.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mitielib/mitie.py b/mitielib/mitie.py index b5fd9826..801ba6fc 100644 --- a/mitielib/mitie.py +++ b/mitielib/mitie.py @@ -700,15 +700,16 @@ def train(self): class text_categorizer: def __init__(self, filename, fe_filename=None): - filename = to_bytes(filename) self.__mitie_free = _f.mitie_free if isinstance(filename, ctypes.c_void_p): self.__obj = filename else: + filename = to_bytes(filename) if _f.mitie_check_text_categorizer_pure_model(filename) == 0: if fe_filename is None: self.__obj = _f.mitie_load_text_categorizer_pure_model_without_feature_extractor(filename) else: + fe_filename = to_bytes(fe_filename) self.__obj = _f.mitie_load_text_categorizer_pure_model(filename, fe_filename) else: self.__obj = _f.mitie_load_text_categorizer(filename)