rxn.onmt_utils.model_introspection

Functions

get_model_dropout(model_path)

Get the value of the dropout for the given model checkpoint.

get_model_opt(model_path)

Get the args ("opt") of rnn_size for the given model checkpoint.

get_model_rnn_size(model_path)

Get the value of rnn_size for the given model checkpoint.

get_model_seed(model_path)

Get the value of the seed for the given model checkpoint.

get_model_vocab(model_path)

Get the vocabulary from a model checkpoint.

get_preprocessed_vocab(vocab_path)

Get the vocabulary from the file saved by OpenNMT during preprocessing.

model_vocab_is_compatible(model_pt, vocab_pt)

Determine whether the vocabulary contained in a model checkpoint contains all the necessary tokens from a vocab file.