MCPcopy Create free account

hub / github.com/google-research/language / functions

Functions6,154 in github.com/google-research/language

Functionapply_target
Return target string with non-terminals replaced with substitutions.
language/compgen/nqg/model/qcfg/qcfg_rule.py:92
Methodapprox_vocab_size
(self)
language/labs/consistent_zero_shot_nmt/data_generators/translate_multilingual.py:56
Methodas_domain_sym
(entity_id)
language/nql/nql/__init__.py:712
Methodas_fixed_length_tensor
(seq, seq_len)
language/realm/featurization.py:303
Methodas_pprintable
(v)
language/nql/nql/__init__.py:1925
Methodas_range_sym
(entity_id)
language/nql/nql/__init__.py:715
Methodas_weighted_triples
Make the value of a SparseTensor for a relation human-readable. The human-readable format is a dictionary mapping tuples of strings (rel_name
language/nql/nql/__init__.py:696
Functionassert_same
Assert that both structures are equivalent. This function is more strict than tf.nest.assert_same_structure since it also requires that Tensors h
language/common/utils/nest_utils.py:137
Functionassert_shape_match
(inp, out)
language/labs/consistent_zero_shot_nmt/utils/model_utils.py:185
Functionassert_shapes_match
(decode_steps_a, decode_steps_b)
language/xsp/model/decode_utils.py:157
Methodassign_weights
Assign weights from checkpoint to model.
language/search_agents/muzero/transformer_encoder.py:254
Methodat_most_k_cells_north
(k, c)
language/nql/nql/nql_test.py:486
Functionattention
Multihead dot-product attention. Args: query_antecedent: <float>[batch_size, query_length, query_emb_size] memory_antecedent: <float>[batch
language/xsp/model/common_layers.py:315
Functionattention_bias_ignore_padding
Create a bias tensor to be added to attention logits. Out-of-range elements will have an effective negative-infinity value. Args: source_len
language/xsp/model/common_layers.py:365
Functionattention_bias_lower_triangle
Create a bias tensor to be added to attention logits. Masked elements will have an effective negative-infinity value. Args: length: Integer
language/xsp/model/common_layers.py:344
Functionaugment_exemplars
Generates (input, output) pair where the input is retrieval-augmented. Args: example: Original RawExample. exemplars: List of exemplars to
language/casper/augment/casper_formatters.py:263
Functionbasic_decoder
Decoder. Args: features: Dictionary of input Tensors. mode: train or eval. Keys from tf.estimator.ModeKeys. vocab: A list of strings of
language/labs/exemplar_decoding/models/hypernet.py:305
Functionbasic_decoder
Decoder. Args: features: Dictionary of input Tensors. mode: train or eval. Keys from tf.estimator.ModeKeys. vocab: A list of strings of
language/labs/exemplar_decoding/models/baselines.py:228
Functionbasic_gnmt_bahdanau_att_multi
Hparams for LSTM with bahdanau attention.
language/labs/consistent_zero_shot_nmt/models/basic.py:350
Functionbasic_gnmt_luong_att_multi
Hparams for LSTM with luong attention.
language/labs/consistent_zero_shot_nmt/models/basic.py:358
Functionbasic_nmt_bilstm_bahdanau_att_multi
Hparams for LSTM with bahdanau attention.
language/labs/consistent_zero_shot_nmt/models/basic.py:296
Functionbasic_nmt_bilstm_luong_att_multi
Hparams for LSTM with luong attention.
language/labs/consistent_zero_shot_nmt/models/basic.py:304
Functionbatch_boolean_mask
Get indices of true values. Args: mask: [batch_size, num_values] Returns: true_indices: [batch_size, max_true] gathered_mask: [batch
language/labs/exemplar_decoding/utils/tensor_utils.py:54
Functionbatch_gather
Gather indices into any dimension rather than dimension 0 of a tensor. Gathering is usually performed on dimension 0 of a tensor, such as a word
language/labs/exemplar_decoding/utils/tensor_utils.py:112
Methodbatch_size
(self)
language/labs/exemplar_decoding/models/attention.py:200
Functionbeam_decoder
Beam search decoder. Args: features: Dictionary of input Tensors. mode: train or eval. Keys from tf.estimator.ModeKeys. vocab: A list o
language/labs/exemplar_decoding/models/hypernet.py:478
Functionbeam_decoder
Beam search decoder. Args: features: Dictionary of input Tensors. mode: train or eval. Keys from tf.estimator.ModeKeys. vocab: A list o
language/labs/exemplar_decoding/models/baselines.py:397
Functionbeam_search
Beam search for transformer machine translation. Args: inputs: array: [batch_size, length] int32 sequence of tokens. cache: flax attention
language/gscan/xattn_model/model/decode.py:170
Functionbeam_search
Beam search with length penalties. Requires a function that can take the currently decoded sybmols and return the logits for the next symbol. The
language/xsp/model/beam_search.py:282
Functionbeam_search_decode
Decode for a given number of steps.
language/capwap/utils/transformer_utils.py:553
Functionbeam_search_loop_body_fn
Beam search loop state update function.
language/gscan/xattn_model/model/decode.py:230
Functionbeam_search_loop_cond_fn
Beam search loop termination condition.
language/gscan/xattn_model/model/decode.py:207
Functionbert_preprocess
Pre-processes a text tuple into BERT format. Args: text_segments (Tensor): 1-D Tensor of un-tokenized text segments (string). These will
language/conpono/reconstruct/preprocess.py:477
Functionbert_tokens_to_words
Maps word-pieces to the full word they are a part of. Given a word-piece tokenized sequence, returns a sequence of the same length which, at posi
language/search_agents/muzero/utils.py:197
Functionbest_export_path
(model_dir, best_prefix="best")
language/common/utils/export_utils.py:59
Functionbody
A decoding step.
language/capwap/synthetic/generate_questions.py:275
Methodbody
(self, features)
language/labs/consistent_zero_shot_nmt/models/agreement.py:347
Methodbody
(self, features)
language/labs/consistent_zero_shot_nmt/models/agreement.py:500
Methodbody
Process features and produce outputs.
language/labs/consistent_zero_shot_nmt/models/basic.py:172
Functionbooks_pipeline
Read Books Corpus filenames and create Beam pipeline.
language/conpono/cpc/preproc/books_preproc_pipeline.py:205
Functionbooks_pipeline
Read Books Corpus filenames and create Beam pipeline.
language/conpono/create_pretrain_data/books_preproc_pipeline.py:155
Functionboolean_mask
Select elements from tensor where mask is True, and pads the rest with 0. Example: tensor = [1 2 3 4 5 6 7] mask = [T T F F T T T] ou
language/capwap/utils/tensor_utils.py:24
Methodbottom
Transforms features to feed into body. Ensures that all language tags are transformed using input modality. Args: features: dict of st
language/labs/consistent_zero_shot_nmt/models/basic.py:44
Functionbucket_by_quantiles
Dynamically bucket a `tf.data.Dataset` based on the element's length. Keeps track of a histogram of the input elements lengths, and yields batches
language/boolq/utils/ops.py:128
Functionbucket_fn
Compute the element bucket and update the histogram.
language/boolq/utils/ops.py:169
Methodbuild
(self, input_shape)
language/labs/exemplar_decoding/models/linear.py:199
Methodbuild
Parameter variables are already constructed in __init__. This function should never be called and aims only to keep consistency.
language/labs/exemplar_decoding/models/hyperlstm.py:309
Methodbuild
(self, input_shape)
language/serene/layers.py:172
Functionbuild_bidirectional_rnn
Builds sequences encoded with a bidirectional RNN.
language/labs/consistent_zero_shot_nmt/utils/model_utils.py:345
Functionbuild_count_matrix
Build a sparse matrix of size ngrams to doc ids with counts.
language/labs/drkit/search_utils.py:46
Methodbuild_encoder_fn
Function to be called by tf.data.Dataset.map from TFDS to encoder input. For example, the encoder will probably want to take the text input,
language/serene/preprocessing.py:142
Methodbuild_encoder_fn
(self)
language/serene/preprocessing.py:347
Functionbuild_feature_dict_mapper
Build a function for tf.data.Dataset.map. Args: feature_names: List of feature names. Returns: A function converting tuples into (dictio
language/nql/nql/dataset.py:248
Functionbuild_logits
Builds logits for sequences and a given modality.
language/labs/consistent_zero_shot_nmt/utils/model_utils.py:425
Functionbuild_model
Wrapper around for Decomposable Attention model for NQ long answer scoring. Args: question_tok_wid: <int32> [batch_size, question_len] ques
language/question_answering/decatt_docreader/models/nq_long_decatt_model.py:208
Functionbuild_model_fn
Builds model function based on model_config.
language/xsp/model/model_builder.py:50
Functionbuild_planner_inputs
Convert text to TextInputs for conditional text planner. Args: question: <string>, space-separated token string. answer: <string>, space-se
language/capwap/utils/text_utils.py:297
Functionbuild_question_starter_vocab
Build a vocab of first word question tokens.
language/bert_extraction/steal_bert_qa/data_generation/preprocess_util.py:43
Functionbuild_question_starter_vocab_boolq
Build a vocab of first word question tokens.
language/bert_extraction/steal_bert_qa/data_generation/preprocess_util.py:64
Functionbuild_text_inputs
Convert text to TextInputs. Args: text: <string>, space-separated token string. length: Length to pad or truncate to. lookup_table: Ins
language/capwap/utils/text_utils.py:249
Functionbuild_thief_vocab
Return unigram freqs of thief dataset used for building random paras.
language/bert_extraction/steal_bert_qa/data_generation/preprocess_util.py:83
Functionbuild_train_op
Creates the training operation.
language/xsp/model/adam_weight_decay.py:255
Functionbuild_train_op_with_pretraining
(loss, model_config, pretrained_variable_names, use_tpu)
language/xsp/model/adam_weight_decay.py:267
Functionbuild_unidirectional_rnn
Builds sequences encoded with a unidirectional RNN.
language/labs/consistent_zero_shot_nmt/utils/model_utils.py:320
Functionbuild_vocab
find all words in input corpus to build a vocabulary.
language/bert_extraction/steal_bert_classifier/data_generation/preprocess_util.py:29
Functionbytes_feature_list
(values)
language/capwap/utils/io_utils.py:67
Functioncalculate_metrics
Computes metrics for the scored_annotations for each subset. Standard subsets can include all of the data, only the true positives labeled by the
language/diffqg/metrics.py:368
Methodcall
(self, inputs)
language/labs/exemplar_decoding/models/linear.py:258
Methodcall
Run the cell and output projection on inputs, starting from state.
language/labs/exemplar_decoding/models/output_wrapper.py:188
Methodcall
Run one step of HyperLSTM. Args: inputs: input Tensor, 2D, `[batch, num_units]. state: if `state_is_tuple` is False, this must be a s
language/labs/exemplar_decoding/models/hyperlstm.py:370
Methodcall
Perform a step of attention-wrapped RNN. - Step 1: Mix the `inputs` and previous step's `attention` output via `cell_input_fn`. - Step
language/labs/consistent_zero_shot_nmt/modules/attention_wrappers.py:169
Methodcall
(self, inputs)
language/serene/layers.py:24
Methodcall
(self, inputs, **kwargs)
language/serene/layers.py:103
Methodcall
(self, inputs)
language/serene/layers.py:146
Methodcall
(self, inputs, **kwargs)
language/serene/layers.py:195
Methodcall
(self, inputs, **kwargs)
language/serene/layers.py:209
Methodcall
(self, inputs, **kwargs)
language/serene/layers.py:254
Methodcall
(self, inputs, **kwargs)
language/serene/layers.py:300
Methodcall
(self, inputs, **kwargs)
language/serene/layers.py:359
Methodcall
Compute similarity between inputs via product. In tensor size descriptions, ... indicates an arbitrary number of dimensions. For example,
language/serene/layers.py:388
Methodcall
(self, y_true, y_pred)
language/serene/losses.py:29
Methodcall
(self, y_true, y_pred)
language/serene/losses.py:44
Methodcall
Model forward pass. Args: inputs: Input dictionary, dependent on type of embedder used embed_claim: Whether to embed the claim
language/serene/model.py:218
Methodcall
Computes scores for a batch of anchored rule applications. Args: wordpiece_encodings: <float>[batch_size, max_num_wordpieces, bert_dims]
language/compgen/nqg/model/parser/nqg_model.py:110
Methodcall
Returns scores for a batch of anchored rule applications. Args: wordpiece_ids_batch: <int>[batch_size, max_num_wordpieces] num_wordpi
language/compgen/nqg/model/parser/nqg_model.py:167
Methodcall
(self, inputs)
language/nql/nql/__init__.py:1815
Methodcall
(self, y_true, y_pred)
language/nql/nql/__init__.py:1829
Methodcall
(self, inputs)
language/common/layers/affine_transform.py:54
Functioncall_apply_masking
(x)
language/conpono/cpc/run_cc_cpc.py:461
Functioncall_apply_masking
(x)
language/conpono/cpc/run_bilin_cpc.py:507
Functioncall_get_target_tokens
(x)
language/conpono/cpc/run_cc_cpc.py:452
Functioncall_get_target_tokens
(x)
language/conpono/cpc/run_bilin_cpc.py:498
Functioncall_sample_mask_indices
(x)
language/conpono/cpc/run_cc_cpc.py:445
Functioncall_sample_mask_indices
(x)
language/conpono/cpc/run_bilin_cpc.py:491
Functioncan_derive
Return True if `goal_rule` can be derived given `rules`. We perform a relatively naive breadth first search (BFS), with early pruning in cases wh
language/compgen/nqg/model/induction/derivation_utils.py:126
Functioncan_parse
Return True if source and target can be derived given rules using parser. Args: source: Source string (cannot contain non-terminals). targe
language/compgen/csl/qcfg/qcfg_parser.py:122
Functioncan_parse
Return True if target can be derived given rules using parser. Args: target: Target string (can contain non-terminals or terminals). rules:
language/compgen/csl/qcfg/qcfg_target_parser.py:120
Functioncan_parse
Returns True if there exists >=1 parse of target_string given rules.
language/compgen/csl/targets/target_grammar.py:101
Functioncan_parse
Return True if source and target can be derived given rules using parser. Args: source: Source string (cannot contain non-terminals). targe
language/compgen/nqg/model/qcfg/qcfg_parser.py:108
Functioncan_parse
Returns True if there exists >=1 parse of target_string given rules.
language/compgen/nqg/model/parser/inference/targets/target_grammar.py:120
← previousnext →3,501–3,600 of 6,154, ranked by callers