yzhangcs / parser

:rocket: State-of-the-art parsers for natural language.
https://parser.yzhang.site/
MIT License
829 stars 141 forks source link

feat_pad_index #31

Closed attardi closed 4 years ago

attardi commented 4 years ago

The value of args.feat_pad_index is calculated by property Field.pad_index and depends on the presence of attribute vocab. However in CMD.call() the attribute gets set to:

self.FEAT.vocab = tokenizer.vocab

Therefore the value of args.feat_pad_index must be updated correspondingly:

args.feat_pad_index = self.FEAT.pad_index

or else the value that is saved in the model will be inconsistent.

yzhangcs commented 4 years ago

Yes, I have updated it here https://github.com/yzhangcs/parser/blob/7babde13385c22d424effa2ed19de8297796e2b1/parser/cmds/cmd.py#L74