In the chapter 10_NLP, executing the below code gives an error -
txts = L(o.open().read() for o in files[:2000])
UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x9d in position 1757: character maps to
So I changed the code to -
txts = L(o.open(encoding=“utf8”).read() for o in files[:2000])
and it runs fine.
However executing the next line gives an error-
UnicodeEncodeError: ‘charmap’ codec can’t encode character ‘\x96’ in position 799: character maps to
And I dont know how to fix this.
Note this runs fine on Colab but throws an error when run locally on Jupyter.