import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_convbert import ConvBertTokenizer


__lowerCamelCase    :				Tuple							     =	logging.get_logger(__name__)

__lowerCamelCase    :				int							     =	{'''vocab_file''': '''vocab.txt'''}

__lowerCamelCase    :				str							     =	{
    '''vocab_file''': {
        '''YituTech/conv-bert-base''': '''https://huggingface.co/YituTech/conv-bert-base/resolve/main/vocab.txt''',
        '''YituTech/conv-bert-medium-small''': (
            '''https://huggingface.co/YituTech/conv-bert-medium-small/resolve/main/vocab.txt'''
        ),
        '''YituTech/conv-bert-small''': '''https://huggingface.co/YituTech/conv-bert-small/resolve/main/vocab.txt''',
    }
}

__lowerCamelCase    :				Tuple							     =	{
    '''YituTech/conv-bert-base''': 512,
    '''YituTech/conv-bert-medium-small''': 512,
    '''YituTech/conv-bert-small''': 512,
}


__lowerCamelCase    :				Optional[int]							     =	{
    '''YituTech/conv-bert-base''': {'''do_lower_case''': True},
    '''YituTech/conv-bert-medium-small''': {'''do_lower_case''': True},
    '''YituTech/conv-bert-small''': {'''do_lower_case''': True},
}







class __snake_case       (		lowerCamelCase_	):
   lowerCAmelCase_														=							VOCAB_FILES_NAMES
   lowerCAmelCase_														=							PRETRAINED_VOCAB_FILES_MAP
   lowerCAmelCase_														=							PRETRAINED_INIT_CONFIGURATION
   lowerCAmelCase_														=							PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
   lowerCAmelCase_														=							ConvBertTokenizer




   def __init__(					self    :       Union[str, Any] ,			_lowercase    :       Optional[int]=None ,			_lowercase    :       str=None ,			_lowercase    :       Union[str, Any]=True ,			_lowercase    :       Tuple="[UNK]" ,			_lowercase    :       int="[SEP]" ,			_lowercase    :       Optional[int]="[PAD]" ,			_lowercase    :       List[Any]="[CLS]" ,			_lowercase    :       Tuple="[MASK]" ,			_lowercase    :       List[Any]=True ,			_lowercase    :       Union[str, Any]=None ,			**_lowercase    :       Optional[int] ,			):



     """simple docstring"""






     super().__init__(
         _lowercase ,			tokenizer_file=_lowercase ,			do_lower_case=_lowercase ,			unk_token=_lowercase ,			sep_token=_lowercase ,			pad_token=_lowercase ,			cls_token=_lowercase ,			mask_token=_lowercase ,			tokenize_chinese_chars=_lowercase ,			strip_accents=_lowercase ,			**_lowercase ,			)

     SCREAMING_SNAKE_CASE__    							=   json.loads(self.backend_tokenizer.normalizer.__getstate__()   )
     if (
         normalizer_state.get("""lowercase""" ,			_lowercase   ) != do_lower_case
         or normalizer_state.get("""strip_accents""" ,			_lowercase   ) != strip_accents
         or normalizer_state.get("""handle_chinese_chars""" ,			_lowercase   ) != tokenize_chinese_chars
     ):
       SCREAMING_SNAKE_CASE__    							=   getattr(_lowercase ,			normalizer_state.pop("""type"""   )   )
       SCREAMING_SNAKE_CASE__    							=   do_lower_case
       SCREAMING_SNAKE_CASE__    							=   strip_accents
       SCREAMING_SNAKE_CASE__    							=   tokenize_chinese_chars
       SCREAMING_SNAKE_CASE__    							=   normalizer_class(**_lowercase   )

     SCREAMING_SNAKE_CASE__    							=   do_lower_case




   def 			__a		(					self    :       Union[str, Any] ,			_lowercase    :       List[Any] ,			_lowercase    :       List[str]=None   ):



     """simple docstring"""






     SCREAMING_SNAKE_CASE__    							=   [self.cls_token_id] + token_ids_a + [self.sep_token_id]

     if token_ids_a:
       output += token_ids_a + [self.sep_token_id]

     return output




   def 			__a		(					self    :       Optional[int] ,			_lowercase    :       List[int] ,			_lowercase    :       Optional[List[int]] = None   ):



     """simple docstring"""






     SCREAMING_SNAKE_CASE__    							=   [self.sep_token_id]
     SCREAMING_SNAKE_CASE__    							=   [self.cls_token_id]
     if token_ids_a is None:
       return len(cls + token_ids_a + sep   ) * [0]
     return len(cls + token_ids_a + sep   ) * [0] + len(token_ids_a + sep   ) * [1]




   def 			__a		(					self    :       List[str] ,			_lowercase    :       str ,			_lowercase    :       Optional[str] = None   ):



     """simple docstring"""






     SCREAMING_SNAKE_CASE__    							=   self._tokenizer.model.save(_lowercase ,			name=_lowercase   )
     return tuple(_lowercase   )

import copy
from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import ClassLabel, Features, Value
from .base import TaskTemplate







@dataclass(frozen=lowerCamelCase_	)
class __snake_case       (		lowerCamelCase_	):
   # `task` is not a ClassVar since we want it to be part of the `asdict` output for JSON serialization
   lowerCAmelCase_														=							field(default="text-classification"     ,	metadata={"include_in_asdict_even_if_is_default": True}	)
   lowerCAmelCase_														=							Features({"text": Value("string"	)}	)
   lowerCAmelCase_														=							Features({"labels": ClassLabel}	)
   lowerCAmelCase_														=							"text"
   lowerCAmelCase_														=							"labels"




   def 			__a		(					self    :       Dict ,			_lowercase    :       List[Any]   ):



     """simple docstring"""






     if self.label_column not in features:
       raise ValueError(f"""Column {self.label_column} is not present in features."""   )
     if not isinstance(features[self.label_column] ,			_lowercase   ):
       raise ValueError(f"""Column {self.label_column} is not a ClassLabel."""   )
     SCREAMING_SNAKE_CASE__    							=   copy.deepcopy(self   )
     SCREAMING_SNAKE_CASE__    							=   self.label_schema.copy()
     SCREAMING_SNAKE_CASE__    							=   features[self.label_column]
     SCREAMING_SNAKE_CASE__    							=   label_schema
     return task_template




   @property
   def 			__a		(					self    :       List[Any]   ):



     """simple docstring"""






     return {
         self.text_column: "text",
         self.label_column: "labels",
     }
