Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/brightmart/roberta_zh
/ functions
Functions
123 in github.com/brightmart/roberta_zh
⨍
Functions
123
◇
Types & classes
14
↓ 10 callers
Function
create_initializer
Creates a `truncated_normal_initializer` with the given range.
modeling.py:375
↓ 9 callers
Method
_read_tsv
Reads a tab separated value file.
run_classifier.py:195
↓ 9 callers
Function
get_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 callers
Method
_create_examples
Creates examples for the training and dev sets.
run_classifier.py:230
↓ 6 callers
Function
create_int_feature
(values)
create_pretraining_data.py:172
↓ 5 callers
Function
create_int_feature
(values)
run_classifier.py:365
↓ 4 callers
Function
convert_by_vocab
Converts a sequence of [tokens|ids] using the vocab.
tokenization.py:136
↓ 4 callers
Function
dropout
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 callers
Method
_create_examples
Creates examples for the training and dev sets.
run_classifier.py:716
↓ 3 callers
Function
convert_to_unicode
Converts `text` to Unicode (if it's not already), assuming utf-8 input.
tokenization.py:78
↓ 3 callers
Method
convert_tokens_to_ids
(self, tokens)
tokenization.py:180
↓ 3 callers
Function
file_based_convert_examples_to_features
Convert a set of `InputExample`s to a TFRecord file.
run_classifier.py:352
↓ 3 callers
Function
file_based_input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
run_classifier.py:382
↓ 3 callers
Function
layer_norm
Run layer normalization on the last dimension of the tensor.
modeling.py:362
↓ 3 callers
Function
reshape_to_matrix
Reshapes a >= rank 2 tensor to a rank 2 tensor (i.e., a matrix).
modeling.py:932
↓ 3 callers
Method
tokenize
(self, text)
tokenization.py:172
↓ 3 callers
Function
whitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
tokenization.py:154
↓ 2 callers
Function
convert_single_example
Converts a single `InputExample` into a single `InputFeatures`.
run_classifier.py:250
↓ 2 callers
Function
create_masked_lm_predictions
Creates the predictions for the masked LM objective.
create_pretraining_data.py:501
↓ 2 callers
Method
from_json_file
Constructs a `BertConfig` from a json file of parameters.
modeling.py:91
↓ 2 callers
Function
get_new_segment
输入一句话,返回一句经过处理的话: 为了支持中文全称mask,将被分开的词,将上特殊标记("#"),使得后续处理模块,能够知道哪些字是属于同一个词的。 :param segment: 一句话 :return: 一句处理过的话
create_pretraining_data.py:250
↓ 2 callers
Method
get_pooled_output
(self)
modeling.py:234
↓ 2 callers
Function
input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
run_pretraining.py:326
↓ 2 callers
Function
reshape_from_matrix
Reshapes a rank 2 tensor back to its original rank >= 2 tensor.
modeling.py:946
↓ 2 callers
Function
transpose_for_scores
(input_tensor, batch_size, num_attention_heads, seq_length, width)
modeling.py:629
↓ 1 callers
Method
__str__
(self)
create_pretraining_data.py:81
↓ 1 callers
Method
_clean_text
Performs invalid character removal and whitespace cleanup on text.
tokenization.py:288
↓ 1 callers
Function
_decode_record
Decodes a record to a TensorFlow example.
run_pretraining.py:393
↓ 1 callers
Function
_decode_record
Decodes a record to a TensorFlow example.
run_classifier.py:394
↓ 1 callers
Method
_do_use_weight_decay
Whether to use L2 weight decay for `param_name`.
optimization.py:188
↓ 1 callers
Method
_do_use_weight_decay
Whether to use L2 weight decay for `param_name`.
optimization_finetuning.py:159
↓ 1 callers
Method
_get_variable_name
Get the variable name from the tensor name.
optimization.py:198
↓ 1 callers
Method
_get_variable_name
Get the variable name from the tensor name.
optimization_finetuning.py:169
↓ 1 callers
Method
_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
tokenization.py:266
↓ 1 callers
Function
_is_control
Checks whether `chars` is a control character.
tokenization.py:376
↓ 1 callers
Function
_is_punctuation
Checks whether `chars` is a punctuation character.
tokenization.py:388
↓ 1 callers
Function
_is_whitespace
Checks whether `chars` is a whitespace character.
tokenization.py:364
↓ 1 callers
Method
_run_split_on_punc
Splits punctuation on a piece of text.
tokenization.py:233
↓ 1 callers
Method
_run_strip_accents
Strips accents from a piece of text.
tokenization.py:222
↓ 1 callers
Method
_tokenize_chinese_chars
Adds whitespace around any CJK character.
tokenization.py:253
↓ 1 callers
Function
_truncate_seq_pair
Truncates a sequence pair in place to the maximum length.
run_classifier.py:430
↓ 1 callers
Method
apply_gradients
See base class.
optimization.py:137
↓ 1 callers
Method
apply_gradients
See base class.
optimization_finetuning.py:108
↓ 1 callers
Function
assert_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 callers
Function
attention_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 callers
Function
create_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 callers
Function
create_float_feature
(values)
create_pretraining_data.py:177
↓ 1 callers
Function
create_instances_from_document
Creates `TrainingInstance`s for a single document.
create_pretraining_data.py:319
↓ 1 callers
Function
create_model
Creates a classification model.
run_classifier.py:447
↓ 1 callers
Function
create_training_instances
Create `TrainingInstance`s from raw text.
create_pretraining_data.py:182
↓ 1 callers
Function
embedding_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 callers
Function
embedding_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 callers
Method
from_dict
Constructs a `BertConfig` from a Python dictionary of parameters.
modeling.py:83
↓ 1 callers
Function
gather_indexes
Gathers the vectors at the specific positions over a minibatch.
run_pretraining.py:310
↓ 1 callers
Function
get_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 callers
Method
get_dev_examples
Gets a collection of `InputExample`s for the dev set.
run_classifier.py:182
↓ 1 callers
Method
get_embedding_table
(self)
modeling.py:260
↓ 1 callers
Method
get_labels
Gets the list of labels for this data set.
run_classifier.py:190
↓ 1 callers
Function
get_masked_lm_output
Get loss and log probs for the masked LM.
run_pretraining.py:243
↓ 1 callers
Function
get_next_sentence_output
Get loss and log probs for the next sentence prediction.
run_pretraining.py:287
↓ 1 callers
Function
get_raw_instance
获取初步的训练实例,将整段按照max_sequence_length切分成多个部分,并以多个处理好的实例的形式返回。 :param document: 一整段 :param max_sequence_length: :return: a list. each ele
create_pretraining_data.py:282
↓ 1 callers
Method
get_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 callers
Method
get_test_examples
Gets a collection of `InputExample`s for prediction.
run_classifier.py:186
↓ 1 callers
Method
get_train_examples
Gets a collection of `InputExample`s for the train set.
run_classifier.py:178
↓ 1 callers
Function
layer_norm_and_dropout
Runs layer normalization followed by dropout.
modeling.py:368
↓ 1 callers
Function
load_vocab
Loads a vocabulary file into a dictionary.
tokenization.py:121
↓ 1 callers
Function
model_fn_builder
Returns `model_fn` closure for TPUEstimator.
run_pretraining.py:109
↓ 1 callers
Function
model_fn_builder
Returns `model_fn` closure for TPUEstimator.
run_classifier.py:500
↓ 1 callers
Method
to_dict
Serializes this instance to a Python dictionary.
modeling.py:97
↓ 1 callers
Function
transformer_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 callers
Function
truncate_seq_pair
Truncates a pair of sequences to a maximum sequence length.
create_pretraining_data.py:579
↓ 1 callers
Function
write_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
Function
convert_examples_to_features
Convert a set of `InputExample`s to a list of `InputFeatures`.
run_classifier.py:737
Function
convert_ids_to_tokens
(inv_vocab, ids)
tokenization.py:150
Method
convert_ids_to_tokens
(self, ids)
tokenization.py:183
Function
convert_tokens_to_ids
(vocab, tokens)
tokenization.py:146
Function
create_instances_from_document_original
Creates `TrainingInstance`s for a single document.
create_pretraining_data.py:376
Function
create_optimizer
Creates an optimizer training op.
optimization.py:25
Function
create_optimizer
Creates an optimizer training op.
optimization_finetuning.py:25
Function
find_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
Function
gelu
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
Method
get_all_encoder_layers
(self)
modeling.py:246
Function
get_assignment_map_from_checkpoint
Compute the union of the current variables and checkpoint variables.
modeling.py:317
Method
get_dev_examples
See base class.
run_classifier.py:216
Method
get_dev_examples
See base class.
run_classifier.py:701
Method
get_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