MCPcopy Index your code

hub / github.com/INK-USC/fewNER / functions

Functions128 in github.com/INK-USC/fewNER

↓ 12 callersFunctionget_metric
Return the metrics of precision, recall and f-score, based on the number (We make this small piece of function in order to reduce the code ef
src/config/utils.py:91
↓ 9 callersMethoddecode
Decode the batch input :param batchInput: :return:
src/model/neuralcrf.py:64
↓ 7 callersFunctionlog_sum_exp_pytorch
Calculate the log_sum_exp trick for the tensor. :param vec: [batchSize * from_label * to_label]. :return: [batchSize * to_label]
src/config/utils.py:13
↓ 6 callersMethodbackward
Backward algorithm. A benchmark implementation which is ready to use. :param lstm_scores: shape: (batch_size, sent_len, label_size) N
src/model/module/linear_crf_inferencer.py:108
↓ 6 callersFunctionevaluate_batch_insts
Evaluate a batch of instances and handling the padding positions. :param batch_insts: a batched of instances. :param batch_pred_ids: Sha
src/config/eval.py:30
↓ 6 callersFunctionwrite_results
(filename: str, insts: List[Instance])
src/config/utils.py:76
↓ 5 callersFunctionget_huggingface_optimizer_and_scheduler
Copying the optimizer code from HuggingFace.
src/config/transformers_util.py:25
↓ 4 callersFunctionmaybe_show_prompt
(id, word, prompt, mod)
src/data/transformers_dataset.py:28
↓ 3 callersFunctionbuild_label_idx
Build the mapping from label to index and index to labels. :param insts: list of instances. :return:
src/data/data_utils.py:39
↓ 3 callersMethodconvert_instances_to_feature_tensors
(self, word2idx: Dict[str, int], char2idx: Dict[str, int], elmo_vecs: np.ndarray = None)
src/data/ner_dataset.py:45
↓ 3 callersFunctionconvert_iobes
(labels)
dataset/random_selection.py:23
↓ 3 callersFunctionconvert_iobes
Use IOBES tagging schema to replace the IOB tagging schema in the instance :param insts: :return:
src/data/data_utils.py:15
↓ 3 callersFunctionevaluate_model
(config: Config, model: TransformersCRF, data_loader: DataLoader, name: str, insts: List, print_each_type_metr
transformers_trainer.py:179
↓ 3 callersFunctionevaluate_model
(config: Config, model: TransformersCRF, data_loader: DataLoader, name: str, insts: List, print_each_type_metr
transformers_continual_trainer.py:190
↓ 3 callersFunctionevaluate_model
(config: Config, model: NNCRF, loader: DataLoader, name: str, insts: List[Instance], print_each_type_metric: b
trainer.py:156
↓ 3 callersMethodget_output_dim
(self)
src/model/embedder/word_embedder.py:40
↓ 3 callersFunctionload_elmo_vec
Load the elmo vectors and the vector will be saved within each instance with a member `elmo_vec` :param file: the vector files for the ELMo v
src/config/utils.py:39
↓ 3 callersMethodsingle_label_search_space
Returns the space that contains all the instances that has this label.
src/data/search_space_manager.py:74
↓ 3 callersMethodsuperset_labels_search_space
Returns the search space of instances whose labels are supersets of instance inst.
src/data/search_space_manager.py:86
↓ 2 callersMethod__get_mask
Get the bitmask state of an instance based on the labels it has.
src/data/search_space_manager.py:99
↓ 2 callersMethodcalculate_all_scores
Calculate all scores by adding up the transition scores and emissions (from lstm). Basically, compute the scores for each edges betwe
src/model/module/linear_crf_inferencer.py:226
↓ 2 callersFunctionconvert_instances_to_feature_tensors
(instances: List[Instance], tokenizer: PreTrainedTokenizer,
src/data/transformers_dataset_search.py:28
↓ 2 callersFunctionconvert_instances_to_feature_tensors
(instances: List[Instance], tokenizer: PreTrainedTokenizer,
src/data/transformers_dataset.py:33
↓ 2 callersFunctionevaluate_model
(config: Config, model: TransformersCRF, data_loader: DataLoader, name: str, insts: List, print_each_type_metr
search_continual_run.py:190
↓ 2 callersFunctionevaluate_model
(config: Config, model: TransformersCRF, data_loader: DataLoader, name: str, insts: List, print_each_type_metr
search_run.py:179
↓ 1 callersMethodadd_constraint_for_iobes
(self, transition: torch.Tensor)
src/model/module/linear_crf_inferencer.py:35
↓ 1 callersMethodbuild_combination_search_spaces
Build a search space for each possible combination of labels using bitmask. Note that for a combination x, we choose the ins
src/data/search_space_manager.py:31
↓ 1 callersMethodbuild_emb_table
build the embedding table with pretrained word embeddings (if given otherwise, use random embeddings) :return:
src/config/config.py:124
↓ 1 callersMethodbuild_single_label_search_spaces
Build a search space for each label, which contains all the instances that have this label. An instance may appear in multipl
src/data/search_space_manager.py:57
↓ 1 callersFunctionbuild_word_idx
Build the vocab 2 idx for all instances :param train_insts: :param dev_insts: :param test_insts: :return:
src/data/data_utils.py:71
↓ 1 callersFunctioncheck_all_labels_in_dict
(insts: List[Instance], label2idx: Dict[str, int])
src/data/data_utils.py:64
↓ 1 callersFunctioncheck_all_obj_is_None
(objs)
src/data/data_utils.py:109
↓ 1 callersFunctionconvert_iobes
(labels)
dataset/random_selection_50_percent.py:21
↓ 1 callersFunctiondata_to_sents
(data)
dataset/ontonotes_refine.py:17
↓ 1 callersFunctiondataset_slice
(sents, label_space)
dataset/random_selection_50_percent.py:52
↓ 1 callersFunctiondataset_slice
(number, sents, label_space)
dataset/random_selection.py:54
↓ 1 callersFunctionevaluate_model
(config: Config, model: TransformersCRF, data_loader: DataLoader, name: str, insts: List, print_each_type_metr
search.py:138
↓ 1 callersMethodforward_backward
Note: This function is not used unless you want to compute the marginal probability Forward-backward algorithm to compute the margina
src/model/module/linear_crf_inferencer.py:151
↓ 1 callersMethodforward_labeled
Calculate the scores for the gold instances. :param all_scores: (batch, seq_len, label_size, label_size) :param word_seq_lens
src/model/module/linear_crf_inferencer.py:202
↓ 1 callersMethodforward_unlabeled
Calculate the scores with the forward algorithm. Basically calculating the normalization term :param all_scores: (batch_size x max_se
src/model/module/linear_crf_inferencer.py:80
↓ 1 callersFunctionget_optimizer
(config: Config, model: nn.Module, weight_decay: float = 0.0, eps: float =
src/config/utils.py:55
↓ 1 callersFunctionget_parser
()
scripts/in_domain/in_domain_combine_results.py:6
↓ 1 callersFunctionget_path
Path to result txt file
scripts/in_domain/in_domain_combine_results.py:27
↓ 1 callersFunctionget_score
(sample_seed, train_seed)
scripts/in_domain/in_domain_combine_results.py:33
↓ 1 callersFunctionlabels_from_sents
(sents)
dataset/random_selection_50_percent.py:39
↓ 1 callersFunctionlabels_from_sents
(sents)
dataset/random_selection.py:41
↓ 1 callersFunctionlr_decay
Method to decay the learning rate :param config: configuration :param optimizer: optimizer :param epoch: epoch number :return:
src/config/utils.py:24
↓ 1 callersFunctionmain
()
search_continual_run.py:229
↓ 1 callersFunctionmain
()
search_run.py:218
↓ 1 callersFunctionmain
()
transformers_trainer.py:218
↓ 1 callersFunctionmain
()
transformers_continual_trainer.py:228
↓ 1 callersFunctionmain
()
search.py:177
↓ 1 callersFunctionmain
()
trainer.py:188
↓ 1 callersFunctionmain
()
scripts/in_domain/in_domain_combine_results.py:24
↓ 1 callersFunctionparse_arguments
Configure optional arguments for the command line argument parser.
search_continual_run.py:34
↓ 1 callersFunctionparse_arguments
Configure optional arguments for the command line argument parser.
search_run.py:34
↓ 1 callersFunctionparse_arguments
Configure optional arguments for the command line argument parser.
transformers_trainer.py:36
↓ 1 callersFunctionparse_arguments
(parser)
transformers_continual_trainer.py:32
↓ 1 callersFunctionparse_arguments
Configure optional arguments for the command line argument parser.
search.py:32
↓ 1 callersFunctionparse_arguments
(parser)
trainer.py:34
↓ 1 callersMethodpredict
(self, sents: List[List[str]], batch_size = -1)
transformers_predictor.py:46
↓ 1 callersMethodread_from_sentences
sents = [['word_a', 'word_b'], ['word_aaa', 'word_bccc', 'word_ccc']]
src/data/transformers_dataset_search.py:208
↓ 1 callersMethodread_from_sentences
sents = [['word_a', 'word_b'], ['word_aaa', 'word_bccc', 'word_ccc']]
src/data/transformers_dataset.py:553
↓ 1 callersMethodread_pretrain_embedding
Read the pretrained word embeddings, return the complete embeddings and the embedding dimension :return:
src/config/config.py:87
↓ 1 callersMethodread_txt
(self, file: str, number: int = -1)
src/data/transformers_dataset_search.py:218
↓ 1 callersMethodread_txt
(self, file: str, number: int = -1)
src/data/ner_dataset.py:79
↓ 1 callersMethodread_txt
(self, file: str, number: int = -1)
src/data/transformers_dataset.py:563
↓ 1 callersFunctionset_seed
(opt, seed)
search_continual_run.py:24
↓ 1 callersFunctionset_seed
(opt, seed)
search_run.py:24
↓ 1 callersFunctionset_seed
(opt, seed)
transformers_trainer.py:22
↓ 1 callersFunctionset_seed
(opt, seed)
transformers_continual_trainer.py:22
↓ 1 callersFunctionset_seed
(opt, seed)
search.py:22
↓ 1 callersFunctionset_seed
(opt, seed)
trainer.py:24
↓ 1 callersFunctionshow_args
(args)
transformers_trainer.py:31
↓ 1 callersFunctiontrain_model
(config: Config, epoch: int, train_loader: DataLoader, dev_loader: DataLoader, test_loader: DataLoader, result
search_continual_run.py:86
↓ 1 callersFunctiontrain_model
(config: Config, epoch: int, train_loader: DataLoader, dev_loader: DataLoader, test_loader: DataLoader, result
search_run.py:86
↓ 1 callersFunctiontrain_model
(config: Config, epoch: int, train_loader: DataLoader, dev_loader: DataLoader, test_loader: DataLoader, result
transformers_trainer.py:86
↓ 1 callersFunctiontrain_model
(config: Config, epoch: int, train_loader: DataLoader, dev_loader: DataLoader, test_loader: DataLoader, result
transformers_continual_trainer.py:82
↓ 1 callersFunctiontrain_model
(config: Config, epoch: int, train_loader: DataLoader, dev_loader: DataLoader, test_loader: DataLoader)
trainer.py:70
↓ 1 callersFunctiontrain_model_search
(config: Config, epoch: int, train_loader: DataLoader, dev_loader: DataLoader)
search.py:83
↓ 1 callersMethodviterbi_decode
Use viterbi to decode the instances given the scores and transition parameters :param all_scores: (batch_size x max_seq_len x num_lab
src/model/module/linear_crf_inferencer.py:250
↓ 1 callersFunctionwrite_original
(refined, writefile)
dataset/random_selection_50_percent.py:76
↓ 1 callersFunctionwrite_original
(refined, writefile)
dataset/random_selection.py:111
Method__eq__
(self, other)
src/config/eval.py:23
Method__getitem__
(self, index)
src/data/transformers_dataset_search.py:272
Method__getitem__
(self, index)
src/data/ner_dataset.py:110
Method__getitem__
(self, index)
src/data/transformers_dataset.py:617
Method__hash__
(self)
src/config/eval.py:26
Method__init__
model_archived_file: ends with "tar.gz" OR directly use the model folder patth
transformers_predictor.py:18
Method__init__
(self, config)
src/model/neuralcrf.py:17
Method__init__
(self, config)
src/model/transformers_neuralcrf.py:20
Method__init__
(self, label_size: int, input_dim:int, hidden_dim: int, drop_lstm:float=0.5,
src/model/module/bilstm_encoder.py:15
Method__init__
(self, char_emb_size:int, char_size:int, char_hidden_size: int,
src/model/module/charbilstm.py:12
Method__init__
(self, label_size:int, label2idx:Dict[str, int], add_iobes_constraint: bool = False, idx2labe
src/model/module/linear_crf_inferencer.py:12
Method__init__
(self, label_size:int, input_dim:int)
src/model/module/linear_encoder.py:10
Method__init__
(self, transformer_model_name: str, parallel_embedder: bool = False)
src/model/embedder/transformers_embedder.py:12
Method__init__
This word embedder allows to static contextualized representation. :param config: :param print_info:
src/model/embedder/word_embedder.py:10
Method__init__
sents: we use sentences if we want to build dataset from sentences directly instead of file
src/data/transformers_dataset_search.py:172
Method__init__
Read the dataset into Instance
src/data/ner_dataset.py:23
Method__init__
sents: we use sentences if we want to build dataset from sentences directly instead of file
src/data/transformers_dataset.py:516
next →1–100 of 128, ranked by callers