MCPcopy Create free account

hub / github.com/brightmart/roberta_zh / functions

Functions123 in github.com/brightmart/roberta_zh

↓ 10 callersFunctioncreate_initializer
Creates a `truncated_normal_initializer` with the given range.
modeling.py:375
↓ 9 callersMethod_read_tsv
Reads a tab separated value file.
run_classifier.py:195
↓ 9 callersFunctionget_shape_list
Returns a list of the shape of tensor, preferring static dimensions. Args: tensor: A tf.Tensor object to find the shape of. expected_rank:
modeling.py:895
↓ 6 callersMethod_create_examples
Creates examples for the training and dev sets.
run_classifier.py:230
↓ 6 callersFunctioncreate_int_feature
(values)
create_pretraining_data.py:172
↓ 5 callersFunctioncreate_int_feature
(values)
run_classifier.py:365
↓ 4 callersFunctionconvert_by_vocab
Converts a sequence of [tokens|ids] using the vocab.
tokenization.py:136
↓ 4 callersFunctiondropout
Perform dropout. Args: input_tensor: float Tensor. dropout_prob: Python float. The probability of dropping out a value (NOT of *keepi
modeling.py:344
↓ 3 callersMethod_create_examples
Creates examples for the training and dev sets.
run_classifier.py:716
↓ 3 callersFunctionconvert_to_unicode
Converts `text` to Unicode (if it's not already), assuming utf-8 input.
tokenization.py:78
↓ 3 callersMethodconvert_tokens_to_ids
(self, tokens)
tokenization.py:180
↓ 3 callersFunctionfile_based_convert_examples_to_features
Convert a set of `InputExample`s to a TFRecord file.
run_classifier.py:352
↓ 3 callersFunctionfile_based_input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
run_classifier.py:382
↓ 3 callersFunctionlayer_norm
Run layer normalization on the last dimension of the tensor.
modeling.py:362
↓ 3 callersFunctionreshape_to_matrix
Reshapes a >= rank 2 tensor to a rank 2 tensor (i.e., a matrix).
modeling.py:932
↓ 3 callersMethodtokenize
(self, text)
tokenization.py:172
↓ 3 callersFunctionwhitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
tokenization.py:154
↓ 2 callersFunctionconvert_single_example
Converts a single `InputExample` into a single `InputFeatures`.
run_classifier.py:250
↓ 2 callersFunctioncreate_masked_lm_predictions
Creates the predictions for the masked LM objective.
create_pretraining_data.py:501
↓ 2 callersMethodfrom_json_file
Constructs a `BertConfig` from a json file of parameters.
modeling.py:91
↓ 2 callersFunctionget_new_segment
输入一句话,返回一句经过处理的话: 为了支持中文全称mask,将被分开的词,将上特殊标记("#"),使得后续处理模块,能够知道哪些字是属于同一个词的。 :param segment: 一句话 :return: 一句处理过的话
create_pretraining_data.py:250
↓ 2 callersMethodget_pooled_output
(self)
modeling.py:234
↓ 2 callersFunctioninput_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
run_pretraining.py:326
↓ 2 callersFunctionreshape_from_matrix
Reshapes a rank 2 tensor back to its original rank >= 2 tensor.
modeling.py:946
↓ 2 callersFunctiontranspose_for_scores
(input_tensor, batch_size, num_attention_heads, seq_length, width)
modeling.py:629
↓ 1 callersMethod__str__
(self)
create_pretraining_data.py:81
↓ 1 callersMethod_clean_text
Performs invalid character removal and whitespace cleanup on text.
tokenization.py:288
↓ 1 callersFunction_decode_record
Decodes a record to a TensorFlow example.
run_pretraining.py:393
↓ 1 callersFunction_decode_record
Decodes a record to a TensorFlow example.
run_classifier.py:394
↓ 1 callersMethod_do_use_weight_decay
Whether to use L2 weight decay for `param_name`.
optimization.py:188
↓ 1 callersMethod_do_use_weight_decay
Whether to use L2 weight decay for `param_name`.
optimization_finetuning.py:159
↓ 1 callersMethod_get_variable_name
Get the variable name from the tensor name.
optimization.py:198
↓ 1 callersMethod_get_variable_name
Get the variable name from the tensor name.
optimization_finetuning.py:169
↓ 1 callersMethod_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
tokenization.py:266
↓ 1 callersFunction_is_control
Checks whether `chars` is a control character.
tokenization.py:376
↓ 1 callersFunction_is_punctuation
Checks whether `chars` is a punctuation character.
tokenization.py:388
↓ 1 callersFunction_is_whitespace
Checks whether `chars` is a whitespace character.
tokenization.py:364
↓ 1 callersMethod_run_split_on_punc
Splits punctuation on a piece of text.
tokenization.py:233
↓ 1 callersMethod_run_strip_accents
Strips accents from a piece of text.
tokenization.py:222
↓ 1 callersMethod_tokenize_chinese_chars
Adds whitespace around any CJK character.
tokenization.py:253
↓ 1 callersFunction_truncate_seq_pair
Truncates a sequence pair in place to the maximum length.
run_classifier.py:430
↓ 1 callersMethodapply_gradients
See base class.
optimization.py:137
↓ 1 callersMethodapply_gradients
See base class.
optimization_finetuning.py:108
↓ 1 callersFunctionassert_rank
Raises an exception if the tensor rank is not of the expected rank. Args: tensor: A tf.Tensor to check the rank of. expected_rank: Python i
modeling.py:959
↓ 1 callersFunctionattention_layer
Performs multi-headed attention from `from_tensor` to `to_tensor`. This is an implementation of multi-headed attention based on "Attention is all
modeling.py:558
↓ 1 callersFunctioncreate_attention_mask_from_input_mask
Create 3D attention mask from a 2D tensor mask. Args: from_tensor: 2D or 3D Tensor of shape [batch_size, from_seq_length, ...]. to_mask: in
modeling.py:524
↓ 1 callersFunctioncreate_float_feature
(values)
create_pretraining_data.py:177
↓ 1 callersFunctioncreate_instances_from_document
Creates `TrainingInstance`s for a single document.
create_pretraining_data.py:319
↓ 1 callersFunctioncreate_model
Creates a classification model.
run_classifier.py:447
↓ 1 callersFunctioncreate_training_instances
Create `TrainingInstance`s from raw text.
create_pretraining_data.py:182
↓ 1 callersFunctionembedding_lookup
Looks up words embeddings for id tensor. Args: input_ids: int32 Tensor of shape [batch_size, seq_length] containing word ids. vocab_s
modeling.py:380
↓ 1 callersFunctionembedding_postprocessor
Performs various post-processing on a word embedding tensor. Args: input_tensor: float Tensor of shape [batch_size, seq_length, embedding
modeling.py:428
↓ 1 callersMethodfrom_dict
Constructs a `BertConfig` from a Python dictionary of parameters.
modeling.py:83
↓ 1 callersFunctiongather_indexes
Gathers the vectors at the specific positions over a minibatch.
run_pretraining.py:310
↓ 1 callersFunctionget_activation
Maps a string to a Python function, e.g., "relu" => `tf.nn.relu`. Args: activation_string: String name of the activation function. Returns:
modeling.py:280
↓ 1 callersMethodget_dev_examples
Gets a collection of `InputExample`s for the dev set.
run_classifier.py:182
↓ 1 callersMethodget_embedding_table
(self)
modeling.py:260
↓ 1 callersMethodget_labels
Gets the list of labels for this data set.
run_classifier.py:190
↓ 1 callersFunctionget_masked_lm_output
Get loss and log probs for the masked LM.
run_pretraining.py:243
↓ 1 callersFunctionget_next_sentence_output
Get loss and log probs for the next sentence prediction.
run_pretraining.py:287
↓ 1 callersFunctionget_raw_instance
获取初步的训练实例,将整段按照max_sequence_length切分成多个部分,并以多个处理好的实例的形式返回。 :param document: 一整段 :param max_sequence_length: :return: a list. each ele
create_pretraining_data.py:282
↓ 1 callersMethodget_sequence_output
Gets final hidden layer of encoder. Returns: float Tensor of shape [batch_size, seq_length, hidden_size] corresponding to the final h
modeling.py:237
↓ 1 callersMethodget_test_examples
Gets a collection of `InputExample`s for prediction.
run_classifier.py:186
↓ 1 callersMethodget_train_examples
Gets a collection of `InputExample`s for the train set.
run_classifier.py:178
↓ 1 callersFunctionlayer_norm_and_dropout
Runs layer normalization followed by dropout.
modeling.py:368
↓ 1 callersFunctionload_vocab
Loads a vocabulary file into a dictionary.
tokenization.py:121
↓ 1 callersFunctionmodel_fn_builder
Returns `model_fn` closure for TPUEstimator.
run_pretraining.py:109
↓ 1 callersFunctionmodel_fn_builder
Returns `model_fn` closure for TPUEstimator.
run_classifier.py:500
↓ 1 callersMethodto_dict
Serializes this instance to a Python dictionary.
modeling.py:97
↓ 1 callersFunctiontransformer_model
Multi-headed, multi-layer Transformer from "Attention is All You Need". This is almost an exact implementation of the original Transformer encoder.
modeling.py:754
↓ 1 callersFunctiontruncate_seq_pair
Truncates a pair of sequences to a maximum sequence length.
create_pretraining_data.py:579
↓ 1 callersFunctionwrite_instance_to_example_files
Create TF example files from `TrainingInstance`s.
create_pretraining_data.py:98
Method__init__
(self, tokens, segment_ids, masked_lm_positions, masked_lm_labels, is_random_next)
create_pretraining_data.py:73
Method__init__
(self, vocab_file, do_lower_case=True)
tokenization.py:166
Method__init__
Constructs a BasicTokenizer. Args: do_lower_case: Whether to lower case the input.
tokenization.py:190
Method__init__
(self, vocab, unk_token="[UNK]", max_input_chars_per_word=200)
tokenization.py:305
Method__init__
Constructs a InputExample. Args: guid: Unique id for the example. text_a: string. The untokenized text of the first sequence. For sing
run_classifier.py:131
Method__init__
(self, input_ids, input_mask, segment_ids, label_i
run_classifier.py:162
Method__init__
(self)
run_classifier.py:207
Method__init__
(self)
run_classifier.py:692
Method__init__
Constructs a AdamWeightDecayOptimizer.
optimization.py:119
Method__init__
Constructs a AdamWeightDecayOptimizer.
optimization_finetuning.py:90
Method__init__
Constructs BertConfig. Args: vocab_size: Vocabulary size of `inputs_ids` in `BertModel`. hidden_size: Size of the encoder layers and
modeling.py:34
Method__init__
Constructor for BertModel. Args: config: `BertConfig` instance. is_training: bool. true for training model, false for eval model. Con
modeling.py:131
Method__repr__
(self)
create_pretraining_data.py:94
Function_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
create_pretraining_data.py:229
Functionconvert_examples_to_features
Convert a set of `InputExample`s to a list of `InputFeatures`.
run_classifier.py:737
Functionconvert_ids_to_tokens
(inv_vocab, ids)
tokenization.py:150
Methodconvert_ids_to_tokens
(self, ids)
tokenization.py:183
Functionconvert_tokens_to_ids
(vocab, tokens)
tokenization.py:146
Functioncreate_instances_from_document_original
Creates `TrainingInstance`s for a single document.
create_pretraining_data.py:376
Functioncreate_optimizer
Creates an optimizer training op.
optimization.py:25
Functioncreate_optimizer
Creates an optimizer training op.
optimization_finetuning.py:25
Functionfind_train_variables
get trainable variables only to train from layer 9 to last layer :param tvars: a list :return: a new tvars, which is list
optimization.py:89
Functiongelu
Gaussian Error Linear Unit. This is a smoother version of the RELU. Original paper: https://arxiv.org/abs/1606.08415 Args: x: float Tensor
modeling.py:264
Methodget_all_encoder_layers
(self)
modeling.py:246
Functionget_assignment_map_from_checkpoint
Compute the union of the current variables and checkpoint variables.
modeling.py:317
Methodget_dev_examples
See base class.
run_classifier.py:216
Methodget_dev_examples
See base class.
run_classifier.py:701
Methodget_embedding_output
Gets output of the embedding lookup (i.e., input to the transformer). Returns: float Tensor of shape [batch_size, seq_length, hidden_size]
modeling.py:249
next →1–100 of 123, ranked by callers