DoodleJZ / HPSG-Neural-Parser

Source code for "Head-Driven Phrase Structure Grammar Parsing on Penn Treebank" published at ACL 2019
https://arxiv.org/abs/1907.02684
MIT License
107 stars 25 forks source link

No function pred_linearize #4

Open nangeblog opened 5 years ago

nangeblog commented 5 years ago

Loading model from models/joint_bert_dev=95.55_devuas=96.67_devlas=94.86.pt1... Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex. packages/torch/nn/_reduction.py:49: UserWarning: size_average and reduce args will be deprecated, please use reduction='sum' instead. warnings.warn(warning.format(ret)) Parsing sentences... Traceback (most recent call last): File "src_joint/main.py", line 746, in main() File "src_joint/main.py", line 742, in main args.callback(args) File "src_joint/main.py", line 680, in run_parse save_data(syntree_pred, cun) File "src_joint/main.py", line 651, in save_data output_file.write("{}\n".format(tree.pred_linearize())) AttributeError: 'InternalParseNode' object has no attribute 'pred_linearize'

yunju63 commented 4 years ago

I have the same problem like below..!

스크린샷 2020-01-27 오전 1 07 15
magoafono commented 4 years ago

Me too!

sanjeetGupta commented 4 years ago

Try tho change: "tree.linearize()" to "tree.convert().linearize()"

magoafono commented 4 years ago

Try tho change: "tree.linearize()" to "tree.convert().linearize()"

Thank you! The problem is solved for me.