code: def get_feature_layers(self, input_layer=None, trainable=False, use_weighted_sum=False):
          
          model = keras.models.clone_model(self.model, input_layer)
          if not trainable:
              for layer in model.layers:
                  layer.trainable = False
          if use_weighted_sum:
              rnn_layers_forward = list(map(
                  lambda x: model.get_layer(x.name.split('/')[0].split(':')[0].split('_')[0]).output,
                  self.rnn_layers_forward,
              ))
              rnn_layers_backward = list(map(
                  lambda x: model.get_layer(x.name.split('/')[0].split(':')[0].split('_')[0]).output,
                  self.rnn_layers_backward,
              ))
              forward_layer = WeightedSum(name='Bi-LM-Forward-Sum')(rnn_layers_forward)
              backward_layer_rev = WeightedSum(name='Bi-LM-Backward-Sum-Rev')(rnn_layers_backward)
              backward_layer = keras.layers.Lambda(
                  function=self._reverse_x,
                  mask=lambda _, mask: self._reverse_x(mask),
                  name='Bi-LM-Backward-Sum'
              )(backward_layer_rev)
          else:
              forward_layer = model.get_layer(name='Bi-LM-Forward').output
              backward_layer = model.get_layer(name='Bi-LM-Backward').output
          output_layer = keras.layers.Concatenate(name='Bi-LM-Feature')([forward_layer, backward_layer])
          if input_layer is None:
              input_layer = model.layers[0].input
              return input_layer, output_layer
          return output_layer
docs: Get layers that output the Bi-LM feature.
  
          :param input_layer: Use existing input layer.
          :param trainable: Whether the layers are still trainable.
          :param use_weighted_sum: Whether to use weighted sum of RNN layers.
  
          :return [input_layer,] output_layer: Input and output layer.