





'''simple docstring'''






import unittest

from transformers import AlbertConfig, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
      import torch

      from transformers import (
          MODEL_FOR_PRETRAINING_MAPPING,
          AlbertForMaskedLM,
          AlbertForMultipleChoice,
          AlbertForPreTraining,
          AlbertForQuestionAnswering,
          AlbertForSequenceClassification,
          AlbertForTokenClassification,
          AlbertModel,
      )
      from transformers.models.albert.modeling_albert import ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST




class 					UpperCAmelCase	:




      def __init__(     self     :					Union[str, Any]     ,     __snake_case     :					Union[str, Any]     ,     __snake_case     :					Any=13     ,     __snake_case     :					Dict=7     ,     __snake_case     :					List[str]=True     ,     __snake_case     :					Optional[Any]=True     ,     __snake_case     :					str=True     ,     __snake_case     :					Dict=True     ,     __snake_case     :					Tuple=99     ,     __snake_case     :					Dict=16     ,     __snake_case     :					Union[str, Any]=36     ,     __snake_case     :					Optional[Any]=6     ,     __snake_case     :					Any=6     ,     __snake_case     :					int=6     ,     __snake_case     :					List[Any]=37     ,     __snake_case     :					Tuple="gelu"     ,     __snake_case     :					str=0.1     ,     __snake_case     :					Any=0.1     ,     __snake_case     :					Optional[Any]=5_12     ,     __snake_case     :					Dict=16     ,     __snake_case     :					Any=2     ,     __snake_case     :					Any=0.02     ,     __snake_case     :					Dict=3     ,     __snake_case     :					Union[str, Any]=4     ,     __snake_case     :					Union[str, Any]=None     ,     )							-> str:
            _lowerCAmelCase					=				parent
            _lowerCAmelCase					=				batch_size
            _lowerCAmelCase					=				seq_length
            _lowerCAmelCase					=				is_training
            _lowerCAmelCase					=				use_input_mask
            _lowerCAmelCase					=				use_token_type_ids
            _lowerCAmelCase					=				use_labels
            _lowerCAmelCase					=				vocab_size
            _lowerCAmelCase					=				embedding_size
            _lowerCAmelCase					=				hidden_size
            _lowerCAmelCase					=				num_hidden_layers
            _lowerCAmelCase					=				num_hidden_groups
            _lowerCAmelCase					=				num_attention_heads
            _lowerCAmelCase					=				intermediate_size
            _lowerCAmelCase					=				hidden_act
            _lowerCAmelCase					=				hidden_dropout_prob
            _lowerCAmelCase					=				attention_probs_dropout_prob
            _lowerCAmelCase					=				max_position_embeddings
            _lowerCAmelCase					=				type_vocab_size
            _lowerCAmelCase					=				type_sequence_label_size
            _lowerCAmelCase					=				initializer_range
            _lowerCAmelCase					=				num_labels
            _lowerCAmelCase					=				num_choices
            _lowerCAmelCase					=				scope




      def 							lowercase__       (     self     :					Dict    )							-> Any:
            _lowerCAmelCase					=				ids_tensor([self.batch_size, self.seq_length]     ,     self.vocab_size    )

            _lowerCAmelCase					=				None
            if self.use_input_mask:
                  _lowerCAmelCase					=				random_attention_mask([self.batch_size, self.seq_length]    )

            _lowerCAmelCase					=				None
            if self.use_token_type_ids:
                  _lowerCAmelCase					=				ids_tensor([self.batch_size, self.seq_length]     ,     self.type_vocab_size    )

            _lowerCAmelCase					=				None
            _lowerCAmelCase					=				None
            _lowerCAmelCase					=				None
            if self.use_labels:
                  _lowerCAmelCase					=				ids_tensor([self.batch_size]     ,     self.type_sequence_label_size    )
                  _lowerCAmelCase					=				ids_tensor([self.batch_size, self.seq_length]     ,     self.num_labels    )
                  _lowerCAmelCase					=				ids_tensor([self.batch_size]     ,     self.num_choices    )

            _lowerCAmelCase					=				self.get_config()

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




      def 							lowercase__       (     self     :					Dict    )							-> Optional[Any]:
            return AlbertConfig(
                vocab_size=self.vocab_size     ,     hidden_size=self.hidden_size     ,     num_hidden_layers=self.num_hidden_layers     ,     num_attention_heads=self.num_attention_heads     ,     intermediate_size=self.intermediate_size     ,     hidden_act=self.hidden_act     ,     hidden_dropout_prob=self.hidden_dropout_prob     ,     attention_probs_dropout_prob=self.attention_probs_dropout_prob     ,     max_position_embeddings=self.max_position_embeddings     ,     type_vocab_size=self.type_vocab_size     ,     initializer_range=self.initializer_range     ,     num_hidden_groups=self.num_hidden_groups     ,     )




      def 							lowercase__       (     self     :					Union[str, Any]     ,     __snake_case     :					int     ,     __snake_case     :					Tuple     ,     __snake_case     :					Union[str, Any]     ,     __snake_case     :					Optional[Any]     ,     __snake_case     :					str     ,     __snake_case     :					List[str]     ,     __snake_case     :					Dict    )							-> Dict:
            _lowerCAmelCase					=				AlbertModel(config=__snake_case    )
            model.to(__snake_case    )
            model.eval()
            _lowerCAmelCase					=				model(__snake_case     ,     attention_mask=__snake_case     ,     token_type_ids=__snake_case    )
            _lowerCAmelCase					=				model(__snake_case     ,     token_type_ids=__snake_case    )
            _lowerCAmelCase					=				model(__snake_case    )
            self.parent.assertEqual(result.last_hidden_state.shape     ,     (self.batch_size, self.seq_length, self.hidden_size)    )
            self.parent.assertEqual(result.pooler_output.shape     ,     (self.batch_size, self.hidden_size)    )




      def 							lowercase__       (     self     :					List[Any]     ,     __snake_case     :					Any     ,     __snake_case     :					List[Any]     ,     __snake_case     :					Any     ,     __snake_case     :					Dict     ,     __snake_case     :					Union[str, Any]     ,     __snake_case     :					List[Any]     ,     __snake_case     :					Optional[Any]    )							-> Optional[Any]:
            _lowerCAmelCase					=				AlbertForPreTraining(config=__snake_case    )
            model.to(__snake_case    )
            model.eval()
            _lowerCAmelCase					=				model(
                __snake_case     ,     attention_mask=__snake_case     ,     token_type_ids=__snake_case     ,     labels=__snake_case     ,     sentence_order_label=__snake_case     ,     )
            self.parent.assertEqual(result.prediction_logits.shape     ,     (self.batch_size, self.seq_length, self.vocab_size)    )
            self.parent.assertEqual(result.sop_logits.shape     ,     (self.batch_size, config.num_labels)    )




      def 							lowercase__       (     self     :					int     ,     __snake_case     :					int     ,     __snake_case     :					Union[str, Any]     ,     __snake_case     :					Any     ,     __snake_case     :					Union[str, Any]     ,     __snake_case     :					Any     ,     __snake_case     :					str     ,     __snake_case     :					List[Any]    )							-> str:
            _lowerCAmelCase					=				AlbertForMaskedLM(config=__snake_case    )
            model.to(__snake_case    )
            model.eval()
            _lowerCAmelCase					=				model(__snake_case     ,     attention_mask=__snake_case     ,     token_type_ids=__snake_case     ,     labels=__snake_case    )
            self.parent.assertEqual(result.logits.shape     ,     (self.batch_size, self.seq_length, self.vocab_size)    )




      def 							lowercase__       (     self     :					Union[str, Any]     ,     __snake_case     :					List[str]     ,     __snake_case     :					int     ,     __snake_case     :					Any     ,     __snake_case     :					List[str]     ,     __snake_case     :					Tuple     ,     __snake_case     :					List[Any]     ,     __snake_case     :					Tuple    )							-> Tuple:
            _lowerCAmelCase					=				AlbertForQuestionAnswering(config=__snake_case    )
            model.to(__snake_case    )
            model.eval()
            _lowerCAmelCase					=				model(
                __snake_case     ,     attention_mask=__snake_case     ,     token_type_ids=__snake_case     ,     start_positions=__snake_case     ,     end_positions=__snake_case     ,     )
            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 							lowercase__       (     self     :					Tuple     ,     __snake_case     :					Tuple     ,     __snake_case     :					Tuple     ,     __snake_case     :					int     ,     __snake_case     :					Any     ,     __snake_case     :					Union[str, Any]     ,     __snake_case     :					Union[str, Any]     ,     __snake_case     :					Optional[int]    )							-> Tuple:
            _lowerCAmelCase					=				self.num_labels
            _lowerCAmelCase					=				AlbertForSequenceClassification(__snake_case    )
            model.to(__snake_case    )
            model.eval()
            _lowerCAmelCase					=				model(__snake_case     ,     attention_mask=__snake_case     ,     token_type_ids=__snake_case     ,     labels=__snake_case    )
            self.parent.assertEqual(result.logits.shape     ,     (self.batch_size, self.num_labels)    )




      def 							lowercase__       (     self     :					Optional[Any]     ,     __snake_case     :					Optional[Any]     ,     __snake_case     :					List[str]     ,     __snake_case     :					Union[str, Any]     ,     __snake_case     :					Union[str, Any]     ,     __snake_case     :					Any     ,     __snake_case     :					Dict     ,     __snake_case     :					Optional[int]    )							-> List[Any]:
            _lowerCAmelCase					=				self.num_labels
            _lowerCAmelCase					=				AlbertForTokenClassification(config=__snake_case    )
            model.to(__snake_case    )
            model.eval()
            _lowerCAmelCase					=				model(__snake_case     ,     attention_mask=__snake_case     ,     token_type_ids=__snake_case     ,     labels=__snake_case    )
            self.parent.assertEqual(result.logits.shape     ,     (self.batch_size, self.seq_length, self.num_labels)    )




      def 							lowercase__       (     self     :					List[str]     ,     __snake_case     :					Optional[int]     ,     __snake_case     :					str     ,     __snake_case     :					Optional[Any]     ,     __snake_case     :					Optional[Any]     ,     __snake_case     :					List[str]     ,     __snake_case     :					Any     ,     __snake_case     :					Dict    )							-> int:
            _lowerCAmelCase					=				self.num_choices
            _lowerCAmelCase					=				AlbertForMultipleChoice(config=__snake_case    )
            model.to(__snake_case    )
            model.eval()
            _lowerCAmelCase					=				input_ids.unsqueeze(1    ).expand(-1     ,     self.num_choices     ,     -1    ).contiguous()
            _lowerCAmelCase					=				token_type_ids.unsqueeze(1    ).expand(-1     ,     self.num_choices     ,     -1    ).contiguous()
            _lowerCAmelCase					=				input_mask.unsqueeze(1    ).expand(-1     ,     self.num_choices     ,     -1    ).contiguous()
            _lowerCAmelCase					=				model(
                __snake_case     ,     attention_mask=__snake_case     ,     token_type_ids=__snake_case     ,     labels=__snake_case     ,     )
            self.parent.assertEqual(result.logits.shape     ,     (self.batch_size, self.num_choices)    )




      def 							lowercase__       (     self     :					int    )							-> Dict:
            _lowerCAmelCase					=				self.prepare_config_and_inputs()
            (
                (
                _lowerCAmelCase
            )	,				(
                _lowerCAmelCase
            )	,				(
                _lowerCAmelCase
            )	,				(
                _lowerCAmelCase
            )	,				(
                _lowerCAmelCase
            )	,				(
                _lowerCAmelCase
            )	,				(
                _lowerCAmelCase
            )	,				
            )					=				config_and_inputs
            _lowerCAmelCase					=				{"""input_ids""": input_ids, """token_type_ids""": token_type_ids, """attention_mask""": input_mask}
            return config, inputs_dict




