saffsd / langid.py

Stand-alone language identification system
Other
2.31k stars 317 forks source link

error in running IGweight.py #62

Open motazsaad opened 7 years ago

motazsaad commented 7 years ago

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 commented 6 years ago

I also have this problem

godkillok commented 6 years ago

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