While loading pre-trained models I get the following error. I think it's because I am using python 3.7 and the code is written in python 2.* . So anyone can tell me how can I convert it into python 3.7
import pandas as pd
import numpy as np
from train.reminder_tagger import ReminderTagger
extractor=ReminderTagger(use_pretrained=True)
class ReminderTagger(object):
def __init__(self,use_pretrained=False,save_model=True,tagger="maxent_tagger"):
self.use_pretrained=use_pretrained
self.save_model=save_model
features_file=open('./trained_models/bow_features.pkl','rb')
self.features = load(features_file)
features_file.close()
if(use_pretrained==True):
cv_file=open('./trained_models/count_vectorizer.pkl','rb')
self.cv=load(cv_file)
cv_file.close()
tf_file=open('./trained_models/tf_idftransformer.pkl','rb')
self.tf=load(tf_file)
tf_file.close()
clf_file=open('./trained_models/reminder_classifier.pkl','rb')
self.clf=load(clf_file)
clf_file.close()
tagger_file=open('./trained_models/tagger.pkl','rb')
self.tagger=load(tagger_file)
tagger_file.close()
UnicodeDecodeError Traceback (most recent call last)
<ipython-input-5-4790b6c5cf74> in <module>
2 import numpy as np
3 from train.reminder_tagger import ReminderTagger
----> 4 extractor=ReminderTagger(use_pretrained=True)
5
~/Desktop/Reminder-Extraction-master/train/reminder_tagger.py in __init__(self, use_pretrained, save_model, tagger)
22 if(use_pretrained==True):
23 cv_file=open('./trained_models/count_vectorizer.pkl','rb')
---> 24 self.cv=load(cv_file)
25 cv_file.close()
26 tf_file=open('./trained_models/tf_idftransformer.pkl','rb')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb3 in position 0: ordinal not in range(128)