0

I want to do sentiment analysis on urdu sentences. I searched a python package Polyglot having URDU POS tagger in it. But on installing, it prompts error;

enter image description here

Any way out?

Humty
  • 1,321
  • 3
  • 18
  • 35
  • My eyes are failing me so I can hardly read the words from that picture. Care to post the actual text? Also did you at least try googling the error you got? – drum Jan 19 '17 at 15:59
  • @drum **1** I tried to post the actual error but it stackoverflow gives the error `You code is not properly formatted`. I tried to format it but all in vain. **2.** Yeah I tried on google but could not find the related error. – Humty Jan 19 '17 at 16:23

2 Answers2

0

Even I struggled with this error for a long time.

Follow these steps to install polyglot on Windows:

  1. download package from [https://pypi.python.org/pypi/polyglot][1] . extract into folder
  2. download and install these whl files : pycld2-0.31-cp36-cp36m-win_amd64.whl, PyICU-1.9.8-cp36-cp36m-win_amd64.whl. (Also numpy - I didn't need this since I already had it installed)
  3. Open setup.py in notepad and make the following changes: (need to install codecs for this)

The README.rst file throws codecs error. Replace the 2 lines with the following:

import codecs
with codecs.open('README.rst', 'r', encoding='utf-8') as readme_file:
    readme = readme_file.read()
  1. install using 'python setup.py install'

I just made sure that the 'utf-8' UnicodeDecodeError is handled while reading file.

Hope this helps!!!

0

You need to install PyICU before running pip install polyglot.

You can follow PyICU Installation for Windows from https://pypi.org/project/PyICU/

nainometer
  • 413
  • 3
  • 17