MCPcopy Create free account

hub / github.com/Nicozwy/CofCED / functions

Functions54 in github.com/Nicozwy/CofCED

↓ 6 callersFunctionloss_func
(criterion, y_pred, y_true, mask=None)
Codes/eval_exp_fc5.py:46
↓ 5 callersFunctionfrom_project_root
return system absolute path according to relative path, if path dirs not exists and create is True, required folders will be created Args:
Codes/helpers/path_util.py:11
↓ 3 callersFunctionevaluate_model
evaluating Fact-checking model on data_url Args: model: Fact-checking model data_url: url to test dataset for evaluating, e.g.,
Codes/eval_exp_fc5.py:54
↓ 3 callersMethodforward
Task 1: Veracity Prediction -- T/F/H... 1) claim + src --> veracity 2) claim + src[oracle_ids] --> veracity 3) cl
Codes/model/model_exp_fc5.py:444
↓ 3 callersFunctionget_time_param
convex function:fast->slow, characterizing the easier classification for early phase, and harder classification for later phase. BIG HEAD
Codes/train_exp_fc5_LIAR_RAW2.py:115
↓ 2 callersMethod__init__
(self, hidden_size, n_tags, embedding_url=None, bidirectional=True, lstm_layers=1, n_embeddin
Codes/model/model_exp_fc5.py:43
↓ 2 callersFunctiondate_suffix
return the current date suffix,like '180723.csv' Args: file_type: file type suffix, like '.csv Returns: str: date suffix
Codes/helpers/path_util.py:29
↓ 2 callersFunctionget_label_list
(label_ids=LABEL_IDS)
Codes/eval_exp_fc5.py:41
↓ 2 callersFunctionrouge_results_to_str
(results_dict)
Codes/helpers/utils.py:70
↓ 1 callersFunctioncal_max_word_num
return max len
Codes/helpers/reader5.py:392
↓ 1 callersFunctioncalc_f1
calculating f1 Args: tp: true positive fp: false positive fn: false negative print_result: whether to print resu
Codes/helpers/torch_util.py:29
↓ 1 callersFunctioncompute_rouge_from_array
(decoded: list, references: list)
Codes/helpers/utils.py:22
↓ 1 callersFunctiongen_domain_id
obtain domain ids
Codes/helpers/reader5.py:376
↓ 1 callersFunctiongen_label_id
generate label ids for claims
Codes/helpers/reader5.py:358
↓ 1 callersFunctiongen_oracle_id
select oracle ids from ruling_tokenized
Codes/helpers/reader5.py:347
↓ 1 callersFunctionget_dynamicWA
dynamic weight average for multi-task learning loss temperature: larger value results in a more even distribution between different tasks.
Codes/train_exp_fc5_LIAR_RAW2.py:81
↓ 1 callersFunctionload_df_dataset
mode = train, test, val
Codes/helpers/reader5.py:609
↓ 1 callersMethodload_raw
parsing dict objs to list
Codes/helpers/reader5.py:126
↓ 1 callersFunctionmain
()
Codes/eval_exp_fc5.py:293
↓ 1 callersFunctionmain
()
Codes/helpers/torch_util.py:50
↓ 1 callersFunctionmain
()
Codes/helpers/json_util.py:64
↓ 1 callersFunctionmain
for test
Codes/helpers/path_util.py:44
↓ 1 callersMethodread_from_dir
1 csv pd.read_csv 2 json return all filenames in dir
Codes/helpers/reader5.py:90
↓ 1 callersFunctiontrain_model
(n_epochs=n_epochs, train_file = "train.json",##containing all data val_file =
Codes/train_exp_fc5_LIAR_RAW2.py:120
Method__getitem__
(self, index)
Codes/helpers/reader5.py:80
Method__init__
(self, q_dim, k_dim, v_dim)
Codes/model/model_exp_fc5.py:611
Method__init__
(self, input_dim, hidden_size=100, dropout_rate=0., num_classes=3)
Codes/model/model_exp_fc5.py:631
Method__init__
(self,filename,level='info',when='D',backCount=3,fmt='%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelnam
Codes/helpers/simple_logger.py:30
Method__init__
Create a summary writer logging to log_dir.
Codes/helpers/logger.py:12
Method__init__
(self, data_file, report_each_claim=30)
Codes/helpers/reader5.py:58
Method__len__
(self)
Codes/helpers/reader5.py:87
Functionclean
(x)
Codes/helpers/utils.py:16
Methoddata2ids
(self, sentences, labels=None, max_length=None, add_special_tokens=False)
Codes/helpers/reader5.py:299
Functiondump
dump python object into json file Args: obj: python object, more information here https://docs.python.org/2/library/json.ht
Codes/helpers/json_util.py:21
Methodextract_evidences_doc
:param claim_repr: claim tensor (batch_size, n_words, n_hidden) word_repr : src tensor, full text. (2000, n_words, n_hidden)
Codes/model/model_exp_fc5.py:241
Methodforward
(self, query, key, value, mask=None, norm=True, dropout=None)
Codes/model/model_exp_fc5.py:617
Methodforward
(self, x)
Codes/model/model_exp_fc5.py:640
Methodgen_batch_info
:param src_tensors: claim_sent, claim_sent_lengths, claim_sent_words, claim_sent_word_lengths, claim_sent_word_indices, claim_sent_nums
Codes/model/model_exp_fc5.py:212
Functiongen_sent_tensors
generate input tensors for 1 batch: _CLAIM, _CLAIM_TOK, _TGT, _TGT_TOK, _SRC, _SRC_TOK Args: _CLAIM, _CLAIM_TOK: claim sents and its token
Codes/helpers/reader5.py:419
Functionget_device
choose device Returns: the device specified by name, if name is None, proper device will be returned
Codes/helpers/torch_util.py:17
Functionget_idx_list
generate real index of the tensor. :param len_list: lengths of the tensor. :return: list of real index.
Codes/helpers/reader5.py:364
Methodhisto_summary
Log a histogram of the tensor of values.
Codes/helpers/logger.py:46
Methodimage_summary
Log a list of images.
Codes/helpers/logger.py:22
Functionlen_allsents
@_CLAIM_TOK:list of list
Codes/helpers/reader5.py:336
Functionlist_to_dict
transform list into value-index dict Args: lis: list Returns: value-index dict for lis
Codes/helpers/json_util.py:48
Functionload
load python object form json file Args: json_url: url to json file Returns: python object
Codes/helpers/json_util.py:6
Functionmergelist
(sentlist)
Codes/helpers/reader5.py:325
Methodmy_collate
collect data with your style
Codes/helpers/reader5.py:168
Functionread_from_dir
return all filenames in dir
Codes/helpers/reader5.py:598
Methodscalar_summary
Log a scalar variable.
Codes/helpers/logger.py:16
Functionset_random_seed
set random seed for numpy and torch, more information here: https://pytorch.org/docs/stable/notes/randomness.html Args: seed: the
Codes/helpers/torch_util.py:5
Functionsort_dict_by_value
sort a dict by value Args: dic: the dict to be sorted reverse: reverse order or not Returns: sorted dict
Codes/helpers/json_util.py:34
Functiontile
Tiles x on dimension dim count times.
Codes/helpers/utils.py:48
Functionto_np
(x)
Codes/train_exp_fc5_LIAR_RAW2.py:75