diff --git a/jack/readers/multiple_choice/shared.py b/jack/readers/multiple_choice/shared.py index 1eee1174..beae3fa5 100644 --- a/jack/readers/multiple_choice/shared.py +++ b/jack/readers/multiple_choice/shared.py @@ -54,7 +54,7 @@ def create_output(self, shared_resources: SharedResources, support_length: tf.Tensor, question_length: tf.Tensor) -> Sequence[tf.Tensor]: input_size = shared_resources.config['repr_dim_input'] - if not self.shared_resources.config["vocab_from_embeddings"]: + if not self.shared_resources.config.get("vocab_from_embeddings", False): if hasattr(self.shared_resources, 'embeddings'): e = tf.constant(self.shared_resources.embeddings, tf.float32) else: @@ -96,7 +96,7 @@ def training_ports(self) -> List[TensorPort]: @property def output_ports(self) -> List[TensorPort]: """Defines the outputs of the InputModule""" - if self.shared_resources.config["vocab_from_embeddings"]: + if self.shared_resources.config.get("vocab_from_embeddings", False): return [Ports.Input.embedded_support, Ports.Input.embedded_question, Ports.Input.support_length, Ports.Input.question_length, Ports.Input.sample_id]