"""simple docstring"""
from __future__ import annotations

import unittest

from transformers import FunnelConfig, is_tf_available
from transformers.testing_utils import require_tf

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
 import tensorflow as tf

 from transformers import (
     TFFunnelBaseModel,
     TFFunnelForMaskedLM,
     TFFunnelForMultipleChoice,
     TFFunnelForPreTraining,
     TFFunnelForQuestionAnswering,
     TFFunnelForSequenceClassification,
     TFFunnelForTokenClassification,
     TFFunnelModel,
 )




class        __snake_case	:



      def __init__(						self   ,      lowercase   ,      lowercase=13   ,      lowercase=7   ,      lowercase=True   ,      lowercase=True   ,      lowercase=True   ,      lowercase=True   ,      lowercase=99   ,      lowercase=[1, 1, 2]   ,      lowercase=1   ,      lowercase=32   ,      lowercase=4   ,      lowercase=8   ,      lowercase=37   ,      lowercase="gelu_new"   ,      lowercase=0.1   ,      lowercase=0.1   ,      lowercase=0.0   ,      lowercase=5_12   ,      lowercase=3   ,      lowercase=0.02   ,      lowercase=3   ,      lowercase=4   ,      lowercase=None   ,      lowercase=False   ,      )     ->      List[str]:





        '''simple docstring'''





        a__:					int      							=     parent
        a__:					Dict      							=     batch_size
        a__:					Union[str, Any]      							=     seq_length
        a__:					Union[str, Any]      							=     is_training
        a__:					int      							=     use_input_mask
        a__:					Optional[Any]      							=     use_token_type_ids
        a__:					Optional[Any]      							=     use_labels
        a__:					Dict      							=     vocab_size
        a__:					Any      							=     block_sizes
        a__:					Union[str, Any]      							=     num_decoder_layers
        a__:					Dict      							=     d_model
        a__:					Any      							=     n_head
        a__:					Union[str, Any]      							=     d_head
        a__:					List[str]      							=     d_inner
        a__:					List[Any]      							=     hidden_act
        a__:					str      							=     hidden_dropout
        a__:					Dict      							=     attention_dropout
        a__:					Optional[int]      							=     activation_dropout
        a__:					int      							=     max_position_embeddings
        a__:					str      							=     type_vocab_size
        a__:					List[str]      							=     2
        a__:					List[str]      							=     num_labels
        a__:					Tuple      							=     num_choices
        a__:					List[Any]      							=     scope
        a__:					Tuple      							=     initializer_std

        # Used in the tests to check the size of the first attention layer
        a__:					Union[str, Any]      							=     n_head
        # Used in the tests to check the size of the first hidden state
        a__:					List[Any]      							=     self.d_model
        # Used in the tests to check the number of output hidden states/attentions
        a__:					Union[str, Any]      							=     sum(self.block_sizes) + (0 if base else self.num_decoder_layers)
        # FunnelModel adds two hidden layers: input embeddings and the sum of the upsampled encoder hidden state with
        # the last hidden state of the first block (which is the first hidden state of the decoder).
        if not base:
          a__:					Any      							=     self.num_hidden_layers + 2



      def   lowerCamelCase_       (						self)     ->      List[Any]:





        '''simple docstring'''





        a__:					List[Any]      							=     ids_tensor([self.batch_size, self.seq_length]   ,      self.vocab_size)

        a__:					Optional[Any]      							=     None
        if self.use_input_mask:
          a__:					List[Any]      							=     random_attention_mask([self.batch_size, self.seq_length])

        a__:					Optional[Any]      							=     None
        if self.use_token_type_ids:
          a__:					Optional[int]      							=     ids_tensor([self.batch_size, self.seq_length]   ,      self.type_vocab_size)

        a__:					Union[str, Any]      							=     None
        a__:					Dict      							=     None
        a__:					Any      							=     None
        if self.use_labels:
          a__:					Dict      							=     ids_tensor([self.batch_size]   ,      self.type_sequence_label_size)
          a__:					Optional[int]      							=     ids_tensor([self.batch_size, self.seq_length]   ,      self.num_labels)
          a__:					Union[str, Any]      							=     ids_tensor([self.batch_size]   ,      self.num_choices)

        a__:					Optional[Any]      							=     FunnelConfig(
            vocab_size=self.vocab_size   ,      block_sizes=self.block_sizes   ,      num_decoder_layers=self.num_decoder_layers   ,      d_model=self.d_model   ,      n_head=self.n_head   ,      d_head=self.d_head   ,      d_inner=self.d_inner   ,      hidden_act=self.hidden_act   ,      hidden_dropout=self.hidden_dropout   ,      attention_dropout=self.attention_dropout   ,      activation_dropout=self.activation_dropout   ,      max_position_embeddings=self.max_position_embeddings   ,      type_vocab_size=self.type_vocab_size   ,      initializer_std=self.initializer_std   ,      )

        return (
            config,
            input_ids,
            token_type_ids,
            input_mask,
            sequence_labels,
            token_labels,
            choice_labels,
        )



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      )     ->      Tuple:





        '''simple docstring'''





        a__:					Tuple      							=     TFFunnelModel(config=lowercase)
        a__:					Dict      							=     {'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
        a__:					Tuple      							=     model(lowercase)

        a__:					Dict      							=     [input_ids, input_mask]
        a__:					List[Any]      							=     model(lowercase)

        a__:					Optional[int]      							=     model(lowercase)
        self.parent.assertEqual(result.last_hidden_state.shape   ,      (self.batch_size, self.seq_length, self.d_model))

        a__:					int      							=     False
        a__:					List[Any]      							=     TFFunnelModel(config=lowercase)
        a__:					Any      							=     model(lowercase)
        self.parent.assertEqual(result.last_hidden_state.shape   ,      (self.batch_size, self.seq_length, self.d_model))

        a__:					Tuple      							=     False
        a__:					Any      							=     TFFunnelModel(config=lowercase)
        a__:					int      							=     model(lowercase)
        self.parent.assertEqual(result.last_hidden_state.shape   ,      (self.batch_size, self.seq_length, self.d_model))



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      )     ->      List[Any]:





        '''simple docstring'''





        a__:					List[Any]      							=     TFFunnelBaseModel(config=lowercase)
        a__:					List[str]      							=     {'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
        a__:					Tuple      							=     model(lowercase)

        a__:					List[Any]      							=     [input_ids, input_mask]
        a__:					List[str]      							=     model(lowercase)

        a__:					List[str]      							=     model(lowercase)
        self.parent.assertEqual(result.last_hidden_state.shape   ,      (self.batch_size, 2, self.d_model))

        a__:					Dict      							=     False
        a__:					Any      							=     TFFunnelBaseModel(config=lowercase)
        a__:					str      							=     model(lowercase)
        self.parent.assertEqual(result.last_hidden_state.shape   ,      (self.batch_size, 3, self.d_model))

        a__:					Union[str, Any]      							=     False
        a__:					Tuple      							=     TFFunnelBaseModel(config=lowercase)
        a__:					int      							=     model(lowercase)
        self.parent.assertEqual(result.last_hidden_state.shape   ,      (self.batch_size, 2, self.d_model))



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      )     ->      List[Any]:





        '''simple docstring'''





        a__:					int      							=     TFFunnelForPreTraining(config=lowercase)
        a__:					List[str]      							=     {'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
        a__:					str      							=     model(lowercase)
        self.parent.assertEqual(result.logits.shape   ,      (self.batch_size, self.seq_length))



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      )     ->      Union[str, Any]:





        '''simple docstring'''





        a__:					List[str]      							=     TFFunnelForMaskedLM(config=lowercase)
        a__:					int      							=     {'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
        a__:					Optional[int]      							=     model(lowercase)
        self.parent.assertEqual(result.logits.shape   ,      (self.batch_size, self.seq_length, self.vocab_size))



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      )     ->      Optional[Any]:





        '''simple docstring'''





        a__:					List[Any]      							=     self.num_labels
        a__:					Dict      							=     TFFunnelForSequenceClassification(config=lowercase)
        a__:					Optional[int]      							=     {'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
        a__:					Dict      							=     model(lowercase)
        self.parent.assertEqual(result.logits.shape   ,      (self.batch_size, self.num_labels))



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      )     ->      List[Any]:





        '''simple docstring'''





        a__:					Dict      							=     self.num_choices
        a__:					Union[str, Any]      							=     TFFunnelForMultipleChoice(config=lowercase)
        a__:					Union[str, Any]      							=     tf.tile(tf.expand_dims(lowercase   ,      1)   ,      (1, self.num_choices, 1))
        a__:					Dict      							=     tf.tile(tf.expand_dims(lowercase   ,      1)   ,      (1, self.num_choices, 1))
        a__:					List[Any]      							=     tf.tile(tf.expand_dims(lowercase   ,      1)   ,      (1, self.num_choices, 1))
        a__:					int      							=     {
            'input_ids': multiple_choice_inputs_ids,
            'attention_mask': multiple_choice_input_mask,
            'token_type_ids': multiple_choice_token_type_ids,
        }
        a__:					List[str]      							=     model(lowercase)
        self.parent.assertEqual(result.logits.shape   ,      (self.batch_size, self.num_choices))



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      )     ->      str:





        '''simple docstring'''





        a__:					Optional[Any]      							=     self.num_labels
        a__:					Union[str, Any]      							=     TFFunnelForTokenClassification(config=lowercase)
        a__:					List[str]      							=     {'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
        a__:					str      							=     model(lowercase)
        self.parent.assertEqual(result.logits.shape   ,      (self.batch_size, self.seq_length, self.num_labels))



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      lowercase   ,      )     ->      Optional[int]:





        '''simple docstring'''





        a__:					str      							=     TFFunnelForQuestionAnswering(config=lowercase)
        a__:					List[str]      							=     {'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
        a__:					Dict      							=     model(lowercase)
        self.parent.assertEqual(result.start_logits.shape   ,      (self.batch_size, self.seq_length))
        self.parent.assertEqual(result.end_logits.shape   ,      (self.batch_size, self.seq_length))



      def   lowerCamelCase_       (						self)     ->      Dict:





        '''simple docstring'''





        a__:					Union[str, Any]      							=     self.prepare_config_and_inputs()
        (
            (
            a__
        )							,   (
            a__
        )							,   (
            a__
        )							,   (
            a__
        )							,   (
            a__
        )							,   (
            a__
        )							,   (
            a__
        )							,   
        ):					Optional[int]      							=     config_and_inputs
        a__:					Optional[Any]      							=     {'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': input_mask}
        return config, inputs_dict







@require_tf
class        __snake_case	(					__lowerCAmelCase	,				__lowerCAmelCase	,				unittest.TestCase    ):
      a__				=		(
          (
              TFFunnelModel,
              TFFunnelForMaskedLM,
              TFFunnelForPreTraining,
              TFFunnelForQuestionAnswering,
              TFFunnelForTokenClassification,
          )
          if is_tf_available()
          else ()
      )
      a__				=		(
          {
              """feature-extraction""": (TFFunnelBaseModel, TFFunnelModel),
              """fill-mask""": TFFunnelForMaskedLM,
              """question-answering""": TFFunnelForQuestionAnswering,
              """text-classification""": TFFunnelForSequenceClassification,
              """token-classification""": TFFunnelForTokenClassification,
              """zero-shot""": TFFunnelForSequenceClassification,
          }
          if is_tf_available()
          else {}
      )
      a__				=		False
      a__				=		False



      def   lowerCamelCase_       (						self)     ->      Dict:





        '''simple docstring'''





        a__:					Dict      							=     TFFunnelModelTester(self)
        a__:					int      							=     ConfigTester(self   ,      config_class=lowercase)



      def   lowerCamelCase_       (						self)     ->      int:





        '''simple docstring'''





        self.config_tester.run_common_tests()



      def   lowerCamelCase_       (						self)     ->      Union[str, Any]:





        '''simple docstring'''





        a__:					List[Any]      							=     self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_model(*lowercase)



      def   lowerCamelCase_       (						self)     ->      List[str]:





        '''simple docstring'''





        a__:					int      							=     self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_pretraining(*lowercase)



      def   lowerCamelCase_       (						self)     ->      Tuple:





        '''simple docstring'''





        a__:					str      							=     self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_masked_lm(*lowercase)



      def   lowerCamelCase_       (						self)     ->      Optional[int]:





        '''simple docstring'''





        a__:					Dict      							=     self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_token_classification(*lowercase)



      def   lowerCamelCase_       (						self)     ->      str:





        '''simple docstring'''





        a__:					int      							=     self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_question_answering(*lowercase)







@require_tf
class        __snake_case	(					__lowerCAmelCase	,				unittest.TestCase    ):
      a__				=		(
          (TFFunnelBaseModel, TFFunnelForMultipleChoice, TFFunnelForSequenceClassification) if is_tf_available() else ()
      )
      a__				=		False
      a__				=		False



      def   lowerCamelCase_       (						self)     ->      Union[str, Any]:





        '''simple docstring'''





        a__:					List[str]      							=     TFFunnelModelTester(self   ,      base=lowercase)
        a__:					Any      							=     ConfigTester(self   ,      config_class=lowercase)



      def   lowerCamelCase_       (						self)     ->      Optional[int]:





        '''simple docstring'''





        self.config_tester.run_common_tests()



      def   lowerCamelCase_       (						self)     ->      Optional[Any]:





        '''simple docstring'''





        a__:					Optional[int]      							=     self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_base_model(*lowercase)



      def   lowerCamelCase_       (						self)     ->      Optional[Any]:





        '''simple docstring'''





        a__:					Optional[int]      							=     self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_sequence_classification(*lowercase)



      def   lowerCamelCase_       (						self)     ->      Optional[int]:





        '''simple docstring'''





        a__:					List[Any]      							=     self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_multiple_choice(*lowercase)



"""simple docstring"""
import json
import os
import unittest

from transformers import DebertaTokenizer, DebertaTokenizerFast
from transformers.models.deberta.tokenization_deberta import VOCAB_FILES_NAMES
from transformers.testing_utils import slow

from ...test_tokenization_common import TokenizerTesterMixin




class        __snake_case	(					__lowerCAmelCase	,				unittest.TestCase    ):
      a__				=		DebertaTokenizer
      a__				=		True
      a__				=		DebertaTokenizerFast



      def   lowerCamelCase_       (						self)     ->      str:





        '''simple docstring'''





        super().setUp()

        # Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
        a__:					List[str]      							=     [
            'l',
            'o',
            'w',
            'e',
            'r',
            's',
            't',
            'i',
            'd',
            'n',
            '\u0120',
            '\u0120l',
            '\u0120n',
            '\u0120lo',
            '\u0120low',
            'er',
            '\u0120lowest',
            '\u0120newer',
            '\u0120wider',
            '[UNK]',
        ]
        a__:					List[str]      							=     dict(zip(lowercase   ,      range(len(lowercase))))
        a__:					Any      							=     ['#version: 0.2', '\u0120 l', '\u0120l o', '\u0120lo w', 'e r', '']
        a__:					Optional[Any]      							=     {'unk_token': '[UNK]'}

        a__:					Any      							=     os.path.join(self.tmpdirname   ,      VOCAB_FILES_NAMES['vocab_file'])
        a__:					Dict      							=     os.path.join(self.tmpdirname   ,      VOCAB_FILES_NAMES['merges_file'])
        with open(self.vocab_file   ,      'w'   ,      encoding='utf-8') as fp:
          fp.write(json.dumps(lowercase) + '\n')
        with open(self.merges_file   ,      'w'   ,      encoding='utf-8') as fp:
          fp.write('\n'.join(lowercase))



      def   lowerCamelCase_       (						self   ,      **lowercase)     ->      int:





        '''simple docstring'''





        kwargs.update(self.special_tokens_map)
        return self.tokenizer_class.from_pretrained(self.tmpdirname   ,      **lowercase)



      def   lowerCamelCase_       (						self   ,      lowercase)     ->      Dict:





        '''simple docstring'''





        a__:					Tuple      							=     'lower newer'
        a__:					int      							=     'lower newer'
        return input_text, output_text



      def   lowerCamelCase_       (						self)     ->      Optional[int]:





        '''simple docstring'''





        a__:					Optional[int]      							=     self.get_tokenizer()
        a__:					List[Any]      							=     'lower newer'
        a__:					Optional[int]      							=     ['l', 'o', 'w', 'er', '\u0120', 'n', 'e', 'w', 'er']
        a__:					Optional[Any]      							=     tokenizer.tokenize(lowercase)
        self.assertListEqual(lowercase   ,      lowercase)

        a__:					int      							=     tokens + [tokenizer.unk_token]
        a__:					Optional[int]      							=     [0, 1, 2, 15, 10, 9, 3, 2, 15, 19]
        self.assertListEqual(tokenizer.convert_tokens_to_ids(lowercase)   ,      lowercase)



      def   lowerCamelCase_       (						self)     ->      List[str]:





        '''simple docstring'''





        a__:					int      							=     self.get_tokenizer()
        a__:					Any      							=     tokenizer('Hello'   ,      'World')
        a__:					Optional[Any]      							=     [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1]
        self.assertListEqual(tokd['token_type_ids']   ,      lowercase)



      @slow
      def   lowerCamelCase_       (						self)     ->      int:





        '''simple docstring'''





        a__:					Dict      							=     self.tokenizer_class.from_pretrained('microsoft/deberta-base')

        a__:					Union[str, Any]      							=     tokenizer.encode('sequence builders'   ,      add_special_tokens=lowercase)
        a__:					Optional[Any]      							=     tokenizer.encode('multi-sequence build'   ,      add_special_tokens=lowercase)

        a__:					List[str]      							=     tokenizer.encode(
            'sequence builders'   ,      add_special_tokens=lowercase   ,      add_prefix_space=lowercase)
        a__:					Any      							=     tokenizer.encode(
            'sequence builders'   ,      'multi-sequence build'   ,      add_special_tokens=lowercase   ,      add_prefix_space=lowercase)

        a__:					Optional[int]      							=     tokenizer.build_inputs_with_special_tokens(lowercase)
        a__:					Union[str, Any]      							=     tokenizer.build_inputs_with_special_tokens(lowercase   ,      lowercase)

        assert encoded_sentence == encoded_text_from_decode
        assert encoded_pair == encoded_pair_from_decode



      @slow
      def   lowerCamelCase_       (						self)     ->      Any:





        '''simple docstring'''





        a__:					List[Any]      							=     [self.tokenizer_class]
        if self.test_rust_tokenizer:
          tokenizer_classes.append(self.rust_tokenizer_class)

        for tokenizer_class in tokenizer_classes:
          a__:					int      							=     tokenizer_class.from_pretrained('microsoft/deberta-base')

          a__:					List[str]      							=     [
              'ALBERT: A Lite BERT for Self-supervised Learning of Language Representations',
              'ALBERT incorporates two parameter reduction techniques',
              'The first one is a factorized embedding parameterization. By decomposing the large vocabulary'
              ' embedding matrix into two small matrices, we separate the size of the hidden layers from the size of'
              ' vocabulary embedding.',
          ]

          a__:					Dict      							=     tokenizer(lowercase   ,      padding=lowercase)
          a__:					Union[str, Any]      							=     [tokenizer.decode(lowercase   ,      skip_special_tokens=lowercase) for seq in encoding['input_ids']]

          # fmt: off
          a__:					Any      							=     {
              'input_ids': [
                  [1, 21_18, 1_11_26, 5_65, 35, 83, 2_51_91, 1_63, 1_88_54, 13, 1_21_56, 12, 1_61_01, 2_53_76, 1_38_07, 9, 2_22_05, 2_78_93, 16_35, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                  [1, 21_18, 1_11_26, 5_65, 2_45_36, 80, 4_37_97, 48_78, 73_73, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                  [1, 1_33, 78, 65, 16, 10, 37_24, 15_38, 3_31_83, 1_13_03, 4_37_97, 19_38, 4, 8_70, 2_41_65, 2_91_05, 5, 7_39, 3_26_44, 3_31_83, 1_13_03, 3_61_73, 88, 80, 6_50, 78_21, 4_59_40, 6, 52, 25_59, 5, 18_36, 9, 5, 73_97, 1_31_71, 31, 5, 18_36, 9, 3_26_44, 3_31_83, 1_13_03, 4, 2]
              ],
              'token_type_ids': [
                  [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                  [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                  [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
              ],
              'attention_mask': [
                  [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                  [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                  [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
              ]
          }
          # fmt: on

          a__:					str      							=     [
              'ALBERT: A Lite BERT for Self-supervised Learning of Language Representations',
              'ALBERT incorporates two parameter reduction techniques',
              'The first one is a factorized embedding parameterization. By decomposing the large vocabulary'
              ' embedding matrix into two small matrices, we separate the size of the hidden layers from the size of'
              ' vocabulary embedding.',
          ]

          self.assertDictEqual(encoding.data   ,      lowercase)

          for expected, decoded in zip(lowercase   ,      lowercase):
            self.assertEqual(lowercase   ,      lowercase)


