@@ -398,7 +398,7 @@ import numpy as np
398
398
import os.path
399
399
import scipy.spatial.distance as sd
400
400
from skip_thoughts import configuration
401
- from skip_thoughts import combined_encoder
401
+ from skip_thoughts import encoder_manager
402
402
403
403
In [1 ]:
404
404
# Set paths to the model.
@@ -411,15 +411,15 @@ MR_DATA_DIR = "/dir/containing/mr/data"
411
411
412
412
In [2 ]:
413
413
# Set up the encoder. Here we are using a single unidirectional model.
414
- # To use a bidirectional model as well, call load_encoder () again with
415
- # configuration.ModelConfig (bidirectional_encoder=True) and paths to the
414
+ # To use a bidirectional model as well, call load_model () again with
415
+ # configuration.model_config (bidirectional_encoder=True) and paths to the
416
416
# bidirectional model's files. The encoder will use the concatenation of
417
417
# all loaded models.
418
- encoder = combined_encoder.CombinedEncoder ()
419
- encoder.load_encoder (configuration.ModelConfig (),
420
- vocabulary_file = VOCAB_FILE ,
421
- embedding_matrix_file = EMBEDDING_MATRIX_FILE ,
422
- checkpoint_path = CHECKPOINT_PATH )
418
+ encoder = encoder_manager.EncoderManager ()
419
+ encoder.load_model (configuration.model_config (),
420
+ vocabulary_file = VOCAB_FILE ,
421
+ embedding_matrix_file = EMBEDDING_MATRIX_FILE ,
422
+ checkpoint_path = CHECKPOINT_PATH )
423
423
424
424
In [3 ]:
425
425
# Load the movie review dataset.
0 commit comments