@require_torch
class 					UpperCAmelCase	(     snake_case_				,						snake_case_				,						unittest.TestCase  ):
      _lowercase:     Union[str, Any]			=  (
          (
              AlbertModel,
              AlbertForPreTraining,
              AlbertForMaskedLM,
              AlbertForMultipleChoice,
              AlbertForSequenceClassification,
              AlbertForTokenClassification,
              AlbertForQuestionAnswering,
          )
          if is_torch_available()
          else ()
      )
      _lowercase:     List[Any]			=  (
          {
              '''feature-extraction''': AlbertModel,
              '''fill-mask''': AlbertForMaskedLM,
              '''question-answering''': AlbertForQuestionAnswering,
              '''text-classification''': AlbertForSequenceClassification,
              '''token-classification''': AlbertForTokenClassification,
              '''zero-shot''': AlbertForSequenceClassification,
          }
          if is_torch_available()
          else {}
      )
      _lowercase:     List[Any]			=  True




      def 							lowercase__       (     self     :					Optional[int]     ,     __snake_case     :					Optional[int]     ,     __snake_case     :					Union[str, Any]     ,     __snake_case     :					Any=False    )							-> Any:
            _lowerCAmelCase					=				super()._prepare_for_class(__snake_case     ,     __snake_case     ,     return_labels=__snake_case    )

            if return_labels:
                  if model_class in get_values(__snake_case    ):
                        _lowerCAmelCase					=				torch.zeros(
                            (self.model_tester.batch_size, self.model_tester.seq_length)     ,     dtype=torch.long     ,     device=__snake_case    )
                        _lowerCAmelCase					=				torch.zeros(
                            self.model_tester.batch_size     ,     dtype=torch.long     ,     device=__snake_case    )
            return inputs_dict




      def 							lowercase__       (     self     :					Optional[int]    )							-> Dict:
            _lowerCAmelCase					=				AlbertModelTester(self    )
            _lowerCAmelCase					=				ConfigTester(self     ,     config_class=__snake_case     ,     hidden_size=37    )




      def 							lowercase__       (     self     :					str    )							-> Optional[Any]:
            self.config_tester.run_common_tests()




      def 							lowercase__       (     self     :					Any    )							-> Any:
            _lowerCAmelCase					=				self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_model(*__snake_case    )




      def 							lowercase__       (     self     :					Any    )							-> int:
            _lowerCAmelCase					=				self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_for_pretraining(*__snake_case    )




      def 							lowercase__       (     self     :					Optional[Any]    )							-> Union[str, Any]:
            _lowerCAmelCase					=				self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_for_masked_lm(*__snake_case    )




      def 							lowercase__       (     self     :					str    )							-> str:
            _lowerCAmelCase					=				self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_for_multiple_choice(*__snake_case    )




      def 							lowercase__       (     self     :					Any    )							-> int:
            _lowerCAmelCase					=				self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_for_question_answering(*__snake_case    )




      def 							lowercase__       (     self     :					List[Any]    )							-> List[Any]:
            _lowerCAmelCase					=				self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_for_sequence_classification(*__snake_case    )




      def 							lowercase__       (     self     :					int    )							-> Optional[Any]:
            _lowerCAmelCase					=				self.model_tester.prepare_config_and_inputs()
            for type in ["absolute", "relative_key", "relative_key_query"]:
                  _lowerCAmelCase					=				type
                  self.model_tester.create_and_check_model(*__snake_case    )




      @slow
      def 							lowercase__       (     self     :					Any    )							-> str:
            for model_name in ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                  _lowerCAmelCase					=				AlbertModel.from_pretrained(__snake_case    )
                  self.assertIsNotNone(__snake_case    )




