TurkuNLP/Turku-neural-parser-pipeline

error occurs in train_models.py when I train for Burmese data

zarhlaing opened this issue · 2 comments

Issue

When I test the pretrained model on my machine, the pretrained model can work well. But, I found FileNotFoundError when I train the new model for Burmese data. The training command and error logs are:

======================
(venv-tnpp) (base) zar@zar-zar:~/2_dependency-parser_setup/Turku-neural-parser-pipeline$ time python3 train/train_models.py --name mypos-v1-dep-parser --train_file data_for-mypos-1/train.conllu --devel_file data_for-mypos-1/dev.conllu --embeddings data_for-mypos-1/embeddings.vectors

Namespace(config_directory='/home/zar/2_dependency-parser_setup/Turku-neural-parser-pipeline/train/templates', devel_file='data_for-mypos-1/dev.conllu', embeddings='data_for-mypos-1/embeddings.vectors', force_delete=False, lemmatizer=True, name='mypos-v1-dep-parser', parser=True, tagger=True, train_file='data_for-mypos-1/train.conllu')
Traceback (most recent call last):
File "train/train_models.py", line 176, in
create_model_directory(args)
File "train/train_models.py", line 34, in create_model_directory
process_morpho(args) # train/dev files for tagger/parser
File "train/train_models.py", line 68, in process_morpho
spec.loader.exec_module(morphotransfer)
File "", line 779, in exec_module
File "", line 915, in get_code
File "", line 972, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/home/zar/2_dependency-parser_setup/Turku-neural-parser-pipeline/train/../Parser-v2/nparser/scripts/transfer_morpho.py'

These are some python codes that cause the above problem:

import importlib.util
spec = importlib.util.spec_from_file_location("main", "{workdir}/../Parser-v2/nparser/scripts/transfer_morpho.py".format(workdir=thisdir))
morphotransfer = importlib.util.module_from_spec(spec)
spec.loader.exec_module(morphotransfer)

Is the "Parser-v2" folder missing under the Turku-neural-parser-pipeline project? How should I solve that issue?

Hi,

If you are following the training instructions from here https://turkunlp.org/Turku-neural-parser-pipeline/old/training.html, then these refer to the older version of the parser (a version not utilizing any contextualized embeddings). You need to clone the orig-parser-pre-2021 version of the code to make it work.