Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/DevSinghSachan/syntax-augmented-bert
/ functions
Functions
302 in github.com/DevSinghSachan/syntax-augmented-bert
⨍
Functions
302
◇
Types & classes
67
↓ 20 callers
Method
size
(self)
model/tree.py:25
↓ 10 callers
Method
__init__
(self, config)
model/syntax_bert.py:268
↓ 9 callers
Method
update
(self, prediction, key, *args, **kwargs)
utils/utils.py:564
↓ 6 callers
Method
__init__
(self, inplace=False)
model/graph_encoder.py:73
↓ 5 callers
Method
__init__
(self, tag_to_idx, verbose=False, default_key='O')
utils/utils.py:503
↓ 5 callers
Method
_read_json
(cls, input_file)
utils/utils.py:99
↓ 5 callers
Method
maybe_print
(self, msg)
fp16/fp16_opt.py:240
↓ 4 callers
Method
__init__
(self, in_out_size, bias=True)
model/gate.py:43
↓ 4 callers
Method
__init__
(self, config)
model/syntax_roberta.py:162
↓ 4 callers
Method
_create_examples
Creates examples for the training and dev sets.
utils/utils.py:127
↓ 4 callers
Function
convert_bio_tags_to_conll_format
Converts BIO formatted SRL tags to the format required for evaluation with the official CONLL 2005 perl script. Spans are represented by brac
utils/srl_utils.py:95
↓ 4 callers
Function
map_to_ids
(tokens, vocab)
utils/utils.py:801
↓ 4 callers
Method
sentence_iterator
An iterator over the sentences in an individual CONLL formatted file.
dataset_reader/conll2005_utils.py:146
↓ 4 callers
Function
simple_accuracy
(preds, labels)
utils/utils.py:376
↓ 4 callers
Method
step
If no closure is supplied, :attr:`step` should be called after ``fp16_optimizer_obj.backward(loss)``. :attr:`step` updates t
fp16/fp16_opt.py:397
↓ 3 callers
Method
_create_examples
Creates examples for the training and dev sets.
utils/utils.py:171
↓ 3 callers
Method
_create_examples
Creates examples for the training and dev sets.
utils/utils.py:220
↓ 3 callers
Method
_create_examples
Creates examples for the training and dev sets.
utils/utils.py:288
↓ 3 callers
Method
_read_json
(cls, input_file)
utils/utils.py:164
↓ 3 callers
Method
_read_json
(cls, input_file)
utils/utils.py:281
↓ 3 callers
Method
_read_tsv
Reads a tab separated value file.
utils/utils.py:89
↓ 3 callers
Method
dataset_path_iterator
An iterator returning file_paths in a directory containing CONLL-formatted files.
dataset_reader/conll2005_utils.py:108
↓ 3 callers
Function
evaluate
(args, model, tokenizer, prefix='', split='dev')
main.py:192
↓ 3 callers
Function
get_positions
Get subj/obj position sequence.
utils/utils.py:806
↓ 3 callers
Function
pool
(h, mask, type='max')
model/graph_encoder.py:32
↓ 3 callers
Function
postprocess
(file_path, out_file_path, split_type)
utils/conll_to_jsonl.py:12
↓ 3 callers
Method
save_pretrained
Save a model and its configuration file to a directory, so that it can be re-loaded using the `:func: from_pretrained`` class method.
model/graph_encoder.py:103
↓ 3 callers
Method
transpose_for_scores
(self, x)
model/graph_encoder.py:355
↓ 3 callers
Method
transpose_for_scores
(self, x)
model/syntax_bert.py:110
↓ 2 callers
Method
_compute_metrics
(true_positives: int, false_positives: int, false_negatives: int)
utils/utils.py:755
↓ 2 callers
Method
_master_params_to_model_params
(self)
fp16/fp16_opt.py:289
↓ 2 callers
Function
_safe_sparse_mask
In PyTorch 1.0, Tensor._sparse_mask was changed to Tensor.sparse_mask. This wrapper allows AllenNLP to (temporarily) work with both 1.0 and 0
utils/optimizers.py:128
↓ 2 callers
Function
_tokenize_with_bert
Wordpiece-tokenize a list of tokens and return vocab ids.
utils/loader.py:79
↓ 2 callers
Method
_update_scale
(self, has_overflow=False)
fp16/fp16_opt.py:286
↓ 2 callers
Method
add_child
(self,child)
model/tree.py:20
↓ 2 callers
Function
argmax
(vec)
model/crf.py:17
↓ 2 callers
Method
backward
(self, loss, retain_graph=False)
fp16/loss_scaler.py:58
↓ 2 callers
Function
conversion_helper
Apply conversion to val. Recursively apply conversion if `val` is a nested tuple/list structure.
fp16/fp16_opt.py:28
↓ 2 callers
Method
get_chunks
Given a sequence of tags, group entities and their position Args: seq: [4, 4, 0, 0, ...] sequence of labels tags: dict
utils/utils.py:524
↓ 2 callers
Method
get_labels
Gets the list of labels for this data set.
utils/utils.py:84
↓ 2 callers
Method
get_stats
(self, *args, **kwargs)
utils/utils.py:575
↓ 2 callers
Function
load_and_cache_examples
(args, task, tokenizer, split='train')
main.py:243
↓ 2 callers
Method
load_state_dict
(self, state_dict, strict=True)
fp16/fp16_opt.py:70
↓ 2 callers
Function
log_sum_exp_matrix
(matrix)
model/crf.py:37
↓ 2 callers
Function
master_params_to_model_params
Copy master parameters to model parameters. Args: model_params: List of model parameters created by :func:`prep_param_lists`.
fp16/fp16util.py:171
↓ 2 callers
Method
multi_head_attention
(self, key, value, query, attention_mask, dropout_ratio=0.1)
model/syntax_bert.py:115
↓ 2 callers
Method
resize_token_embeddings
(self, new_num_tokens=None)
model/graph_encoder.py:89
↓ 2 callers
Function
set_seed
(args)
main.py:43
↓ 2 callers
Method
state_dict
(self, destination=None, prefix='', keep_vars=False)
fp16/fp16_opt.py:67
↓ 2 callers
Method
step
Performs a single optimization step. Parameters ---------- closure : ``callable``, optional. A closure th
utils/optimizers.py:271
↓ 2 callers
Method
text_to_instance
We take `pre-tokenized` input here, along with a verb label. The verb label should be a one-hot binary vector, the same length as th
dataset_reader/conll2005_reader.py:151
↓ 2 callers
Method
text_to_instance
We take `pre-tokenized` input here, along with a verb label. The verb label should be a one-hot binary vector, the same length as th
dataset_reader/ontonotes_srl_reader.py:219
↓ 2 callers
Function
update_config_file
(config_path, json_args)
utils/update_config.py:14
↓ 2 callers
Function
write_conll_formatted_tags_to_file
Prints predicate argument predictions and gold labels for a single verbal predicate in a sentence to two provided file references. The Co
utils/srl_utils.py:48
↓ 2 callers
Method
zero_grad
Zero fp32 and fp16 parameter grads.
fp16/fp16_opt.py:250
↓ 1 callers
Function
BN_convert_float
Utility function for network_to_half(). Retained for legacy purposes.
fp16/fp16util.py:37
↓ 1 callers
Method
__init__
(self, examples, opt=None, tokenizer=None, label_map=None, mask_padding_with_zero=True, pad_t
utils/loader.py:125
↓ 1 callers
Method
__init__
(self, optimizer, freeze_steps, warmup_steps=16000, hidden_size=768, t_total=-1, last_epoch=-1)
utils/schedulers.py:6
↓ 1 callers
Method
__init__
(self, label_size, label_smoothing=0.1)
model/loss.py:12
↓ 1 callers
Method
__init__
(self)
fp16/fp16util.py:30
↓ 1 callers
Method
_check_overflow
(self)
fp16/fp16_opt.py:276
↓ 1 callers
Function
_compute_alignment
(word_idxs, subword_token_len)
utils/loader.py:94
↓ 1 callers
Method
_conll_rows_to_sentence
(self, conll_rows: List[str])
dataset_reader/conll2005_utils.py:153
↓ 1 callers
Method
_conll_rows_to_sentence
(self, conll_rows: List[str])
dataset_reader/ontonotes_utils.py:243
↓ 1 callers
Function
_convert_tags_to_wordpiece_tags
Converts a series of BIO tags to account for a wordpiece tokenizer, extending/modifying BIO tags where appropriate to deal with words which
dataset_reader/ontonotes_srl_reader.py:11
↓ 1 callers
Function
_convert_verb_indices_to_wordpiece_indices
Converts binary verb indicators to account for a wordpiece tokenizer, extending/modifying BIO tags where appropriate to deal with words which
dataset_reader/conll2005_reader.py:10
↓ 1 callers
Function
_convert_verb_indices_to_wordpiece_indices
Converts binary verb indicators to account for a wordpiece tokenizer, extending/modifying BIO tags where appropriate to deal with words which
dataset_reader/ontonotes_srl_reader.py:56
↓ 1 callers
Method
_create_examples
Creates examples for the training and dev sets.
utils/utils.py:325
↓ 1 callers
Method
_downscale_master
(self)
fp16/fp16_opt.py:303
↓ 1 callers
Method
_emission_potential_score
(self, feats_batch, tags_batch)
model/crf.py:151
↓ 1 callers
Method
_forward_alg_batch
(self, feats_batch, sequence_lengths)
model/crf.py:88
↓ 1 callers
Function
_get_boundary_sensitive_alignment
(word_pieces, raw_tokens, alignment)
utils/loader.py:105
↓ 1 callers
Function
_handle_long_sent_parses
(dep_head, dep_rel, length)
utils/loader.py:56
↓ 1 callers
Method
_has_inf_or_nan
(x)
fp16/loss_scaler.py:45
↓ 1 callers
Method
_model_grads_to_master_grads
(self)
fp16/fp16_opt.py:299
↓ 1 callers
Function
_normalize_word
(word: str)
dataset_reader/ontonotes_ner_reader.py:9
↓ 1 callers
Method
_ontonotes_subset
Iterates over the Ontonotes 5.0 dataset using an optional domain identifier. If the domain identifier is present, only examples which
dataset_reader/ontonotes_srl_reader.py:209
↓ 1 callers
Method
_ontonotes_subset
Iterates over the Ontonotes 5.0 dataset using an optional domain identifier. If the domain identifier is present, only examples which
dataset_reader/ontonotes_ner_reader.py:67
↓ 1 callers
Method
_process_coref_span_annotations_for_word
For a given coref label, add it to a currently open span(s), complete a span(s) or ignore it, if it is outside of all spans. This met
dataset_reader/ontonotes_utils.py:376
↓ 1 callers
Method
_process_span_annotations_for_word
Given a sequence of different label types for a single word and the current span label we are inside, compute the BIO tag for each la
dataset_reader/conll2005_utils.py:229
↓ 1 callers
Method
_process_span_annotations_for_word
Given a sequence of different label types for a single word and the current span label we are inside, compute the BIO tag for each la
dataset_reader/ontonotes_utils.py:427
↓ 1 callers
Method
_score_sentence_batch
(self, feats_batch, tags_batch, sequence_lengths)
model/crf.py:130
↓ 1 callers
Method
_sequence_mask
(self, seq_len, device)
model/crf.py:142
↓ 1 callers
Method
_step_with_closure
(self, closure)
fp16/fp16_opt.py:453
↓ 1 callers
Method
_transition_potential_score
(self, tags_batch)
model/crf.py:159
↓ 1 callers
Method
_viterbi_decode
(self, feats)
model/crf.py:177
↓ 1 callers
Method
_wordpiece_tokenize_input
Convert a list of tokens to wordpiece tokens and offsets, as well as adding BERT CLS and SEP tokens to the begining and end of the se
dataset_reader/conll2005_reader.py:77
↓ 1 callers
Method
_wordpiece_tokenize_input
Convert a list of tokens to wordpiece tokens and offsets, as well as adding BERT CLS and SEP tokens to the begining and end of the se
dataset_reader/ontonotes_srl_reader.py:129
↓ 1 callers
Function
_wp_aligned_dep_parse
(word_idxs, subword_token_len, dep_head, dep_rel)
utils/loader.py:16
↓ 1 callers
Function
acc_and_f1
(preds, labels)
utils/utils.py:380
↓ 1 callers
Method
allowed_transitions
(self)
model/crf.py:67
↓ 1 callers
Function
build_torch_optimizer
(opt)
utils/optimizers.py:140
↓ 1 callers
Method
convert_examples_to_features
Loads a data file into a list of `InputBatch`s
utils/loader.py:159
↓ 1 callers
Function
convert_module
Converts a module's immediate parameters and buffers to dtype.
fp16/fp16util.py:59
↓ 1 callers
Function
convert_network
Converts a network's parameters and buffers to dtype.
fp16/fp16util.py:75
↓ 1 callers
Method
dataset_document_iterator
An iterator over CONLL formatted files which yields documents, regardless of the number of document annotations in a particular file.
dataset_reader/conll2005_utils.py:124
↓ 1 callers
Method
dataset_document_iterator
An iterator over CONLL formatted files which yields documents, regardless of the number of document annotations in a particular file.
dataset_reader/ontonotes_utils.py:208
↓ 1 callers
Method
dataset_path_iterator
An iterator returning file_paths in a directory containing CONLL-formatted files.
dataset_reader/ontonotes_utils.py:192
↓ 1 callers
Method
encode_with_rnn
(self, rnn_inputs, seq_lens)
model/graph_encoder.py:189
↓ 1 callers
Method
fit
(self, t_total)
utils/optimizers.py:190
next →
1–100 of 302, ranked by callers