MCPcopy Create free account

hub / github.com/atulkum/co-attention / functions

Functions72 in github.com/atulkum/co-attention

↓ 6 callersFunctionreadnext
x is a list
code/data_util/official_eval_helper.py:34
↓ 5 callersFunctionyellowtext
Yellow text
code/data_util/pretty_print.py:24
↓ 4 callersMethod__init__
(self, hidden_dim, emb_matrix, dropout_ratio)
code/model.py:29
↓ 4 callersFunctionnormalize_answer
Lower text and remove punctuation, articles and extra whitespace.
code/data_util/evaluate.py:11
↓ 4 callersFunctionpadded
Inputs: token_batch: List (length batch size) of lists of ints. batch_pad: Int. Length to pad to. If 0, pad to maximum length sequenc
code/data_util/data_batcher.py:83
↓ 4 callersFunctiontokenize
(sequence)
code/preprocessing/squad_preprocess.py:52
↓ 4 callersFunctionwrite_to_file
(out_file, line)
code/preprocessing/squad_preprocess.py:41
↓ 3 callersFunctiondata_from_json
Loads JSON data from filename and returns
code/preprocessing/squad_preprocess.py:45
↓ 3 callersFunctionget_batch_generator
This function returns a generator object that yields batches. The last batch in the dataset will be a partial batch. Read this to underst
code/data_util/data_batcher.py:174
↓ 3 callersMethodget_data
(self, batch, is_train=True)
code/process_training.py:46
↓ 3 callersMethodget_model
(self, model_file_path=None, is_eval=False)
code/process_training.py:86
↓ 3 callersFunctioninit_lstm_forget_bias
(lstm)
code/model.py:17
↓ 3 callersFunctionmaybe_download
Takes an URL, a filename, and the expected bytes, download the contents and returns the filename. num_bytes=None disables the file size check.
code/preprocessing/squad_preprocess.py:90
↓ 2 callersMethodget_mask_from_seq_len
(self, seq_mask)
code/process_training.py:39
↓ 2 callersFunctiongreentext
Green text
code/data_util/pretty_print.py:28
↓ 2 callersFunctionmagentaback
Magenta background
code/data_util/pretty_print.py:40
↓ 2 callersFunctionmetric_max_over_ground_truths
(metric_fn, prediction, ground_truths)
code/data_util/evaluate.py:46
↓ 2 callersFunctionpreprocess_and_write
Reads the dataset, extracts context, question, answer, tokenizes them, and calculates answer span in terms of token indices. Note: due to toke
code/preprocessing/squad_preprocess.py:151
↓ 2 callersFunctionredback
Red background
code/data_util/pretty_print.py:36
↓ 2 callersFunctionredtext
Red text
code/data_util/pretty_print.py:32
↓ 2 callersMethodsave_model
(self, model, optimizer, loss, global_step, epoch, model_dir)
code/process_training.py:72
↓ 2 callersFunctionsentence_to_token_ids
Turns an already-tokenized sentence string into word indices e.g. "i do n't know" -> [9, 32, 16, 96] Note any token that isn't in the word2id
code/data_util/data_batcher.py:73
↓ 2 callersFunctiontotal_exs
Returns the total number of (context, question, answer) triples, given the data read from the SQuAD json file.
code/preprocessing/squad_preprocess.py:57
↓ 1 callersMethod__init__
(self, hidden_dim, emb_matrix, dropout_ratio)
code/model_baseline.py:18
↓ 1 callersFunctionevaluate
(dataset, predictions)
code/data_util/evaluate.py:54
↓ 1 callersFunctionexact_match_score
(prediction, ground_truth)
code/data_util/evaluate.py:42
↓ 1 callersFunctionf1_score
(prediction, ground_truth)
code/data_util/evaluate.py:29
↓ 1 callersFunctiongenerate_answers
(config, model, processor, qn_uuid_data, context_token_data, qn_token_data)
code/data_util/official_eval_helper.py:225
↓ 1 callersFunctionget_batch_generator
This is similar to get_batch_generator in data_batcher.py, but with some differences (see explanation in refill_batches). Inputs:
code/data_util/official_eval_helper.py:98
↓ 1 callersFunctionget_char_word_loc_mapping
Return a mapping that maps from character locations to the corresponding token locations. If we're unable to complete the mapping e.g. becaus
code/preprocessing/squad_preprocess.py:115
↓ 1 callersFunctionget_glove
Reads from original GloVe .txt file and returns embedding matrix and mappings from words to word ids. Input: glove_path: path to glove.
code/data_util/vocab.py:31
↓ 1 callersMethodget_grad_norm
(self, parameters, norm_type=2)
code/process_training.py:103
↓ 1 callersFunctionget_json_data
Read the contexts and questions from a .json file (like dev-v1.1.json) Returns: qn_uuid_data: list (length equal to dev set size) of u
code/data_util/official_eval_helper.py:197
↓ 1 callersMethodget_param_norm
(self, parameters, norm_type=2)
code/process_training.py:112
↓ 1 callersFunctionget_pretrained_embedding
(np_embd)
code/model_baseline.py:11
↓ 1 callersFunctionget_pretrained_embedding
(np_embd)
code/model.py:11
↓ 1 callersFunctionintstr_to_intlist
Given a string e.g. '311 9 1334 635 6192 56 639', returns as a list of integers
code/data_util/data_batcher.py:68
↓ 1 callersFunctionlower
(text)
code/data_util/evaluate.py:23
↓ 1 callersFunctionmain
()
code/preprocessing/squad_preprocess.py:257
↓ 1 callersFunctionmain
()
code/preprocessing/download_wordvecs.py:28
↓ 1 callersFunctionpreprocess_dataset
Note: this is similar to squad_preprocess.preprocess_and_write, but: (1) We only extract the context and question information from the JSON
code/data_util/official_eval_helper.py:144
↓ 1 callersFunctionprint_example
Pretty-print the results for one example. Inputs: word2id: dictionary mapping word (string) to word id (int) context_tokens, qn_
code/data_util/pretty_print.py:46
↓ 1 callersFunctionrefill_batches
Adds more batches into the "batches" list. Inputs: batches: list to add batches to word2id: dictionary mapping word (string) to
code/data_util/data_batcher.py:96
↓ 1 callersFunctionrefill_batches
This is similar to refill_batches in data_batcher.py, but: (1) instead of reading from (preprocessed) datafiles, it reads from the provided
code/data_util/official_eval_helper.py:43
↓ 1 callersFunctionremove_articles
(text)
code/data_util/evaluate.py:13
↓ 1 callersFunctionremove_punc
(text)
code/data_util/evaluate.py:19
↓ 1 callersFunctionreporthook
https://github.com/tqdm/tqdm
code/preprocessing/squad_preprocess.py:69
↓ 1 callersFunctionsetup_args
()
code/preprocessing/squad_preprocess.py:35
↓ 1 callersFunctionsetup_args
()
code/preprocessing/download_wordvecs.py:22
↓ 1 callersFunctionsplit_by_whitespace
(sentence)
code/data_util/data_batcher.py:61
↓ 1 callersMethodtrain_one_batch
(self, batch, model, optimizer, params)
code/process_training.py:120
↓ 1 callersFunctionwhite_space_fix
(text)
code/data_util/evaluate.py:16
Method__init__
(self)
code/process_training.py:28
Method__init__
(self, hidden_dim, emb_matrix, dropout_ratio)
code/model_baseline.py:45
Method__init__
(self, hidden_dim, dropout_ratio)
code/model.py:70
Method__init__
(self, hidden_dim, maxout_pool_size, max_dec_steps, dropout_ratio)
code/model.py:91
Method__init__
(self, hidden_dim, maxout_pool_size, dropout_ratio)
code/model.py:171
Method__init__
(self, hidden_dim, maxout_pool_size, emb_matrix, max_dec_steps, dropout_ratio)
code/model.py:233
Method__init__
Inputs: {context/qn}_ids: Numpy arrays. Shape (batch_size, {context_len/question_len}). Contains padding. {co
code/data_util/data_batcher.py:33
Functioncheck_f1_em
(self, model, dataset, num_samples=100, print_to_screen=False)
code/process_training.py:247
Functioneval_one_batch
(self, batch, model)
code/process_training.py:144
Methodforward
(self, seq, mask)
code/model_baseline.py:29
Methodforward
(self, q_seq, q_mask, d_seq, d_mask, span=None)
code/model_baseline.py:58
Methodforward
(self, seq, mask)
code/model.py:42
Methodforward
(self, seq, mask)
code/model.py:77
Methodforward
(self, U, d_mask, span)
code/model.py:100
Methodforward
(self, h_i, U, curr_mask, idx_i_1, u_cat, mask_mult, target=None)
code/model.py:189
Methodforward
(self, q_seq, q_mask, d_seq, d_mask, span=None)
code/model.py:244
Functionget_dev_loss
(self, model)
code/process_training.py:304
Functioninner
b: int, optional Number of blocks just transferred [default: 1]. bsize: int, optional Size of each block (in
code/preprocessing/squad_preprocess.py:73
Functiontest_one_batch
(self, batch, model)
code/process_training.py:150
Functiontrain
(self, model_file_path)
code/process_training.py:156