MCPcopy Create free account

hub / github.com/ProHiryu/albert-chinese-ner / functions

Functions141 in github.com/ProHiryu/albert-chinese-ner

↓ 15 callersFunctioncreate_initializer
Creates a `truncated_normal_initializer` with the given range.
modeling.py:397
↓ 10 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:981
↓ 6 callersFunctioncreate_int_feature
(values)
create_pretraining_data.py:172
↓ 6 callersFunctiondropout
Perform dropout. Args: input_tensor: float Tensor. dropout_prob: Python float. The probability of dropping out a value (NOT of *keepi
modeling.py:366
↓ 6 callersFunctionmetrics_from_confusion_matrix
Precision, Recall and F1 from the confusion matrix Parameters ---------- cm : tf.Tensor of type tf.int32, of shape (num_classes, num_cl
tf_metrics.py:168
↓ 6 callersFunctionsafe_div
Safe division, return 0 if denominator is 0
tf_metrics.py:137
↓ 5 callersFunctionlayer_norm
Run layer normalization on the last dimension of the tensor.
modeling.py:384
↓ 4 callersFunctionconvert_by_vocab
Converts a sequence of [tokens|ids] using the vocab.
tokenization.py:136
↓ 4 callersFunctioncreate_int_feature
(values)
albert_ner.py:356
↓ 3 callersMethod_create_example
(self, lines, set_type)
albert_ner.py:242
↓ 3 callersMethod_read_data
Reads a BIO data.
albert_ner.py:197
↓ 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.
albert_ner.py:338
↓ 3 callersFunctionfile_based_input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
albert_ner.py:373
↓ 3 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: (opti
bert_utils.py:13
↓ 3 callersFunctionreshape_to_matrix
Reshapes a >= rank 2 tensor to a rank 2 tensor (i.e., a matrix).
modeling.py:1018
↓ 3 callersFunctionwhitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
tokenization.py:154
↓ 2 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:637
↓ 2 callersFunctionconvert_single_example
(ex_index, example, label_map, max_seq_length, tokenizer,mode)
albert_ner.py:261
↓ 2 callersFunctioncreate_masked_lm_predictions
Creates the predictions for the masked LM objective.
create_pretraining_data.py:498
↓ 2 callersFunctionembedding_lookup_factorized
Looks up words embeddings for id tensor, but in a factorized style followed by albert. it is used to reduce much percentage of parameters previous exi
modeling.py:448
↓ 2 callersMethodfrom_json_file
Constructs a `BertConfig` from a json file of parameters.
modeling.py:91
↓ 2 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:302
↓ 2 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:257
↓ 2 callersFunctioninput_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
run_pretraining.py:329
↓ 2 callersFunctionpr_re_fbeta
Uses a confusion matrix to compute precision, recall and fbeta
tf_metrics.py:145
↓ 2 callersFunctionreshape_from_matrix
Reshapes a rank 2 tensor back to its original rank >= 2 tensor.
modeling.py:1032
↓ 2 callersMethodtokenize
(self, text)
tokenization.py:172
↓ 2 callersFunctiontotal_parameters_transformer
(share_parameter_across_layers)
test_changes.py:49
↓ 2 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:833
↓ 2 callersFunctiontranspose_for_scores
(input_tensor, batch_size, num_attention_heads, seq_length, width)
modeling.py:708
↓ 2 callersFunctiontruncate_seq_pair
Truncates a pair of sequences to a maximum sequence length.
create_pretraining_data.py:657
↓ 1 callersMethod__init__
Constructs a LAMBOptimizer.
optimization.py:195
↓ 1 callersMethod__str__
(self)
create_pretraining_data.py:82
↓ 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:396
↓ 1 callersFunction_decode_record
Decodes a record to a TensorFlow example.
albert_ner.py:385
↓ 1 callersMethod_do_use_weight_decay
Whether to use L2 weight decay for `param_name`.
optimization.py:159
↓ 1 callersMethod_do_use_weight_decay
Whether to use L2 weight decay for `param_name`.
optimization.py:285
↓ 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:169
↓ 1 callersMethod_get_variable_name
Get the variable name from the tensor name.
optimization.py:295
↓ 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 callersMethodapply_gradients
See base class.
optimization.py:213
↓ 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 intege
bert_utils.py:74
↓ 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:1045
↓ 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:603
↓ 1 callersFunctioncreate_float_feature
(values)
create_pretraining_data.py:177
↓ 1 callersFunctioncreate_instances_from_document_albert
Creates `TrainingInstance`s for a single document. This method is changed to create sentence-order prediction (SOP) followed by idea from paper o
create_pretraining_data.py:260
↓ 1 callersFunctioncreate_model
Creates a classification model.
albert_ner.py:420
↓ 1 callersFunctioncreate_training_instances
Create `TrainingInstance`s from raw text.
create_pretraining_data.py:182
↓ 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:507
↓ 1 callersFunctionfbeta
Multi-class fbeta metric for Tensorflow Parameters ---------- labels : Tensor of tf.int32 or tf.int64 The true labels pre
tf_metrics.py:97
↓ 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:313
↓ 1 callersMethodget_dev_examples
(self, data_dir)
albert_ner.py:228
↓ 1 callersMethodget_embedding_table
(self)
modeling.py:280
↓ 1 callersMethodget_embedding_table_2
(self)
modeling.py:283
↓ 1 callersMethodget_labels
(self)
albert_ner.py:238
↓ 1 callersFunctionget_masked_lm_output
Get loss and log probs for the masked LM.
run_pretraining.py:241
↓ 1 callersFunctionget_new_segment
输入一句话,返回一句经过处理的话: 为了支持中文全称mask,将被分开的词,将上特殊标记("#"),使得后续处理模块,能够知道哪些字是属于同一个词的。 :param segment: 一句话. e.g. ['悬', '灸', '技', '术', '培', '训', '专', '家
create_pretraining_data.py:227
↓ 1 callersFunctionget_next_sentence_output
Get loss and log probs for the next sentence prediction.
run_pretraining.py:290
↓ 1 callersMethodget_pooled_output
(self)
modeling.py:254
↓ 1 callersMethodget_test_examples
(self,data_dir)
albert_ner.py:233
↓ 1 callersFunctionget_total_parameters
get total parameters of a graph :return:
test_changes.py:16
↓ 1 callersMethodget_train_examples
(self, data_dir)
albert_ner.py:223
↓ 1 callersFunctionlayer_norm_and_dropout
Runs layer normalization followed by dropout.
modeling.py:390
↓ 1 callersFunctionlayer_scope
(idx, shared_type)
modeling.py:1150
↓ 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.
albert_ner.py:464
↓ 1 callersFunctionprelln_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:1074
↓ 1 callersFunctiontest_sentence_order_prediction
sentence order prediction. check method of create_instances_from_document_albert from create_pretrining_data.py :return:
test_changes.py:64
↓ 1 callersMethodto_dict
Serializes this instance to a Python dictionary.
modeling.py:97
↓ 1 callersFunctionwrite_instance_to_example_files
Create TF example files from `TrainingInstance`s.
create_pretraining_data.py:99
↓ 1 callersFunctionwrite_tokens
(tokens,mode)
albert_ner.py:252
Method__init__
(self, tokens, segment_ids, masked_lm_positions, masked_lm_labels, is_random_next)
create_pretraining_data.py:74
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 AdamWeightDecayOptimizer.
optimization.py:90
Method__init__
Constructs a AdamWeightDecayOptimizer.
optimization_finetuning.py:90
Method__init__
Constructs a InputExample. Args: guid: Unique id for the example. text_a: string. The untokenized text of the first sequence. For sing
albert_ner.py:135
Method__init__
(self, input_ids, input_mask, segment_ids, label_i
albert_ner.py:165
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:95
Methodapply_gradients
See base class.
optimization.py:108
Functionconvert_examples_to_features
Convert a set of `InputExample`s to a list of `InputFeatures`.
albert_ner.py:613
Functionconvert_ids_to_tokens
(inv_vocab, ids)
tokenization.py:150
Methodconvert_ids_to_tokens
(self, ids)
tokenization.py:183
next →1–100 of 141, ranked by callers