Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ShannonAI/CorefQA
/ functions
Functions
207 in github.com/ShannonAI/CorefQA
⨍
Functions
207
◇
Types & classes
16
↓ 16 callers
Function
create_int_feature
(values)
run/build_dataset_to_tfrecord.py:164
↓ 15 callers
Method
get_shape
Desc: return the size of input x in DIM.
models/corefqa.py:625
↓ 10 callers
Function
create_initializer
Creates a `truncated_normal_initializer` with the given range.
bert/modeling.py:379
↓ 9 callers
Function
clip_or_pad
(var, max_var_len, pad_idx=-1)
run/build_dataset_to_tfrecord.py:169
↓ 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_
bert/modeling.py:900
↓ 8 callers
Function
file_based_input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
func_builders/input_fn_builder.py:15
↓ 7 callers
Method
boolean_mask_1d
Desc: the same functionality of tf.boolean_mask. The tf.boolean_mask operation is not available on the cloud TPU.
models/corefqa.py:596
↓ 6 callers
Method
close
(self)
run/run_squad.py:1094
↓ 5 callers
Method
boolean_mask_1d
Desc: the same functionality of tf.boolean_mask. The tf.boolean_mask operation is not available on the cloud TPU.
models/mention_proposal.py:268
↓ 5 callers
Method
evaluate
Desc: expected cluster ids is : [[[21, 25], [18, 18]], [[63, 65], [46, 48], [27, 29]], [[88, 88], [89, 89]]] Args:
models/corefqa.py:633
↓ 5 callers
Method
get_sequence_output
Gets final hidden layer of encoder. Returns: float Tensor of shape [batch_size, seq_length, hidden_size] corresponding to
bert/modeling.py:242
↓ 5 callers
Method
tokenize
(self, text)
bert/tokenization.py:170
↓ 5 callers
Method
transform_overlap_sliding_windows_to_original_document
Desc: hidden_size should be equal to embeddding_size. Args: doc_overlap_window_embs: (num_window, window_siz
models/corefqa.py:547
↓ 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
bert/modeling.py:348
↓ 4 callers
Method
ffnn
Desc: fully-connected neural network. transform non-linearly the [input] tensor with [hidden_size] to a fix [output_
models/mention_proposal.py:235
↓ 4 callers
Method
from_json_file
Constructs a `BertConfig` from a json file of parameters.
bert/modeling.py:91
↓ 4 callers
Method
get_mention_proposal_and_loss
Desc: forward function for training mention proposal module. Args: instance: a tuple of train/dev/test data
models/mention_proposal.py:29
↓ 4 callers
Method
scatter_gold_index_to_label_sequence
Desc: transform the mention start/end position index tf.int32 Tensor to a tf.int32 Tensor with 1/0 labels for the input subtoken
models/mention_proposal.py:146
↓ 3 callers
Method
_get_beta_accumulators
(self)
utils/radam.py:56
↓ 3 callers
Method
_get_niter
(self)
utils/radam.py:63
↓ 3 callers
Method
compute_mention_score_and_loss
Desc: compute the unifrom start/end loss and probabilities. Args: pred_sequence_logits: (input_shape, 1)
models/corefqa.py:438
↓ 3 callers
Method
compute_score_and_loss
Desc: compute the unifrom start/end loss and probabilities. Args: pred_sequence_logits: (input_shape, 1)
models/mention_proposal.py:184
↓ 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
Method
ffnn
Desc: fully-connected neural network. transform non-linearly the [input] tensor with [hidden_size] to a fix [output_
models/corefqa.py:576
↓ 3 callers
Method
get_candidate_span_embedding
(self, doc_sequence_embeddings, candidate_span_starts, candidate_span_ends)
models/corefqa.py:465
↓ 3 callers
Method
get_f1
(self)
utils/metrics.py:95
↓ 3 callers
Method
get_gold_mention_sequence_labels_from_pad_index
Desc: the original gold labels is padded to the fixed length and only contains the position index of gold mentions.
models/mention_proposal.py:109
↓ 3 callers
Method
get_mention_score_and_loss
(self, candidate_mention_span_embs, candidate_mention_start_embs, candidate_mention_end_embs, gold_la
models/corefqa.py:411
↓ 3 callers
Method
get_precision
(self)
utils/metrics.py:101
↓ 3 callers
Method
get_prf
(self)
utils/metrics.py:71
↓ 3 callers
Method
get_query_token_ids
Desc: construct question based on the selected mention.
models/corefqa.py:391
↓ 3 callers
Method
get_recall
(self)
utils/metrics.py:98
↓ 3 callers
Function
layer_norm
Run layer normalization on the last dimension of the tensor.
bert/modeling.py:366
↓ 3 callers
Function
reshape_to_matrix
Reshapes a >= rank 2 tensor to a rank 2 tensor (i.e., a matrix).
bert/modeling.py:937
↓ 3 callers
Function
shape
(x, dim)
utils/util.py:96
↓ 3 callers
Function
shape
(x, dim)
tests/tile_repeat.py:12
↓ 3 callers
Method
update
(self, predicted, gold, mention_to_predicted, mention_to_gold)
utils/metrics.py:58
↓ 3 callers
Method
update
(self, predicted, gold, mention_to_predicted, mention_to_gold)
utils/metrics.py:84
↓ 3 callers
Function
whitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
bert/tokenization.py:152
↓ 2 callers
Method
_apply_dense_shared
(self, grad, var)
utils/radam.py:94
↓ 2 callers
Method
_apply_sparse_shared
(self, grad, var, indices, scatter_add)
utils/radam.py:150
↓ 2 callers
Function
_get_best_indexes
Get the n-best logits from a list.
run/run_squad.py:1024
↓ 2 callers
Function
_strip_spaces
(text)
run/run_squad.py:956
↓ 2 callers
Function
compute_loss
(logits, positions)
run/run_squad.py:647
↓ 2 callers
Function
convert_examples_to_features
Loads a data file into a list of `InputBatch`s.
run/run_squad.py:310
↓ 2 callers
Method
convert_tokens_to_ids
(self, tokens)
bert/tokenization.py:178
↓ 2 callers
Method
get_coreference_resolution_and_loss
(self, instance, is_training, use_tpu=False)
models/corefqa.py:30
↓ 2 callers
Function
get_doc_key
(doc_id, part)
data_utils/conll.py:28
↓ 2 callers
Function
input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
run/run_squad.py:688
↓ 2 callers
Method
logging_configs
(self)
data_utils/config_utils.py:27
↓ 2 callers
Function
model_fn_builder
(config, model_sign="mention_proposal")
func_builders/model_fn_builder.py:18
↓ 2 callers
Function
my_convert_keys
(model)
utils/load_pytorch_to_tf.py:45
↓ 2 callers
Function
read_squad_examples
Read a SQuAD json file into a list of SquadExample.
run/run_squad.py:228
↓ 2 callers
Function
reshape_from_matrix
Reshapes a rank 2 tensor back to its original rank >= 2 tensor.
bert/modeling.py:951
↓ 2 callers
Method
scatter_gold_index_to_label_sequence
Desc: transform the mention start/end position index tf.int32 Tensor to a tf.int32 Tensor with 1/0 labels for the input subtoken
models/corefqa.py:494
↓ 2 callers
Method
scatter_span_sequence_labels
Desc: transform the mention (start, end) position pairs to a span matrix gold_span_sequence_labels. matrix[i][j]
models/mention_proposal.py:163
↓ 2 callers
Function
transpose_for_scores
(input_tensor, batch_size, num_attention_heads, seq_length, width)
bert/modeling.py:634
↓ 1 callers
Method
__repr__
(self)
run/run_squad.py:183
↓ 1 callers
Function
_check_is_max_context
Check if this is the 'max context' doc span for the token.
run/run_squad.py:514
↓ 1 callers
Method
_clean_text
Performs invalid character removal and whitespace cleanup on text.
bert/tokenization.py:286
↓ 1 callers
Function
_compute_softmax
Compute softmax probability over raw logits.
run/run_squad.py:1036
↓ 1 callers
Function
_decode_record
Decodes a record to a TensorFlow example.
func_builders/input_fn_builder.py:30
↓ 1 callers
Function
_decode_record
Decodes a record to a TensorFlow example.
run/run_squad.py:702
↓ 1 callers
Method
_do_use_weight_decay
Whether to use L2 weight decay for `param_name`.
bert/optimization.py:159
↓ 1 callers
Method
_get_variable_name
Get the variable name from the tensor name.
bert/optimization.py:169
↓ 1 callers
Function
_improve_answer_span
Returns tokenized answer spans that better match the annotated answer.
run/run_squad.py:477
↓ 1 callers
Method
_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
bert/tokenization.py:264
↓ 1 callers
Function
_is_control
Checks whether `chars` is a control character.
bert/tokenization.py:374
↓ 1 callers
Function
_is_punctuation
Checks whether `chars` is a punctuation character.
bert/tokenization.py:386
↓ 1 callers
Function
_is_whitespace
Checks whether `chars` is a whitespace character.
bert/tokenization.py:362
↓ 1 callers
Method
_run_split_on_punc
Splits punctuation on a piece of text.
bert/tokenization.py:231
↓ 1 callers
Method
_run_strip_accents
Strips accents from a piece of text.
bert/tokenization.py:220
↓ 1 callers
Method
_tokenize_chinese_chars
Adds whitespace around any CJK character.
bert/tokenization.py:251
↓ 1 callers
Method
apply_gradients
See base class.
bert/optimization.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: Py
bert/modeling.py:964
↓ 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
bert/modeling.py:563
↓ 1 callers
Function
construct_sliding_windows
construct sliding windows for BERT processing :param sequence_length: e.g. 9 :param sliding_window_size: e.g. 4 :return: [(0, 4, [1,
run/build_dataset_to_tfrecord.py:378
↓ 1 callers
Function
convert_to_sliding_window
construct sliding windows, allocate tokens and masks into each window :param tokenized_document: :param sliding_window_size: :return:
run/build_dataset_to_tfrecord.py:328
↓ 1 callers
Function
copy_checkpoint
(source, target)
run/transform_spanbert_pytorch_to_tf.py:44
↓ 1 callers
Function
coreference_annotations_to_clusters
convert coreference information to clusters :param annotations: :return:
run/build_dataset_to_tfrecord.py:251
↓ 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_ma
bert/modeling.py:529
↓ 1 callers
Function
create_model
Creates a classification model.
run/run_squad.py:551
↓ 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.
bert/modeling.py:384
↓ 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, emb
bert/modeling.py:433
↓ 1 callers
Function
expand_with_speakers
add speaker name information :param tokenized_document: tokenized document information :return:
run/build_dataset_to_tfrecord.py:360
↓ 1 callers
Function
f1
(p_num, p_den, r_num, r_den, beta=1)
utils/metrics.py:48
↓ 1 callers
Function
flatten_clusters
(clusters)
run/build_dataset_to_tfrecord.py:179
↓ 1 callers
Method
from_dict
Constructs a `BertConfig` from a Python dictionary of parameters.
bert/modeling.py:83
↓ 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. Ret
bert/modeling.py:285
↓ 1 callers
Method
get_candidate_cluster_labels
(self, candidate_mention_starts, candidate_mention_ends, gold_mention_starts, gold_mention_ends,
models/corefqa.py:532
↓ 1 callers
Method
get_candidate_mention_gold_sequence_label
(self, candidate_mention_starts, candidate_mention_ends, gold_start_index_labels, gold_end_index_labe
models/corefqa.py:474
↓ 1 callers
Method
get_dropout
(self, dropout_rate, is_training)
models/corefqa.py:621
↓ 1 callers
Method
get_dropout
(self, dropout_rate, is_training)
models/mention_proposal.py:256
↓ 1 callers
Method
get_f1
(self)
utils/metrics.py:62
↓ 1 callers
Function
get_final_text
Project the tokenized prediction back to the original text.
run/run_squad.py:928
↓ 1 callers
Method
get_precision
(self)
utils/metrics.py:68
↓ 1 callers
Method
get_recall
(self)
utils/metrics.py:65
↓ 1 callers
Function
is_whitespace
(c)
run/run_squad.py:233
↓ 1 callers
Function
layer_norm_and_dropout
Runs layer normalization followed by dropout.
bert/modeling.py:372
next →
1–100 of 207, ranked by callers