Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in running IGweight.py #62

Open
motazsaad opened this issue Sep 27, 2017 · 2 comments
Open

error in running IGweight.py #62

motazsaad opened this issue Sep 27, 2017 · 2 comments

Comments

@motazsaad
Copy link

Hello

I have the following error when I run IGweight.py

computing information gain Traceback (most recent call last): File "/home/motaz/tmp/langid.py/langid/train/IGweight.py", line 246, in <module> ig = compute_IG(bucketlist, features, dist, args.binarize, suffix, args.jobs) File "/home/motaz/tmp/langid.py/langid/train/IGweight.py", line 164, in compute_IG for i, (t, w) in enumerate(pass_IG_out): File "/usr/lib/python2.7/multiprocessing/pool.py", line 668, in next raise value IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

What do you think the cause of this error? How can I fix it?

Thanks

@godkillok
Copy link

I also have this problem

@godkillok
Copy link

we need modify the def pass_IG(buckets): in IGweight.py
we need to change
cm_pos[term_id, event_id] = count into
cm_pos[term_id, int(event_id)] = count

hope it can help others

godkillok added a commit to godkillok/langid.py that referenced this issue Feb 1, 2018
godkillok added a commit to godkillok/langid.py that referenced this issue Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants