How to solve this issue I also tried to download this files and use it but it gives same error for NER and POS
soumayan opened this issue · comments
UnpicklingError Traceback (most recent call last)
in ()
3 model_path = "./bn_pos.pkl"
4 text = "আমি ভাত খাই।"
----> 5 res = bn_pos.tag(model_path, text)
6 print(res)
/usr/local/lib/python3.6/dist-packages/bnlp/pos.py in tag(self, model_path, text)
47 def tag(self, model_path, text):
48 with open(model_path, 'rb') as pkl_model:
---> 49 model = pickle.load(pkl_model)
50 basic_t = BasicTokenizer()
51 tokens = basic_t.tokenize(text)
UnpicklingError: invalid load key, '\x0a'.
Hi @soumayan,
How did you download NER/POS model from bnlp github repository?
I download POS , NER model from this link https://github.com/sagorbrur/bnlp/blob/master/model/bn_pos_model.pkl and upload it in colab.
Also tried using this
!wget https://github.com/sagorbrur/bnlp/blob/master/model/bn_pos.pkl
!wget https://github.com/sagorbrur/bnlp/blob/master/model/bn_ner.pkl
Thanks. Problem solved for both POS and NER.