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

TypeError: unorderable types: spacy.tokens.token.Token() < spacy.tokens.token.Token() for Python 3 #631

Closed
bozyurt opened this issue Nov 16, 2016 · 1 comment
Labels
bug Bugs and behaviour differing from documentation

Comments

@bozyurt
Copy link

bozyurt commented Nov 16, 2016

python keras_parikh_entailment/ train model snli_train/snli_1.0_train.jsonl snli_dev/snli_1.0_dev.jsonl
results in
TypeError: unorderable types: spacy.tokens.token.Token() < spacy.tokens.token.Token() error
at words.sort() in "keras_parikh_entailment/spacy_hook.py", line 59, in get_word_ids.

Seems like missing __lt__() method in spacy.tokens.token.Token class for Python 3 sorting support.

--
Traceback (most recent call last):
File "/home/bozyurt/anaconda3/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"main", mod_spec)
File "/home/bozyurt/anaconda3/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "keras_parikh_entailment/main.py", line 127, in
plac.call(main)
File "/home/bozyurt/anaconda3/lib/python3.5/site-packages/plac_core.py", line 328, in call
cmd, result = parser.consume(arglist)
File "/home/bozyurt/anaconda3/lib/python3.5/site-packages/plac_core.py", line 207, in consume
return cmd, self.func(*(args + varargs + extraopts), **kwargs)
File "keras_parikh_entailment/main.py", line 120, in main
train(model_dir, train_loc, dev_loc, shape, settings)
File "keras_parikh_entailment/main.py", line 30, in train
tree_truncate=settings['tree_truncate']))
File "keras_parikh_entailment/spacy_hook.py", line 59, in get_word_ids
words.sort()
TypeError: unorderable types: spacy.tokens.token.Token() < spacy.tokens.token.Token()

Your Environment

  • Operating System:
    Linux 4.4.0-47-generic Issue on sentence splitting #68-Ubuntu 16.04
  • Python Version Used:
    Python 3.5.2 |Anaconda 4.1.1 (64-bit)
  • spaCy Version Used:
  • Environment Information:
@honnibal honnibal added the bug Bugs and behaviour differing from documentation label Jan 9, 2017
@lock
Copy link

lock bot commented May 9, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs and behaviour differing from documentation
Projects
None yet
Development

No branches or pull requests

2 participants