sagorbrur / bnlp

BNLP is a natural language processing toolkit for Bengali Language.

Home Page:https://pypi.org/project/bnlp-toolkit/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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?

Try this in colab. It works.

!wget https://github.com/sagorbrur/bnlp/raw/master/model/bn_pos.pkl

bnlp_pos_issue

Thanks. Problem solved for both POS and NER.