792d64bd6f64c4483af5ca1cdb7cbe22c13b5715,demo/load_model/load_and_pool.py,,,#,9

Before Change



print("This demo demonstrates how to load the pre-trained model and extract the sentence embedding with pooling.")

config_path, checkpoint_path, dict_path = tuple(sys.argv[1:])

model = load_trained_model_from_checkpoint(config_path, checkpoint_path)
pool_layer = MaskedGlobalMaxPool1D(name="Pooling")(model.output)

After Change



print("This demo demonstrates how to load the pre-trained model and extract the sentence embedding with pooling.")

model_path = sys.argv[1]
config_path = os.path.join(model_path, "bert_config.json")
checkpoint_path = os.path.join(model_path, "bert_model.ckpt")
dict_path = os.path.join(model_path, "vocab.txt")

model = load_trained_model_from_checkpoint(config_path, checkpoint_path, seq_len=10)
pool_layer = MaskedGlobalMaxPool1D(name="Pooling")(model.output)
model = keras.models.Model(inputs=model.inputs, outputs=pool_layer)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: CyberZHG/keras-bert
Commit Name: 792d64bd6f64c4483af5ca1cdb7cbe22c13b5715
Time: 2019-07-12
Author: CyberZHG@gmail.com
File Name: demo/load_model/load_and_pool.py
Class Name:
Method Name:


Project Name: CyberZHG/keras-bert
Commit Name: 792d64bd6f64c4483af5ca1cdb7cbe22c13b5715
Time: 2019-07-12
Author: CyberZHG@gmail.com
File Name: demo/load_model/load_and_pool.py
Class Name:
Method Name:


Project Name: CyberZHG/keras-bert
Commit Name: 792d64bd6f64c4483af5ca1cdb7cbe22c13b5715
Time: 2019-07-12
Author: CyberZHG@gmail.com
File Name: demo/load_model/load_and_predict.py
Class Name:
Method Name:


Project Name: CyberZHG/keras-bert
Commit Name: 792d64bd6f64c4483af5ca1cdb7cbe22c13b5715
Time: 2019-07-12
Author: CyberZHG@gmail.com
File Name: demo/load_model/load_and_extract.py
Class Name:
Method Name: