MCPcopy Create free account

hub / github.com/Morizeyao/GPT2-Chinese / functions

Functions76 in github.com/Morizeyao/GPT2-Chinese

↓ 12 callersMethodconvert_tokens_to_ids
(self, tokens)
tokenizations/bpe_tokenizer.py:91
↓ 6 callersMethodtokenize
(self, text)
tokenizations/bpe_tokenizer.py:86
↓ 5 callersMethodfrom_pretrained
Instantiate a BertTokenizer from pre-trained vocabulary files.
tokenizations/tokenization_bert.py:185
↓ 3 callersMethodtokenize
Basic Tokenization of a piece of text. Split on "white spaces" only, for sub-word tokenization, see WordPieceTokenizer. Args:
tokenizations/tokenization_bert_word_level.py:229
↓ 3 callersMethodtokenize
Basic Tokenization of a piece of text. Split on "white spaces" only, for sub-word tokenization, see WordPieceTokenizer. Args:
tokenizations/tokenization_bert.py:226
↓ 3 callersFunctionwhitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
tokenizations/tokenization_bert_word_level.py:80
↓ 3 callersFunctionwhitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
tokenizations/tokenization_bert.py:77
↓ 2 callersFunctionget_pairs
(word)
tokenizations/bpe_tokenizer.py:22
↓ 2 callersFunctionis_word
(word)
generate.py:9
↓ 2 callersFunctionis_word
(word)
generate_texts.py:11
↓ 2 callersFunctiontop_k_top_p_filtering
Filter a distribution of logits using top-k and/or nucleus (top-p) filtering Args: logits: logits distribution shape (vocabulary
generate.py:40
↓ 1 callersMethod_clean_text
Performs invalid character removal and whitespace cleanup on text.
tokenizations/tokenization_bert_word_level.py:342
↓ 1 callersMethod_clean_text
Performs invalid character removal and whitespace cleanup on text.
tokenizations/tokenization_bert.py:325
↓ 1 callersMethod_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
tokenizations/tokenization_bert.py:303
↓ 1 callersFunction_is_control
Checks whether `chars` is a control character.
tokenizations/tokenization_bert_word_level.py:428
↓ 1 callersFunction_is_control
Checks whether `chars` is a control character.
tokenizations/tokenization_bert.py:411
↓ 1 callersFunction_is_punctuation
Checks whether `chars` is a punctuation character.
tokenizations/tokenization_bert_word_level.py:440
↓ 1 callersFunction_is_punctuation
Checks whether `chars` is a punctuation character.
tokenizations/tokenization_bert.py:423
↓ 1 callersFunction_is_whitespace
Checks whether `chars` is a whitespace character.
tokenizations/tokenization_bert_word_level.py:416
↓ 1 callersFunction_is_whitespace
Checks whether `chars` is a whitespace character.
tokenizations/tokenization_bert.py:399
↓ 1 callersMethod_run_split_on_punc
Splits punctuation on a piece of text.
tokenizations/tokenization_bert_word_level.py:271
↓ 1 callersMethod_run_split_on_punc
Splits punctuation on a piece of text.
tokenizations/tokenization_bert.py:268
↓ 1 callersMethod_run_strip_accents
Strips accents from a piece of text.
tokenizations/tokenization_bert_word_level.py:260
↓ 1 callersMethod_run_strip_accents
Strips accents from a piece of text.
tokenizations/tokenization_bert.py:257
↓ 1 callersMethod_tokenize_chinese_chars
Adds whitespace around any CJK character.
tokenizations/tokenization_bert_word_level.py:305
↓ 1 callersMethod_tokenize_chinese_chars
Adds whitespace around any CJK character.
tokenizations/tokenization_bert.py:290
↓ 1 callersMethodbpe
(self, token)
tokenizations/bpe_tokenizer.py:39
↓ 1 callersFunctionbuild_files
(data_path, tokenized_data_path, num_pieces, full_tokenizer, min_length)
eval.py:13
↓ 1 callersFunctionbuild_files
(data_path, tokenized_data_path, num_pieces, full_tokenizer, min_length)
train.py:15
↓ 1 callersFunctionbuild_files
(raw_data_path, tokenized_data_path, full_tokenizer, num_pieces)
train_single.py:17
↓ 1 callersFunctionfast_sample_sequence
(model, context, length, temperature=1.0, top_k=30, top_p=0.0, device='cpu')
generate.py:92
↓ 1 callersFunctiongenerate
(n_ctx, model, context, length, tokenizer, temperature=1, top_k=0, top_p=0.0, repitition_penalty=1.0, device='
generate.py:114
↓ 1 callersFunctionget_encoder
(encoder_file, bpe_file)
tokenizations/bpe_tokenizer.py:121
↓ 1 callersFunctionload_vocab
Loads a vocabulary file into a dictionary.
tokenizations/tokenization_bert_word_level.py:69
↓ 1 callersFunctionload_vocab
Loads a vocabulary file into a dictionary.
tokenizations/tokenization_bert.py:66
↓ 1 callersFunctionmain
()
eval.py:39
↓ 1 callersFunctionmain
()
train.py:41
↓ 1 callersFunctionmain
()
generate.py:124
↓ 1 callersFunctionmain
()
train_single.py:38
↓ 1 callersFunctionmain
()
generate_texts.py:94
↓ 1 callersFunctionmain
()
cache/make_vocab.py:9
↓ 1 callersFunctionsample_sequence
(model, context, length, n_ctx, tokenizer, temperature=1.0, top_k=30, top_p=0.0, repitition_penalty=1.0,
generate.py:71
↓ 1 callersFunctionsample_sequence
(model, context, length, n_ctx, tokenizer, temperature=1.0, top_k=30, top_p=0.0, repitition_penalty=1.0,
generate_texts.py:73
↓ 1 callersFunctiontop_k_top_p_filtering
Filter a distribution of logits using top-k and/or nucleus (top-p) filtering Args: logits: logits distribution shape (vocabulary
generate_texts.py:42
Method__init__
Constructs a BertTokenizer. Args: **vocab_file**: Path to a one-wordpiece-per-line vocabulary file **do_lower_case**:
tokenizations/tokenization_bert_word_level.py:108
Method__init__
Constructs a BasicTokenizer. Args: **do_lower_case**: Whether to lower case the input. **never_split**: (`optional`)
tokenizations/tokenization_bert_word_level.py:209
Method__init__
(self, vocab, unk_token, max_input_chars_per_word=100)
tokenizations/tokenization_bert_word_level.py:359
Method__init__
Constructs a BertTokenizer. Args: **vocab_file**: Path to a one-wordpiece-per-line vocabulary file **do_lower_case**:
tokenizations/tokenization_bert.py:105
Method__init__
Constructs a BasicTokenizer. Args: **do_lower_case**: Whether to lower case the input. **never_split**: (`optional`)
tokenizations/tokenization_bert.py:206
Method__init__
(self, vocab, unk_token, max_input_chars_per_word=100)
tokenizations/tokenization_bert.py:342
Method__init__
(self, encoder, bpe_merges)
tokenizations/bpe_tokenizer.py:32
Method__init__
(self, model_path)
tokenizations/bpe_tokenizer.py:95
Method_convert_id_to_token
Converts an index (integer) in a token (string/unicode) using the vocab.
tokenizations/tokenization_bert_word_level.py:163
Method_convert_id_to_token
Converts an index (integer) in a token (string/unicode) using the vocab.
tokenizations/tokenization_bert.py:160
Method_convert_token_to_id
Converts a token (str/unicode) in an id using the vocab.
tokenizations/tokenization_bert_word_level.py:159
Method_convert_token_to_id
Converts a token (str/unicode) in an id using the vocab.
tokenizations/tokenization_bert.py:156
Function_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
generate.py:16
Function_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
generate_texts.py:18
Method_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
tokenizations/tokenization_bert_word_level.py:320
Method_tokenize
(self, text)
tokenizations/tokenization_bert_word_level.py:149
Method_tokenize
(self, text)
tokenizations/tokenization_bert.py:146
Methodconvert_tokens_to_ids
(self, tokens)
tokenizations/bpe_tokenizer.py:118
Methodconvert_tokens_to_string
Converts a sequence of tokens (string) in a single string.
tokenizations/tokenization_bert_word_level.py:167
Methodconvert_tokens_to_string
Converts a sequence of tokens (string) in a single string.
tokenizations/tokenization_bert.py:164
Methoddecode
(self, tokens)
tokenizations/bpe_tokenizer.py:82
Methoddecode
tokens=[x1,x2,...]
tokenizations/bpe_tokenizer.py:107
Methodencode
(self, text)
tokenizations/bpe_tokenizer.py:79
Methodencode
text="...."
tokenizations/bpe_tokenizer.py:100
Methodfrom_pretrained
Instantiate a BertTokenizer from pre-trained vocabulary files.
tokenizations/tokenization_bert_word_level.py:188
Methodsave_vocabulary
Save the tokenizer vocabulary to a directory or file.
tokenizations/tokenization_bert_word_level.py:172
Methodsave_vocabulary
Save the tokenizer vocabulary to a directory or file.
tokenizations/tokenization_bert.py:169
Methodtokenize
Tokenizes a piece of text into its word pieces. This uses a greedy longest-match-first algorithm to perform tokenization using the gi
tokenizations/tokenization_bert_word_level.py:364
Methodtokenize
Tokenizes a piece of text into its word pieces. This uses a greedy longest-match-first algorithm to perform tokenization using the gi
tokenizations/tokenization_bert.py:347
Methodtokenize
(self, text)
tokenizations/bpe_tokenizer.py:115
Methodvocab_size
(self)
tokenizations/tokenization_bert_word_level.py:146
Methodvocab_size
(self)
tokenizations/tokenization_bert.py:143