Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ACL2020SpellGCN/SpellGCN
/ functions
Functions
90 in github.com/ACL2020SpellGCN/SpellGCN
⨍
Functions
90
◇
Types & classes
12
↓ 10 callers
Function
create_initializer
Creates a `truncated_normal_initializer` with the given range.
modeling.py:374
↓ 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_rank:
modeling.py:894
↓ 7 callers
Function
create_int_feature
(values)
run_spellgcn.py:853
↓ 6 callers
Method
get_mode
(self)
run_spellgcn.py:583
↓ 4 callers
Function
convert_by_vocab
Converts a sequence of [tokens|ids] using the vocab.
tokenization.py:137
↓ 4 callers
Function
dropout
Perform dropout. Args: input_tensor: float Tensor. dropout_prob: Python float. The probability of dropping out a value (NOT of *keepi
modeling.py:343
↓ 3 callers
Function
convert_to_unicode
Converts `text` to Unicode (if it's not already), assuming utf-8 input.
tokenization.py:79
↓ 3 callers
Function
file_based_convert_examples_to_features
Convert a set of `InputExample`s to a TFRecord file.
run_spellgcn.py:840
↓ 3 callers
Function
file_based_input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
run_spellgcn.py:883
↓ 3 callers
Method
get_labels
See base class.
run_spellgcn.py:691
↓ 3 callers
Function
layer_norm
Run layer normalization on the last dimension of the tensor.
modeling.py:361
↓ 3 callers
Function
reshape_to_matrix
Reshapes a >= rank 2 tensor to a rank 2 tensor (i.e., a matrix).
modeling.py:931
↓ 3 callers
Function
whitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
tokenization.py:153
↓ 2 callers
Method
convert_tokens_to_ids
(self, tokens)
tokenization.py:179
↓ 2 callers
Function
create_float_feature
(values)
run_spellgcn.py:857
↓ 2 callers
Method
get_dev_full_examples
See base class.
run_spellgcn.py:606
↓ 2 callers
Function
reshape_from_matrix
Reshapes a rank 2 tensor back to its original rank >= 2 tensor.
modeling.py:945
↓ 2 callers
Function
transpose_for_scores
(input_tensor, batch_size, num_attention_heads, seq_length, width)
modeling.py:628
↓ 1 callers
Method
_clean_text
Performs invalid character removal and whitespace cleanup on text.
tokenization.py:287
↓ 1 callers
Function
_decode_record
Decodes a record to a TensorFlow example.
run_spellgcn.py:904
↓ 1 callers
Method
_do_use_weight_decay
Whether to use L2 weight decay for `param_name`.
optimization.py:164
↓ 1 callers
Method
_get_variable_name
Get the variable name from the tensor name.
optimization.py:174
↓ 1 callers
Method
_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
tokenization.py:265
↓ 1 callers
Function
_is_control
Checks whether `chars` is a control character.
tokenization.py:375
↓ 1 callers
Function
_is_punctuation
Checks whether `chars` is a punctuation character.
tokenization.py:387
↓ 1 callers
Function
_is_whitespace
Checks whether `chars` is a whitespace character.
tokenization.py:363
↓ 1 callers
Method
_run_split_on_punc
Splits punctuation on a piece of text.
tokenization.py:232
↓ 1 callers
Method
_run_strip_accents
Strips accents from a piece of text.
tokenization.py:221
↓ 1 callers
Method
_tokenize_chinese_chars
Adds whitespace around any CJK character.
tokenization.py:252
↓ 1 callers
Method
apply_gradients
See base class.
optimization.py:113
↓ 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: Python i
modeling.py:958
↓ 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 all
modeling.py:557
↓ 1 callers
Function
build_gcn_output
(adj_mat, w2n, n2w, embedding_table, bert_config, is_training)
run_spellgcn.py:321
↓ 1 callers
Method
convert_ids_to_tokens
(self, ids)
tokenization.py:182
↓ 1 callers
Function
convert_single_example
Converts a single `InputExample` into a single `InputFeatures`.
run_spellgcn.py:695
↓ 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_mask: in
modeling.py:523
↓ 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. vocab_s
modeling.py:379
↓ 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, embedding
modeling.py:427
↓ 1 callers
Method
from_dict
Constructs a `BertConfig` from a Python dictionary of parameters.
modeling.py:82
↓ 1 callers
Method
from_json_file
Constructs a `BertConfig` from a json file of parameters.
modeling.py:90
↓ 1 callers
Function
gather_indexes
Gathers the vectors at the specific positions over a minibatch.
run_spellgcn.py:560
↓ 1 callers
Function
gcnLayer
(gcn_in, in_dim, gcn_dim, batch_size, max_nodes, max_labels, adj_mat, w_gating=True, num_layers=1, dropout=1
run_spellgcn.py:254
↓ 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. Returns:
modeling.py:279
↓ 1 callers
Method
get_embedding_table
(self)
modeling.py:259
↓ 1 callers
Function
get_masked_lm_output
Get loss and log probs for the masked LM.
run_spellgcn.py:515
↓ 1 callers
Method
get_sequence_output
Gets final hidden layer of encoder. Returns: float Tensor of shape [batch_size, seq_length, hidden_size] corresponding to the final h
modeling.py:236
↓ 1 callers
Method
get_train_full_examples
See base class.
run_spellgcn.py:651
↓ 1 callers
Function
layer_norm_and_dropout
Runs layer normalization followed by dropout.
modeling.py:367
↓ 1 callers
Function
load_confusionset
(confusionset_fn)
data/gcn_graph.ty_xj/analyze.py:15
↓ 1 callers
Function
load_graph
()
run_spellgcn.py:960
↓ 1 callers
Function
load_relation_vocab
(relation_vocab_fn)
data/gcn_graph.ty_xj/analyze.py:9
↓ 1 callers
Function
load_vocab
Loads a vocabulary file into a dictionary.
tokenization.py:122
↓ 1 callers
Function
metric_fn
Computes the loss and accuracy of the model.
run_spellgcn.py:479
↓ 1 callers
Function
model_fn_builder
Returns `model_fn` closure for TPUEstimator.
run_spellgcn.py:375
↓ 1 callers
Function
set_rand_seed
(seed)
run_spellgcn.py:957
↓ 1 callers
Method
to_dict
Serializes this instance to a Python dictionary.
modeling.py:96
↓ 1 callers
Method
tokenize
(self, text)
tokenization.py:171
↓ 1 callers
Function
transformer_model
Multi-headed, multi-layer Transformer from "Attention is All You Need". This is almost an exact implementation of the original Transformer encoder.
modeling.py:753
Method
__init__
(self, vocab_file, do_lower_case=True)
tokenization.py:165
Method
__init__
Constructs a BasicTokenizer. Args: do_lower_case: Whether to lower case the input.
tokenization.py:189
Method
__init__
(self, vocab, unk_token="[UNK]", max_input_chars_per_word=200)
tokenization.py:304
Method
__init__
Constructs a AdamWeightDecayOptimizer.
optimization.py:95
Method
__init__
Constructs BertConfig. Args: vocab_size: Vocabulary size of `inputs_ids` in `BertModel`. hidden_size: Size of the encoder layers and
modeling.py:33
Method
__init__
Constructor for BertModel. Args: config: `BertConfig` instance. is_training: bool. true for training model, false for eval model. Con
modeling.py:130
Method
__init__
(self, intervel)
run_spellgcn.py:171
Method
__init__
Constructs a InputExample. Args: guid: Unique id for the example. text_a: string. The untokenized text of the first sequence. For sin
run_spellgcn.py:198
Method
__init__
(self, input_ids, input_mask, segment_ids, masked_
run_spellgcn.py:234
Method
__init__
(self)
run_spellgcn.py:603
Method
_read_tsv
Reads a tab separated value file.
run_spellgcn.py:590
Method
after_run
(self, run_context, run_values)
run_spellgcn.py:187
Method
before_run
(self, run_context)
run_spellgcn.py:183
Function
convert_ids_to_tokens
(inv_vocab, ids)
tokenization.py:149
Function
convert_tokens_to_ids
(vocab, tokens)
tokenization.py:145
Function
create_optimizer
Creates an optimizer training op.
optimization.py:25
Function
gelu
Gaussian Error Linear Unit. This is a smoother version of the RELU. Original paper: https://arxiv.org/abs/1606.08415 Args: x: float Tensor
modeling.py:263
Method
get_all_encoder_layers
(self)
modeling.py:245
Function
get_assignment_map_from_checkpoint
Compute the union of the current variables and checkpoint variables.
modeling.py:316
Method
get_embedding_output
Gets output of the embedding lookup (i.e., input to the transformer). Returns: float Tensor of shape [batch_size, seq_length, hidden_size]
modeling.py:248
Method
get_labels
Gets the list of labels for this data set.
run_spellgcn.py:585
Method
get_pooled_output
(self)
modeling.py:233
Method
get_train_full_examples
Gets a collection of `InputExample`s for the train set.
run_spellgcn.py:578
Function
input_fn
The actual input function.
run_spellgcn.py:919
Function
main
(_)
run_spellgcn.py:1001
Function
model_fn
The `model_fn` for TPUEstimator.
run_spellgcn.py:380
Function
printable_text
Returns text encoded in a way suitable for print or `tf.logging`.
tokenization.py:99
Method
to_json_string
Serializes this instance to a JSON string.
modeling.py:101
Method
tokenize
Tokenizes a piece of text.
tokenization.py:197
Method
tokenize
Tokenizes a piece of text into its word pieces. This uses a greedy longest-match-first algorithm to perform tokenization using the given voca
tokenization.py:309
Function
tpu_scaffold
()
run_spellgcn.py:429
Function
validate_case_matches_checkpoint
Checks whether the casing config is consistent with the checkpoint name.
tokenization.py:28