Skip to content

Commit

Permalink
Fixed text_categorizer() not being loaded correctly in Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
davisking committed Jan 23, 2019
1 parent 15bed49 commit a0d2578
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mitielib/mitie.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a0d2578

Please sign in to comment.