Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/brightmart/multi-label_classification
/ functions
Functions
145 in github.com/brightmart/multi-label_classification
⨍
Functions
145
◇
Types & classes
20
↓ 17 callers
Method
_read_tsv
Reads a tab separated value file.
run_classifier.py:195
↓ 10 callers
Function
create_initializer
Creates a `truncated_normal_initializer` with the given range.
bert/modeling.py:375
↓ 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:
bert/modeling.py:895
↓ 5 callers
Function
create_int_feature
(values)
run_classifier.py:490
↓ 4 callers
Function
convert_by_vocab
Converts a sequence of [tokens|ids] using the vocab.
bert/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
bert/modeling.py:344
↓ 4 callers
Function
predict
(input_path, output_path)
main.py:26
↓ 4 callers
Method
tokenize
(self, text)
bert/tokenization.py:172
↓ 3 callers
Method
_create_examples
Creates examples for the training and dev sets.
run_classifier.py:276
↓ 3 callers
Method
_create_examples
Creates examples for the training and dev sets.
run_classifier.py:316
↓ 3 callers
Method
_create_examples
Creates examples for the training and dev sets.
run_classifier.py:356
↓ 3 callers
Method
_create_examples
Creates examples for the training and dev sets.
run_classifier.py:796
↓ 3 callers
Method
_create_examples
Creates examples for the training and dev sets.
run_classifier.py:840
↓ 3 callers
Method
_create_examples
Creates examples for the training and dev sets.
zuo/run_classifier_predict_online.py:150
↓ 3 callers
Method
_read_tsv
Reads a tab separated value file.
zuo/run_classifier_predict_online.py:115
↓ 3 callers
Function
convert_to_unicode
Converts `text` to Unicode (if it's not already), assuming utf-8 input.
bert/tokenization.py:78
↓ 3 callers
Function
file_based_convert_examples_to_features
Convert a set of `InputExample`s to a TFRecord file.
run_classifier.py:477
↓ 3 callers
Function
file_based_input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
run_classifier.py:507
↓ 3 callers
Function
layer_norm
Run layer normalization on the last dimension of the tensor.
bert/modeling.py:362
↓ 3 callers
Function
predict_online
do online prediction. each time make prediction for one instance. you can change to a batch if you want. :param line: a list. element is
zuo/run_classifier_predict_online.py:383
↓ 3 callers
Function
reshape_to_matrix
Reshapes a >= rank 2 tensor to a rank 2 tensor (i.e., a matrix).
bert/modeling.py:932
↓ 3 callers
Function
whitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
bert/tokenization.py:154
↓ 2 callers
Function
convert_single_example
Converts a single `InputExample` into a single `InputFeatures`.
run_classifier.py:375
↓ 2 callers
Method
convert_tokens_to_ids
(self, tokens)
bert/tokenization.py:180
↓ 2 callers
Method
from_json_file
Constructs a `BertConfig` from a json file of parameters.
bert/modeling.py:91
↓ 2 callers
Method
get_pooled_output
(self)
bert/modeling.py:234
↓ 2 callers
Function
load_factor_with_additional_info
加载要素-描述-代表性描述的文件 :param source_file: :return: 返回一个dict: dict[factor_zh]={desc,sentence_repres1,sentence_repres2,sentence_repres3}
zuo/util.py:15
↓ 2 callers
Function
read_source_flies
读取原始数据 :param data_path: :param category: :return:
zuo/util.py:61
↓ 2 callers
Function
reshape_from_matrix
Reshapes a rank 2 tensor back to its original rank >= 2 tensor.
bert/modeling.py:946
↓ 2 callers
Function
transpose_for_scores
(input_tensor, batch_size, num_attention_heads, seq_length, width)
bert/modeling.py:629
↓ 2 callers
Function
write_file
写单个文件 :param data_list: :param target_file: :return:
zuo/generate_training_data.py:172
↓ 1 callers
Method
_clean_text
Performs invalid character removal and whitespace cleanup on text.
bert/tokenization.py:288
↓ 1 callers
Function
_decode_record
Decodes a record to a TensorFlow example.
run_classifier.py:519
↓ 1 callers
Method
_do_use_weight_decay
Whether to use L2 weight decay for `param_name`.
bert/optimization_finetuning.py:159
↓ 1 callers
Method
_get_variable_name
Get the variable name from the tensor name.
bert/optimization_finetuning.py:169
↓ 1 callers
Method
_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
bert/tokenization.py:266
↓ 1 callers
Function
_is_control
Checks whether `chars` is a control character.
bert/tokenization.py:376
↓ 1 callers
Function
_is_punctuation
Checks whether `chars` is a punctuation character.
bert/tokenization.py:388
↓ 1 callers
Function
_is_whitespace
Checks whether `chars` is a whitespace character.
bert/tokenization.py:364
↓ 1 callers
Method
_run_split_on_punc
Splits punctuation on a piece of text.
bert/tokenization.py:233
↓ 1 callers
Method
_run_strip_accents
Strips accents from a piece of text.
bert/tokenization.py:222
↓ 1 callers
Method
_tokenize_chinese_chars
Adds whitespace around any CJK character.
bert/tokenization.py:253
↓ 1 callers
Function
_truncate_seq_pair
Truncates a sequence pair in place to the maximum length.
run_classifier.py:555
↓ 1 callers
Function
_truncate_seq_pair
Truncates a sequence pair in place to the maximum length.
zuo/run_classifier_predict_online.py:256
↓ 1 callers
Method
apply_gradients
See base class.
bert/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
bert/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
bert/modeling.py:558
↓ 1 callers
Function
convert_single_example
Converts a single `InputExample` into a single `InputFeatures`.
zuo/run_classifier_predict_online.py:165
↓ 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
bert/modeling.py:524
↓ 1 callers
Function
create_model
Creates a classification model.
run_classifier.py:572
↓ 1 callers
Function
create_model
Creates a classification model.
zuo/run_classifier_predict_online.py:278
↓ 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
bert/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
bert/modeling.py:428
↓ 1 callers
Method
from_dict
Constructs a `BertConfig` from a Python dictionary of parameters.
bert/modeling.py:83
↓ 1 callers
Function
generate_train_data
输入3个数据文件和
zuo/generate_training_data.py:7
↓ 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:
bert/modeling.py:280
↓ 1 callers
Function
get_allow_list_tag
获取允许的候选项 :param k_candi_tag_dict: '借款纠纷_拒绝履行偿还': {'label_zh': '拒绝履行偿还', 'desc': '未按时偿还借款|拒不偿还借款', 'sentence_repres1': '如果XX未按指定的期间履行给付金钱义务,应当
zuo/predict_similarity.py:79
↓ 1 callers
Method
get_dev_examples
Gets a collection of `InputExample`s for the dev set.
run_classifier.py:182
↓ 1 callers
Function
get_label_list_single
:param labels_prob_1: {'LB1': 0.0016595844645053148, 'LB2': 0.11449998617172241, 'LB3': 0.003680239664390683, :param labels_prob_2: {'LB1':
main.py:102
↓ 1 callers
Method
get_labels
Gets the list of labels for this data set.
run_classifier.py:190
↓ 1 callers
Method
get_labels
Gets the list of labels for this data set.
zuo/run_classifier_predict_online.py:110
↓ 1 callers
Function
get_neg_example_data
获得负样本 :param divorce_selectedtags_dict: :param labels_word_list: :param category: :param sentence: :param count: :param d
zuo/generate_training_data.py:108
↓ 1 callers
Function
get_pos_example_data
得到正样本的训练数据 :return:
zuo/generate_training_data.py:65
↓ 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.
bert/modeling.py:368
↓ 1 callers
Function
load_pos_examples_files
从文件中读取标签对应的代表性的正样本 :param source_path: 文件所在位置 :return:
zuo/generate_training_data.py:222
↓ 1 callers
Function
load_vocab
Loads a vocabulary file into a dictionary.
bert/tokenization.py:121
↓ 1 callers
Function
model_fn_builder
Returns `model_fn` closure for TPUEstimator.
run_classifier.py:625
↓ 1 callers
Function
predict_single
通过预测得到标签的列表: 会综合使用多个标签或句子来做预测 :param sentence: 句子 :param category_en: 类别信息,如 'labor' : return: label_result_list: 预测除的标签. e.g. label_
zuo/predict_similarity.py:20
↓ 1 callers
Function
sentence_match_single
(sentence,keyword)
zuo/util.py:118
↓ 1 callers
Method
to_dict
Serializes this instance to a Python dictionary.
bert/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.
bert/modeling.py:754
↓ 1 callers
Function
write_data_to_file_system
写多个文件 :param total_list: :param target_path: :return:
zuo/generate_training_data.py:203
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:208
Method
__init__
(self)
run_classifier.py:772
Method
__init__
(self)
run_classifier.py:817
Method
__init__
(self, vocab_file, do_lower_case=True)
bert/tokenization.py:166
Method
__init__
Constructs a BasicTokenizer. Args: do_lower_case: Whether to lower case the input.
bert/tokenization.py:190
Method
__init__
(self, vocab, unk_token="[UNK]", max_input_chars_per_word=200)
bert/tokenization.py:305
Method
__init__
Constructs a AdamWeightDecayOptimizer.
bert/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
bert/modeling.py:34
Method
__init__
Constructor for BertModel. Args: config: `BertConfig` instance. is_training: bool. true for training model, false for eval model. Con
bert/modeling.py:131
Method
__init__
Constructs a InputExample. Args: guid: Unique id for the example. text_a: string. The untokenized text of the first seque
zuo/run_classifier_predict_online.py:67
Method
__init__
(self, input_ids, input_mask, segment_ids, label_id)
zuo/run_classifier_predict_online.py:88
Method
__init__
(self)
zuo/run_classifier_predict_online.py:128
Function
check_whether_has_any_candidate
检测是否有有效候选项 :param labels_with_prob_dict: :return: True if has candidate; False is not has candidate
main.py:55
Function
combine_prob
整合两个概率,概率取加权平均 :param labels_prob_1: :param labels_prob_2: :return: 加权平均后的概率
main.py:72
Function
convert_examples_to_features
Convert a set of `InputExample`s to a list of `InputFeatures`.
run_classifier.py:861
Function
convert_ids_to_tokens
(inv_vocab, ids)
bert/tokenization.py:150
Method
convert_ids_to_tokens
(self, ids)
bert/tokenization.py:183
Function
convert_tokens_to_ids
(vocab, tokens)
bert/tokenization.py:146
Function
create_int_feature
(values)
zuo/run_classifier_predict_online.py:273
Function
create_optimizer
Creates an optimizer training op.
bert/optimization_finetuning.py:25
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
bert/modeling.py:264
Method
get_all_encoder_layers
(self)
bert/modeling.py:246
Function
get_assignment_map_from_checkpoint
Compute the union of the current variables and checkpoint variables.
bert/modeling.py:317
Method
get_dev_examples
See base class.
run_classifier.py:230
next →
1–100 of 145, ranked by callers