MCPcopy Create free account

hub / github.com/Tencent/NeuralNLP-NeuralClassifier / functions

Functions190 in github.com/Tencent/NeuralNLP-NeuralClassifier

↓ 12 callersFunctioninit_tensor
Init torch.Tensor Args: tensor: Tensor to be initialized. init_type: Init type, candidate can be found in InitType. low: T
model/model_util.py:63
↓ 10 callersMethoditems
(self)
config.py:37
↓ 8 callersMethodwarn
Log warn message msg: Message to log
util.py:86
↓ 6 callersMethodeval
(self, data_loader, model, optimizer, stage, epoch)
train.py:104
↓ 6 callersMethodinfo
Log info message msg: Message to log
util.py:78
↓ 5 callersMethodget_highway
(dimension, margin_size)
model/classification/attentive_convolution.py:101
↓ 4 callersMethod__init__
(self, transformer_gate, transformer_forward)
model/layers.py:158
↓ 4 callersMethod_add_vocab_to_dict
(dict_map, vocab)
dataset/dataset.py:312
↓ 4 callersMethodget_embedding
(self, batch, pad_shape=None, pad_value=0)
model/classification/classifier.py:92
↓ 3 callersMethod_insert_sequence_vocab
(self, sequence_vocabs, dict_map)
dataset/dataset.py:307
↓ 2 callersMethod__init__
(self, d_model, d_inner, n_head, d_k, d_v, dropout=0.1)
model/transformer_encoder.py:52
↓ 2 callersMethod__init__
(self, dict_map, embedding_dim, name, config, padding_idx=None, pretrained_embedding_file=Non
model/embedding.py:63
↓ 2 callersMethod_append_label
(self, doc_labels, sample)
dataset/collator.py:71
↓ 2 callersMethod_calculate_prf
Calculate precision, recall, fscore Args: standard_count: Standard count predict_count: Predict count righ
evaluate/classification_evaluate.py:47
↓ 2 callersMethod_get_multi_hot_label
For multi-label classification Generate multi-hot for input labels e.g. input: [[0,1], [2]] output: [[1,1,0], [0,0,1]]
dataset/collator.py:55
↓ 2 callersMethod_get_vocab_id_list
Use dict to convert all vocabs to ids
dataset/dataset.py:317
↓ 2 callersMethod_judge_label_in
(label_name, label_to_id_maps)
evaluate/classification_evaluate.py:67
↓ 2 callersMethod_print_dict_info
Print dict info
dataset/dataset.py:282
↓ 2 callersMethod_vocab_to_id
Convert vocab to id. Vocab not in dict map will be map to _UNK
dataset/dataset.py:369
↓ 2 callersMethodadd
Add key value pair
config.py:40
↓ 2 callersMethodcalculate_level_performance
Calculate the level performance. Args: id_to_label_map: Label id to label name. other_text: Text to judge the other la
evaluate/classification_evaluate.py:75
↓ 2 callersMethodevaluate
Eval the predict result. Args: predicts: Predict probability or predict text label(is_prob is false)
evaluate/classification_evaluate.py:152
↓ 2 callersFunctionget_optimizer
(config, params)
model/model_util.py:123
↓ 2 callersFunctionpreprocess
(csv_file, json_file)
dataset/data_preprocessor.py:59
↓ 2 callersMethodrun
(self, data_loader, model, optimizer, stage, epoch, mode=ModeType.EVAL)
train.py:108
↓ 2 callersMethodsave
Save the latest evaluation.
evaluate/classification_evaluate.py:427
↓ 2 callersMethodstr
(cls)
model/loss.py:30
↓ 2 callersMethodstr
(self)
model/model_util.py:47
↓ 1 callersMethod__init__
(self, device)
dataset/collator.py:24
↓ 1 callersMethod__init__
(self, label_size, activation_type=ActivationType.SOFTMAX, gamma=2.0, alpha=0.25, epsilon=1.e
model/loss.py:55
↓ 1 callersMethod__init__
(self, n_head, d_model, d_k, d_v, use_star=False, dropout=0.1)
model/attention.py:50
↓ 1 callersMethod__len__
(self)
dataset/dataset.py:126
↓ 1 callersMethod_clear_dict
Clear all dict
dataset/dataset.py:274
↓ 1 callersMethod_generate_hierarchy_label
Generate hierarchy label, used in HMCN
dataset/dataset.py:255
↓ 1 callersMethod_get_classification_model
(model_name, dataset, conf)
predict.py:59
↓ 1 callersMethod_init_dict
Init all dict
dataset/dataset.py:138
↓ 1 callersMethod_insert_sequence_tokens
(self, sequence_tokens, token_map, token_ngram_map, char_map, ngram=0)
dataset/dataset.py:294
↓ 1 callersMethod_label_to_id
Convert label to id. The reason that label is not in label map may be label is filtered or label in validate/test does not occur in train set
dataset/dataset.py:322
↓ 1 callersMethod_load_checkpoint
(file_name, model, use_cuda)
predict.py:65
↓ 1 callersMethod_load_dict
Load dict from file. Args: dict_name: Dict name, if None load all dict. Default None. Returns: dict.
dataset/dataset.py:164
↓ 1 callersMethod_load_pretrained_dict
Use pretrained embedding to generate dict
dataset/dataset.py:212
↓ 1 callersMethod_save_dict
Save vocab to file and generate id_to_vocab_dict_map Args: dict_name: Dict name, if None save all dict. Default None.
dataset/dataset.py:143
↓ 1 callersMethod_shrink_dict
(self, dict_name=None)
dataset/dataset.py:242
↓ 1 callersMethod_token_to_id
Convert token to id. Vocab not in dict map will be map to _UNK
dataset/dataset.py:336
↓ 1 callersMethod_update
(self, config)
config.py:45
↓ 1 callersMethodcal_recursive_regularize
Only support hierarchical text classification with BCELoss references: http://www.cse.ust.hk/~yqsong/papers/2018-WWW-Text-GraphCNN.pdf
model/loss.py:144
↓ 1 callersFunctionclean_str
Tokenization/string cleaning for all datasets except for SST. Original taken from https://github.com/yoonkim/CNN_sentence/blob/master/process
dataset/data_preprocessor.py:25
↓ 1 callersFunctionconvert_multi_slots_to_single_slots
covert the data which text_data are saved as multi-slots, e.g()
dataset/data_preprocessor.py:49
↓ 1 callersFunctioneval
(conf)
eval.py:61
↓ 1 callersFunctionget_classification_model
(model_name, dataset, conf)
eval.py:48
↓ 1 callersFunctionget_classification_model
Get classification model from configuration
train.py:79
↓ 1 callersFunctionget_data_loader
Get data loader: Train, Validate, Test
train.py:51
↓ 1 callersFunctionget_hierar_relations
get parent-children relationships from given hierar_taxonomy hierar_taxonomy: parent_label \t child_label_0 \t child_label_1 \n
model/model_util.py:144
↓ 1 callersMethodget_parameter_optimizer_dict
(self)
model/classification/hmcn.py:70
↓ 1 callersMethodget_sinusoid_encoding_table
(n_position, d_hid, padding_idx=None)
model/embedding.py:229
↓ 1 callersFunctionload_checkpoint
(file_name, conf, model, optimizer)
eval.py:54
↓ 1 callersFunctionload_checkpoint
(file_name, conf, model, optimizer)
train.py:188
↓ 1 callersMethodload_pretrained_embedding
( self, embedding_lookup_table, dict_map, embedding_dim, name, pretrained_embedding_fi
model/embedding.py:101
↓ 1 callersMethodpredict
input texts should be json objects
predict.py:72
↓ 1 callersFunctionsave_checkpoint
(state, file_prefix)
train.py:197
↓ 1 callersMethodsave_confusion_matrix
Save confusion matrix Args: file_name: File to save to. confusion_matrix: Confusion Matrix. Returns:
evaluate/classification_evaluate.py:365
↓ 1 callersMethodsave_prf
Save precision, recall, fscore Args: file_name: File to save to. precision_category: Precision dict. recal
evaluate/classification_evaluate.py:385
↓ 1 callersMethodstep
Performs a single optimization step. Arguments: closure (callable, optional): A closure that reevaluates the model
model/optimizer.py:122
↓ 1 callersMethodstr
(cls)
dataset/collator.py:36
↓ 1 callersMethodstr
(cls)
model/rnn.py:26
↓ 1 callersMethodstr
(cls)
model/classification/textrnn.py:32
↓ 1 callersFunctiontrain
(conf)
train.py:202
↓ 1 callersMethodtrain
(self, data_loader, model, optimizer, stage, epoch)
train.py:98
↓ 1 callersMethodupdate_lr
Update lr
model/classification/hmcn.py:78
Method__call__
(self, batch)
dataset/collator.py:27
Method__call__
(self, batch)
dataset/collator.py:83
Method__call__
(self, batch)
dataset/collator.py:173
Method__contains__
(self, item)
config.py:34
Method__getitem__
(self, key)
config.py:31
Method__getitem__
(self, idx)
dataset/dataset.py:129
Method__init__
(self, config=None, config_file=None)
config.py:22
Method__init__
(self, config)
predict.py:45
Method__init__
(self, label_map, logger, evaluator, conf, loss_fn)
train.py:88
Method__init__
(self, config)
util.py:52
Method__init__
(self, eval_dir)
evaluate/classification_evaluate.py:33
Method__init__
(self, conf, label_size)
dataset/collator.py:41
Method__init__
Another way to do this is keep the file handler. But when DataLoader's num_worker bigger than 1, error will occur. Args:
dataset/dataset.py:57
Method__init__
(self, config, json_files, generate_dict=False, mode=ModeType.EVAL)
dataset/classification_dataset.py:53
Method__init__
(self, label_size, class_weight=None, loss_type=LossType.SOFTMAX_CROSS_ENTROPY)
model/loss.py:101
Method__init__
(self, input_dimension, attention_dimension, device, dropout=0)
model/layers.py:27
Method__init__
(self, dim, dropout=0)
model/layers.py:51
Method__init__
(self, scaling_factor=None, dropout=0)
model/layers.py:103
Method__init__
(self, dimension, dk, dv, head_number, scaling_factor, dropout=0)
model/layers.py:121
Method__init__
(self, params, lr=required, warmup=-1, t_total=-1, schedule='warmup_linear',
model/optimizer.py:78
Method__init__
(self, d_in, d_hid, dropout=0.1)
model/transformer_encoder.py:32
Method__init__
(self, d_model, n_head, d_k, d_v, dropout=0.1)
model/transformer_encoder.py:72
Method__init__
(self, temperature, attn_dropout=0.1)
model/attention.py:26
Method__init__
(self, input_size, hidden_size, num_layers=1, nonlinearity="tanh", bias=True, batch_first=Fal
model/rnn.py:35
Method__init__
(self, dict_map, embedding_dim, region_size, name, config, padding=None, pretrained_embedding
model/embedding.py:146
Method__init__
(self, seq_max_len, embedding_dim, padding_idx)
model/embedding.py:216
Method__init__
(self, dataset, config)
model/classification/textcnn.py:22
Method__init__
(self, dataset, config)
model/classification/fasttext.py:28
Method__init__
(self, dataset, config)
model/classification/classifier.py:26
Method__init__
(self, dataset, config)
model/classification/region_embedding.py:28
Method__init__
(self, dataset, config)
model/classification/textrcnn.py:26
next →1–100 of 190, ranked by callers