c-amr / camr

Transition-based tree-to-graph AMR Parser
GNU General Public License v2.0
125 stars 44 forks source link

Training #2

Closed mdtux89 closed 7 years ago

mdtux89 commented 8 years ago

Hi, is there a way to train the parser on a different dataset? Thanks, Marco

Juicechuan commented 8 years ago

Yes. You could train the parser using the following command: python amr_parsing.py -m train --model path_to_save_model --iter N [-d path_to_amr_dev_file] --amrfmt path_to_amr_training_file > log/train.log

But before you start training the parser, make sure you get all the preprocess files and the aligned amr file ready.

Chuan

mdtux89 commented 8 years ago

Thanks!

mdtux89 commented 8 years ago

For preprocess files you mean running this python amr_parsing.py -m preprocess [input_sentence_file] on the sentences, right?

Juicechuan commented 8 years ago

Yes.

mdtux89 commented 8 years ago

Hi Chuan, I can't save the trained model because of this exception (which is raised in model.py at line 338): Saving model error <type 'exceptions.ValueError'>

Do you have any idea of what causes this problem?

Marco

IceIceRabbit commented 8 years ago

Hey, It would be great if anyone could share a solution to the saving model error. Thanks

mdtux89 commented 8 years ago

From what I could gather, it's a python bug that is fixed only in python 3.0.

http://bugs.python.org/issue11564

They were discussing it here too: https://github.com/numpy/numpy/issues/2396

Juicechuan commented 8 years ago

I've updated the parser to the newest version, which should not have saving model error. The problem is python2's bug, however it turns out the initial shape of the weight matrix is too big and the current version use a small initial parameter.

IceIceRabbit commented 8 years ago

Thanks for the update

IceIceRabbit commented 8 years ago

Hey would it be possible to update the readme?

Juicechuan commented 8 years ago

@IceIceRabbit Hi, I've update the readme, feel free to comment for further problems.