Constructs a BasicTokenizer. Args: **do_lower_case**: Whether to lower case the input. **never_split**: (`optional`) list of str Kept for backward compatibility purposes. Now implemented directly at the base class level (see :func:`Pr
(self, do_lower_case=True, never_split=None, tokenize_chinese_chars=True)
| 349 | """Runs basic tokenization (punctuation splitting, lower casing, etc.).""" |
| 350 | |
| 351 | def __init__(self, do_lower_case=True, never_split=None, tokenize_chinese_chars=True): |
| 352 | """ Constructs a BasicTokenizer. |
| 353 | |
| 354 | Args: |
| 355 | **do_lower_case**: Whether to lower case the input. |
| 356 | **never_split**: (`optional`) list of str |
| 357 | Kept for backward compatibility purposes. |
| 358 | Now implemented directly at the base class level (see :func:`PreTrainedTokenizer.tokenize`) |
| 359 | List of token not to split. |
| 360 | **tokenize_chinese_chars**: (`optional`) boolean (default True) |
| 361 | Whether to tokenize Chinese characters. |
| 362 | This should likely be deactivated for Japanese: |
| 363 | see: https://github.com/huggingface/pytorch-pretrained-BERT/issues/328 |
| 364 | """ |
| 365 | if never_split is None: |
| 366 | never_split = [] |
| 367 | self.do_lower_case = do_lower_case |
| 368 | self.never_split = set(never_split) |
| 369 | self.tokenize_chinese_chars = tokenize_chinese_chars |
| 370 | |
| 371 | def tokenize(self, text, never_split=None): |
| 372 | """ Basic Tokenization of a piece of text. |
nothing calls this directly
no outgoing calls
no test coverage detected