@require_torch
class 					UpperCAmelCase	(     unittest.TestCase  ):




      @slow
      def 							lowercase__       (     self     :					Union[str, Any]    )							-> Optional[Any]:
            _lowerCAmelCase					=				AlbertModel.from_pretrained("""albert-base-v2"""    )
            _lowerCAmelCase					=				torch.tensor([[0, 3_45, 2_32, 3_28, 7_40, 1_40, 16_95, 69, 60_78, 15_88, 2]]    )
            _lowerCAmelCase					=				torch.tensor([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]    )
            with torch.no_grad():
                  _lowerCAmelCase					=				model(__snake_case     ,     attention_mask=__snake_case    )[0]
            _lowerCAmelCase					=				torch.Size((1, 11, 7_68)    )
            self.assertEqual(output.shape     ,     __snake_case    )
            _lowerCAmelCase					=				torch.tensor(
                [[[-0.65_13, 1.50_35, -0.27_66], [-0.65_15, 1.50_46, -0.27_80], [-0.65_12, 1.50_49, -0.27_84]]]    )

            self.assertTrue(torch.allclose(output[:, 1:4, 1:4]     ,     __snake_case     ,     atol=1E-4    )    )













'''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 					UpperCAmelCase	(     snake_case_				,						unittest.TestCase  ):
      _lowercase:     List[str]			=  DebertaTokenizer
      _lowercase:     Union[str, Any]			=  True
      _lowercase:     Union[str, Any]			=  DebertaTokenizerFast




      def 							lowercase__       (     self     :					Any    )							-> List[Any]:
            super().setUp()

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

            _lowerCAmelCase					=				os.path.join(self.tmpdirname     ,     VOCAB_FILES_NAMES["""vocab_file"""]    )
            _lowerCAmelCase					=				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(__snake_case    ) + """\n"""    )
            with open(self.merges_file     ,     """w"""     ,     encoding="""utf-8"""    ) as fp:
                  fp.write("""\n""".join(__snake_case    )    )




      def 							lowercase__       (     self     :					List[str]     ,     **__snake_case     :					Any    )							-> Dict:
            kwargs.update(self.special_tokens_map    )
            return self.tokenizer_class.from_pretrained(self.tmpdirname     ,     **__snake_case    )




      def 							lowercase__       (     self     :					Dict     ,     __snake_case     :					Dict    )							-> Optional[Any]:
            _lowerCAmelCase					=				"""lower newer"""
            _lowerCAmelCase					=				"""lower newer"""
            return input_text, output_text




      def 							lowercase__       (     self     :					Union[str, Any]    )							-> List[str]:
            _lowerCAmelCase					=				self.get_tokenizer()
            _lowerCAmelCase					=				"""lower newer"""
            _lowerCAmelCase					=				["""l""", """o""", """w""", """er""", """\u0120""", """n""", """e""", """w""", """er"""]
            _lowerCAmelCase					=				tokenizer.tokenize(__snake_case    )
            self.assertListEqual(__snake_case     ,     __snake_case    )

            _lowerCAmelCase					=				tokens + [tokenizer.unk_token]
            _lowerCAmelCase					=				[0, 1, 2, 15, 10, 9, 3, 2, 15, 19]
            self.assertListEqual(tokenizer.convert_tokens_to_ids(__snake_case    )     ,     __snake_case    )




      def 							lowercase__       (     self     :					Union[str, Any]    )							-> Tuple:
            _lowerCAmelCase					=				self.get_tokenizer()
            _lowerCAmelCase					=				tokenizer("""Hello"""     ,     """World"""    )
            _lowerCAmelCase					=				[0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1]
            self.assertListEqual(tokd["""token_type_ids"""]     ,     __snake_case    )




      @slow
      def 							lowercase__       (     self     :					int    )							-> Union[str, Any]:
            _lowerCAmelCase					=				self.tokenizer_class.from_pretrained("""microsoft/deberta-base"""    )

            _lowerCAmelCase					=				tokenizer.encode("""sequence builders"""     ,     add_special_tokens=__snake_case    )
            _lowerCAmelCase					=				tokenizer.encode("""multi-sequence build"""     ,     add_special_tokens=__snake_case    )

            _lowerCAmelCase					=				tokenizer.encode(
                """sequence builders"""     ,     add_special_tokens=__snake_case     ,     add_prefix_space=__snake_case    )
            _lowerCAmelCase					=				tokenizer.encode(
                """sequence builders"""     ,     """multi-sequence build"""     ,     add_special_tokens=__snake_case     ,     add_prefix_space=__snake_case    )

            _lowerCAmelCase					=				tokenizer.build_inputs_with_special_tokens(__snake_case    )
            _lowerCAmelCase					=				tokenizer.build_inputs_with_special_tokens(__snake_case     ,     __snake_case    )

            assert encoded_sentence == encoded_text_from_decode
            assert encoded_pair == encoded_pair_from_decode




      @slow
      def 							lowercase__       (     self     :					Any    )							-> str:
            _lowerCAmelCase					=				[self.tokenizer_class]
            if self.test_rust_tokenizer:
                  tokenizer_classes.append(self.rust_tokenizer_class    )

            for tokenizer_class in tokenizer_classes:
                  _lowerCAmelCase					=				tokenizer_class.from_pretrained("""microsoft/deberta-base"""    )

                  _lowerCAmelCase					=				[
                      """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.""",
                  ]

                  _lowerCAmelCase					=				tokenizer(__snake_case     ,     padding=__snake_case    )
                  _lowerCAmelCase					=				[tokenizer.decode(__snake_case     ,     skip_special_tokens=__snake_case    ) for seq in encoding["""input_ids"""]]

                  # fmt: off
                  _lowerCAmelCase					=				{
                      """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

                  _lowerCAmelCase					=				[
                      """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     ,     __snake_case    )

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






