Illegal key type <type 'long'> for IntList

32 views
Skip to first unread message

Varvara Logacheva

unread,
May 31, 2013, 7:55:44 AM5/31/13
to cdec-...@googlegroups.com
Hi, cdec users,

I hope this group is still active.

I've just started using cdec and only tried to reproduce an MT system building as written in tutorial (http://www.cdec-decoder.org/guide/tutorial.html).
On step 6 - grammar extraction for dev and test sets - the process stops due to an error "Illegal key type <type 'long'> for IntList".

I type in this command:
python -m cdec.sa.extract -c extract.ini -g dev.grammars -j 1 < dev.lc-tok.es-en > dev.lc-tok.es-en.sgm

and get this output:

INFO:cdec.sa:Sampling strategy: uniform, max sample size = 300
INFO:cdec.sa:Reading precomputed data from file /home/varvara/workspace/cdec-examples/cdec-spanish-demo/training.sa/precomp.5.2.15.1.100.10.bin...
INFO:cdec.sa:Converting 100 hash keys on precomputed inverted index...
INFO:cdec.sa:Converting 23000 hash keys on precomputed collocations...
INFO:cdec.sa:Processing precomputations took 0.332021 seconds
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/cdec/sa/extract.py", line 113, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/cdec/sa/extract.py", line 106, in main
    for output in map(extract, enumerate(sys.stdin)):
  File "/usr/local/lib/python2.7/dist-packages/cdec/sa/extract.py", line 57, in extract
    for rule in extractor.grammar(sentence):
  File "rulefactory.pxi", line 1133, in input (src/sa/_sa.c:49363)
  File "rulefactory.pxi", line 1681, in _sa.HieroCachingRuleFactory.extract (src/sa/_sa.c:55643)
  File "rulefactory.pxi", line 1468, in _sa.HieroCachingRuleFactory.create_alignments (src/sa/_sa.c:53589)
  File "int_list.pxi", line 109, in _sa.IntList.__getitem__ (src/sa/_sa.c:6308)
TypeError: Illegal key type <type 'long'> for IntList

What causes this error? How can I fix it?

Btw I saw just the same error reported: https://github.com/redpony/cdec/issues/13
but it got no answer.

Thank you,

Varvara.

Victor Chahuneau

unread,
Jun 2, 2013, 2:57:56 PM6/2/13
to cdec-...@googlegroups.com
I committed a possible fix for this…
I am not sure why this is happening though: __len__ should return an `int` but it returns a `long`
Let us know if the change works for you!

--
You received this message because you are subscribed to the Google Groups "cdec users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdec-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Varvara Logacheva

unread,
Jun 3, 2013, 6:44:53 AM6/3/13
to cdec-...@googlegroups.com
Hi, Victor,

thank you for the answer.

Unfortunately, the corrected version crashed in the same point.

воскресенье, 2 июня 2013 г., 19:57:56 UTC+1 пользователь Victor Chahuneau написал:

Victor Chahuneau

unread,
Jun 5, 2013, 1:27:24 PM6/5/13
to cdec-...@googlegroups.com
Are you sure that you re-installed the python module? (You might need to do: "rm -rf build" before that)
If yes, what is the error message now?

Varvara Logacheva

unread,
Jun 10, 2013, 11:01:25 AM6/10/13
to cdec-...@googlegroups.com
Hi,

sorry for the late answer.

yes, I've reinstalled the python module.
The error remained the same as the first time.

среда, 5 июня 2013 г., 18:27:24 UTC+1 пользователь Victor Chahuneau написал:
Reply all
Reply to author
Forward
0 new messages