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

Fixes for model creation #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

texttheater
Copy link

I got the first part (model creation) to work for training data (AUTO files) that contain words with non-ASCII characters. I only had to change a few little things, hereby humbly submitted for consideration. ^^

Now to try the actual training…

The model creation code does not support Python 3:

Traceback (most recent call last):
  File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/p264360/git/depccg/build/src/py/lstm_parser_bi.py", line 340, in <module>
    args.func(args)
  File "/home/p264360/git/depccg/build/src/py/lstm_parser_bi.py", line 290, in <lambda>
    if args.mode == "train"
  File "/home/p264360/git/depccg/build/src/py/lstm_parser.py", line 126, in create_traindata
    self._create_samples(trees)
  File "/home/p264360/git/depccg/build/src/py/lstm_parser.py", line 111, in _create_samples
    deps = self._get_dependencies(tree, len(tokens))
  File "/home/p264360/git/depccg/build/src/py/lstm_parser.py", line 95, in _get_dependencies
    assert len(filter(lambda i:i == 0, res)) == 1
TypeError: object of type 'filter' has no len()
Assumes the input (AUTO) files are UTF-8 encoded and UTF-8 encodes all output
files in the model directory. Uses the codecs package for reading and writing
files so that all str objects become unicode objects internally. This should
also make future porting to Python 3 easier.
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

Successfully merging this pull request may close these issues.

1 participant