


from __future__ import annotations

from typing import Dict

from ...configuration_utils import PretrainedConfig


UpperCamelCase					:       str			    =     {
    """susnato/ernie-m-base_pytorch""": """https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json""",
    """susnato/ernie-m-large_pytorch""": """https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json""",
}



class A__     ( A__  ):



  """simple docstring"""



  _lowercase									=		'ernie_m'
  _lowercase									=		{"dropout": "classifier_dropout", "num_classes": "num_labels"}

  def __init__( self			:  Tuple				,				lowerCamelCase__			:  int = 250_002				,				lowerCamelCase__			:  int = 768				,				lowerCamelCase__			:  int = 12				,				lowerCamelCase__			:  int = 12				,				lowerCamelCase__			:  int = 3_072				,				lowerCamelCase__			:  str = "gelu"				,				lowerCamelCase__			:  float = 0.1				,				lowerCamelCase__			:  float = 0.1				,				lowerCamelCase__			:  int = 514				,				lowerCamelCase__			:  float = 0.02				,				lowerCamelCase__			:  int = 1				,				lowerCamelCase__			:  float = 1E-05				,				lowerCamelCase__			:  Dict=None				,				lowerCamelCase__			:  List[Any]=False				,				lowerCamelCase__			:  List[Any]=0.0				,				**lowerCamelCase__			:  Any				,				):
        super().__init__(pad_token_id=lowerCamelCase__				,				**lowerCamelCase__       )
        a__	:  Any     =   vocab_size
        a__	:  str     =   hidden_size
        a__	:  Optional[Any]     =   num_hidden_layers
        a__	:  Any     =   num_attention_heads
        a__	:  Optional[int]     =   intermediate_size
        a__	:  int     =   hidden_act
        a__	:  str     =   hidden_dropout_prob
        a__	:  List[Any]     =   attention_probs_dropout_prob
        a__	:  Tuple     =   max_position_embeddings
        a__	:  Dict     =   initializer_range
        a__	:  Tuple     =   layer_norm_eps
        a__	:  Union[str, Any]     =   classifier_dropout
        a__	:  Any     =   is_decoder
        a__	:  Any     =   act_dropout








"""simple docstring"""





class 						lowercase   :





      def __init__(			self					)						->	Any:
            lowerCAmelCase    		=			""""""
            lowerCAmelCase    		=			""""""
            lowerCAmelCase    		=			[]





      def        _snake_case     (			self ,		lowercase ,		lowercase					)						->	int:
            if m == -1:
                  return n + 1
            elif n == -1:
                  return m + 1
            elif self.dp[m][n] > -1:
                  return self.dp[m][n]
            else:
                  if self.worda[m] == self.worda[n]:
                        lowerCAmelCase    		=			self.__min_dist_top_down_dp(m - 1 ,		n - 1					)
                  else:
                        lowerCAmelCase    		=			self.__min_dist_top_down_dp(lowercase ,		n - 1					)
                        lowerCAmelCase    		=			self.__min_dist_top_down_dp(m - 1 ,		lowercase					)
                        lowerCAmelCase    		=			self.__min_dist_top_down_dp(m - 1 ,		n - 1					)
                        lowerCAmelCase    		=			1 + min(lowercase ,		lowercase ,		lowercase					)

                  return self.dp[m][n]





      def        _snake_case     (			self ,		lowercase ,		lowercase					)						->	int:
            lowerCAmelCase    		=			worda
            lowerCAmelCase    		=			worda
            lowerCAmelCase    		=			[[-1 for _ in range(len(lowercase					)					)] for _ in range(len(lowercase					)					)]

            return self.__min_dist_top_down_dp(len(lowercase					) - 1 ,		len(lowercase					) - 1					)





      def        _snake_case     (			self ,		lowercase ,		lowercase					)						->	int:
            lowerCAmelCase    		=			worda
            lowerCAmelCase    		=			worda
            lowerCAmelCase    		=			len(lowercase					)
            lowerCAmelCase    		=			len(lowercase					)
            lowerCAmelCase    		=			[[0 for _ in range(n + 1					)] for _ in range(m + 1					)]

            for i in range(m + 1					):
                  for j in range(n + 1					):
                        if i == 0:  # first string is empty
                              lowerCAmelCase    		=			j
                        elif j == 0:  # second string is empty
                              lowerCAmelCase    		=			i
                        elif worda[i - 1] == worda[j - 1]:  # last characters are equal
                              lowerCAmelCase    		=			self.dp[i - 1][j - 1]
                        else:
                              lowerCAmelCase    		=			self.dp[i][j - 1]
                              lowerCAmelCase    		=			self.dp[i - 1][j]
                              lowerCAmelCase    		=			self.dp[i - 1][j - 1]
                              lowerCAmelCase    		=			1 + min(lowercase ,		lowercase ,		lowercase					)
            return self.dp[m][n]


if __name__ == "__main__":
       SCREAMING_SNAKE_CASE__   =  EditDistance()

       print("****************** Testing Edit Distance DP Algorithm ******************")
       print()

       SCREAMING_SNAKE_CASE__   =  input("Enter the first string: ").strip()
       SCREAMING_SNAKE_CASE__   =  input("Enter the second string: ").strip()

       print()
       print(f'The minimum edit distance is: {solver.min_dist_top_down(Sa, Sa)}')
       print(f'The minimum edit distance is: {solver.min_dist_bottom_up(Sa, Sa)}')
       print()
       print("*************** End of Testing Edit Distance DP Algorithm ***************")






